gitbook-api

API Client for GitBook.com (gitbook.com)

Usage no npm install needed!

<script type="module">
  import gitbookApi from 'https://cdn.skypack.dev/gitbook-api';
</script>

README

gitbook-api

Build Status NPM version

Node and browser, javascript client for the GitBook.com API.

Installation

$ npm install gitbook-api --save

Usages

const GitBookAPI = require('gitbook-api');
const client = new GitBookAPI();

Or create an API client with an authentified user:

const client = new GitBookAPI({
    username: 'MyUsername',
    token: 'password or token'
});

Or using an OAuth token:

var client = new GitBookAPI({
    token: 'oauth token'
});

Then execute API requests:

client.get('book/you/yourbook')
.then((json) => {})
.catch(err => {})

client.post('book/you/yourbook/discussions/1/comments', { ... })