@hellopivot/sdk
v0.0.6
Published
Official Pivot SDK for JavaScript and TypeScript
Maintainers
Readme
@hellopivot/sdk
The official Pivot SDK for JavaScript and TypeScript.
- Type-safe — All API types are generated from the Pivot OpenAPI specification
- Retries — Automatic retries with exponential backoff and jitter
- Pagination — Helpers for both offset-based and cursor-based pagination
- ESM-only — Modern ES module package for Node.js 18+
- Zero dependencies — Uses only the built-in Fetch API
Installation
npm install @hellopivot/sdkQuick Start
import Pivot from '@hellopivot/sdk';
const pivot = new Pivot({ apiKey: 'your-api-key' });
// List spaces
const { spaces } = await pivot.spaces.getSpacesByOrganizationId(orgId, 0);
// Get a block
const { block } = await pivot.blocks.getBlockById(blockId);
// Create a webhook
const { webhook, secret } = await pivot.webhooks.createWebhook(orgId, {
name: 'My Webhook',
endpointUrl: 'https://example.com/webhook',
subscriptions: [{ eventType: 'message.created', scope: 'organization' }],
});Documentation
Full documentation is available at pivot.app/docs/developers/sdks/javascript-typescript.
License
MIT
