@workbook-run/sdk
v1.0.9
Published
TypeScript client for workbook.run — workbooks, forks, SQL, and the control plane
Maintainers
Readme
@workbook-run/sdk
TypeScript client for workbook.run — create workbooks, run SQL, fork and propose changes, manage tokens.
Install
npm install @workbook-run/sdkUsage
import { AdminClient, WorkbookClient } from '@workbook-run/sdk';
const admin = new AdminClient({
baseUrl: 'https://api.workbook.run/v1',
token: process.env.WB_TOKEN,
});
const created = await admin.createWorkbook({ name: 'revenue' });
const label = created.workbook.id.toLowerCase().replaceAll('_', '-');
const wb = new WorkbookClient({
baseUrl: `https://${label}.vms.workbook.run`,
token: created.agentToken,
edgeUrl: 'https://api.workbook.run/v1',
workbookId: created.workbook.id,
});
const tables = await wb.listTables();Testkit
In-process mock APIs for tests. Requires optional peers hono and @hono/node-server:
npm install -D hono @hono/node-serverimport { createMockApi } from '@workbook-run/sdk/testkit';
const mock = await createMockApi();
const client = mock.workbookClient;Related
- CLI:
run-wb - Schemas:
@workbook-run/contracts
License
MIT
