Skip to content

Confluence Client

@theholocron/confluence-client is a typed wrapper around the Confluence Cloud REST API for reading and updating pages.

Terminal window
pnpm add @theholocron/confluence-client
import { createConfluenceClient } from "@theholocron/confluence-client";
const token = Buffer.from(`${process.env.ATLASSIAN_EMAIL}:${process.env.ATLASSIAN_TOKEN}`).toString("base64");
const client = createConfluenceClient({
baseUrl: "https://myorg.atlassian.net/wiki/rest/api",
token,
});
const page = await client.page.get("123456789");
await client.page.update("123456789", {
title: "Updated title",
body: "<p>New content</p>",
});

Confluence uses HTTP Basic auth. The token must be a Base64-encoded email:apiToken string — not a raw API token:

const token = Buffer.from(`${email}:${apiToken}`).toString("base64");

Generate an API token at Atlassian account settings → Security → API tokens. The baseUrl must include the full REST API path, e.g. https://myorg.atlassian.net/wiki/rest/api.

Namespace Covers
page Reading and updating a page

The full API reference is generated from the package’s TSDoc comments.