@peekav3/client
v1.0.0
Published
Client SDK for Peeka's local Developer API — read and write pages, databases, and spaces from scripts and tools running on the same machine as the Peeka desktop app.
Maintainers
Readme
@peekav3/client
A tiny, dependency-free client SDK for Peeka's local Developer API — read and write pages, databases, and spaces from a Node script, CLI, or automation running on the same machine as the Peeka desktop app.
Enable the Developer API
The API is off by default. In Peeka: Settings > Sync & Security > Developer API,
turn it on. That generates a bearer token and shows the base URL (default
http://127.0.0.1:4271). The server only ever listens on 127.0.0.1, so it's
reachable only from the same machine, and every request must carry that token.
Install
npm install @peekav3/clientUsage
import { PeekaClient } from '@peekav3/client';
const peeka = new PeekaClient({
token: 'the-token-shown-in-settings',
// baseUrl: 'http://127.0.0.1:4271', // default, override if you changed the port
});
// Pages
const pages = await peeka.pages.list();
const page = await peeka.pages.create({ title: 'Meeting notes', type: 'page' });
await peeka.pages.update(page.id, { title: 'Meeting notes (final)' });
await peeka.pages.move(page.id, someOtherSpaceId);
await peeka.pages.delete(page.id);
// Database rows live under a database page via parentDatabaseId
const rows = await peeka.pages.list({ parentDatabaseId: databasePageId });
await peeka.pages.create({
parentDatabaseId: databasePageId,
title: 'New row',
properties: { Status: 'Todo' },
});
// Spaces
const spaces = await peeka.spaces.list();Every method rejects with a PeekaApiError (has a .status) on a non-2xx response,
and resolves with the parsed JSON body otherwise.
Requirements
- Node 18+ (for the built-in
fetch), or pass your own vianew PeekaClient({ fetch }). - The Peeka desktop app running locally with the Developer API enabled.
Full API reference
This package is a thin wrapper — every method maps 1:1 to an HTTP route. For the endpoint list,
request/response shapes, error format, and the server's security posture, see
docs/developer-api.md
in the main Peeka repo.
