@zapiu/client
v1.0.1
Published
The TypeScript client for the Zapiu page SDK API, version 1. Requires a runtime with `fetch` and `AbortController`.
Readme
@zapiu/client
The TypeScript client for the Zapiu page SDK API, version 1. Requires a runtime with fetch and AbortController.
npm install @zapiu/clientimport { createZapiuClient } from '@zapiu/client';
const client = createZapiuClient();
const user = await client.users.me();
const records = await client.records.list('customers', { limit: 10 });Create one client at application bootstrap. By default requests use the current origin and include session cookies. baseUrl selects a different trusted API origin; getAccessToken may supply a user access token. Never configure privileged backend credentials in browser code.
The supported routes are /api/v1/me, /api/v1/resources/:resource, and /api/v1/actions/:action/runs. These require a compatible Zapiu page API deployment. This package does not automatically make these routes available in a Code App runtime.
Requests support cancellation, bounded timeouts, and typed errors. Only GET requests retry transient HTTP errors; mutations are not automatically retried.
