The `confluence-api` package provides a Node.js wrapper for interacting with Atlassian's Confluence REST API. It simplifies common operations such as content retrieval by ID or page title, creating and updating content, managing attachments, labels, and performing searches within Confluence. The current stable version is `1.4.0`. Releases tend to be feature-driven or for dependency maintenance, with no strict time-based cadence, but show active development. This library differentiates itself by offering a straightforward, callback-based interface for Confluence API access, supporting basic HTTP authentication, and including specific configuration options for compatibility with older Confluence instances, such as version 4, via a `version` parameter in its configuration object. It's suitable for backend Node.js applications needing to programmatically manage Confluence content.
npm install confluence-apiVerified import paths — ran on the pinned version, not inferred.
This quickstart initializes the Confluence API client and demonstrates fetching content by space key and page title. It uses environment variables for sensitive credentials.
Upgrade to `confluence-api@1.4.0` or later to ensure the patched `superagent` version is used. Run `npm install confluence-api@latest`.
If connecting to Confluence v4, ensure your configuration includes `version: 4`, e.g., `{ baseUrl: '...', username: '...', password: '...', version: 4 }`.Generate a Confluence REST API token from your Atlassian account settings and use it in place of your user password in the `password` field of the configuration object.
Verify that your `username`, `password` (or API token), and `baseUrl` in the configuration object are absolutely correct and that the user has the necessary permissions to access the Confluence instance.
Double-check the existence and exact spelling of `space`, `title`, `id`, or `attachmentId` parameters used in your API calls against your Confluence instance.