@qubitnotion/sdk
v0.1.0
Published
Typed TypeScript client for the Qubit Notion REST API v1 (private beta).
Readme
@qubitnotion/sdk
Typed client for the Qubit Notion REST API v1.
Published via GitHub Actions on tags sdk-ts/v* (see
.github/workflows/publish-sdk-ts.yml). The REST API v1 is in private beta;
request a workspace API key from your Qubit Notion admin.
npm install @qubitnotion/sdkUsage
import { QubitNotion } from '@qubitnotion/sdk';
const qn = new QubitNotion({ apiKey: process.env.QN_API_KEY! });
const plans = await qn.plans({ limit: 25, status: 'active' });
for await (const finding of qn.paginate('/api/v1/findings')) {
console.log(finding);
}
await qn.track([
{
pixel_code: 'px_...',
event_name: 'purchase',
event_id: 'ord_10482',
value: 249,
currency: 'AED',
consent: { analytics: true, marketing: true },
},
]);Behaviour
- Bearer auth with a workspace API key; scopes are enforced server-side.
- Errors throw
QubitNotionErrorcarrying the RFC 9457 problem document. - 429 and 5xx are retried twice, honouring
Retry-After. track()accepts 1 to 50 events and supportsIdempotency-Key.paginate()walks limit/offset pages of any list endpoint.
Covered endpoints
GET /me, /plans, /campaigns, /studies, /findings, /pixel-rollups,
and POST /events. That is the whole v1 surface today.
