TypeScript SDK
The Z3rno TypeScript SDK is a thin fetch-based client with Zod runtime validation on every response. Dual ESM + CJS build, nativefetch — no axios, no node-fetch, no undici.
Current version: @z3rno/sdk 0.7.0 on npm. Requires Node.js 18+ or any runtime with fetch (Deno, Bun, Cloudflare Workers).
Install
Client
| Option | Default | Notes |
|---|---|---|
baseUrl | required | z3rno-server URL. Local dev: http://localhost:8000. |
apiKey | required | API key. Default dev: z3rno_sk_test_localdev. |
timeoutMs | 30000 | Per-request timeout. |
maxRetries | 3 | Retries on transient failures. |
Method reference
The TS client mirrors the Python SDK’s surface. Method names are camelCase; the API contract is identical.Memory primitives
Conversation memory (Phase G slice 2)
Forge — ingest, distill, refine
Tenant self-management (v0.20.3)
Sessions
Framework integrations
Two adapters ship in@z3rno/sdk and lazy-load their host runtimes — no extra install needed for the SDK itself.
Vercel AI SDK
Mastra-JS
Models
Zod schemas + inferred TypeScript types are exported by name:Exceptions
All inherit fromZ3rnoError:
| Class | Maps to | Extra |
|---|---|---|
AuthenticationError | 401 | — |
ValidationError | 400 / 422 | — |
NotFoundError | 404 | — |
RateLimitError | 429 | retryAfter (seconds) parsed from header |
ServerError | 5xx | Surfaces the server error id for log correlation |
Z3rnoConnectionError | network | Underlying cause exposed |
Z3rnoTimeoutError | timeout | Per-request timeout exceeded |
Reference
- Package:
@z3rno/sdkon npm —0.7.0 - Source: github.com/the-ai-project-co/z3rno-sdk-typescript
- Server: Components → z3rno-server — the API the SDK calls
- Verbs: Concepts → The Z3rno Verbs — canonical seven-verb table
- MCP variant: Integrations → Anthropic MCP — same surface, exposed as MCP tools