Node.js
GitBook's official Node.js client library.
GitBook provides an official Typescript/Javascript client for the HTTP API. This client can be used in a browser or Node.js environment.
npm install @gitbook/api
import { GitBookAPI } from '@gitbook/api';
const client = new GitBookAPI({
authToken: <your_access_token>
});
When using the
@gitbook/api
module with Node.js < v18, you should pass a custom fetch
function.import { GitBookAPI } from '@gitbook/api';
import fetch from 'node-fetch';
const client = new GitBookAPI({
customFetch: fetch
});
Last modified 2d ago