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:
- Automating Snapshots
- Automating Deployments
- Pull Request Reviews
- Retrieving Metrics
- Single Page Tests
- Managing Sites
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 --saveyarn add calibreAuthentication#
Set the CALIBRE_API_TOKEN environment variable so the Node.js API can authorise requests automatically:
export CALIBRE_API_TOKEN=your-token-hereAlternatively, use the CLI to store your token:
calibre token setOnce 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()