Node.js API


The Calibre Node.js API is an essential tool for building custom Calibre integrations. Use it to automate almost any account management or performance data-fetching task.

Here's a small sample of things it can do:

For a comprehensive guide to individual features of the Node.js API, browse the CLI and API pages found in the left-hand side navigation or read through the complete list of commands on GitHub.

Installation#

Install it to your project by running:

npm install calibre --save

Authentication#

Set the CALIBRE_API_TOKEN environment variable so the Node.js API can authorise requests automatically:

export CALIBRE_API_TOKEN=your-token-here

Alternatively, use the CLI to store your token:

calibre token set

Once the token is available in the environment, every API call picks it up without any extra configuration:

import { Site } from 'calibre'

const sites = await Site.list()

On this page