Client library
Install and use GitBook's official Node.js client library
Last updated
Was this helpful?
Install and use GitBook's official Node.js client library
Last updated
Was this helpful?
Was this helpful?
To start using the GitBook client library, you’ll first need to initialize the library with your developer token.
When using the @gitbook/api module with Node.js < v18, you should pass a custom fetch function.
You can install one using the node-fetch module.
npm install @gitbook/apiimport { GitBookAPI } from '@gitbook/api';
const client = new GitBookAPI({
authToken: <your_access_token>
});import { GitBookAPI } from '@gitbook/api';
import fetch from 'node-fetch';
const client = new GitBookAPI({
customFetch: fetch
});