@zxcv.build/sdk
A typed client, generated from your project’s schema. Queries, auth, storage, and realtime share one isomorphic library that runs in the browser and on the edge.
Install
npm i @zxcv.build/sdkInitialize
import { createClient } from '@zxcv.build/sdk'
export const zxcv = createClient({
project: 'acme-store',
// The anon key is safe to ship — authorization is enforced server-side
// by your .policy rules, not by the client.
key: process.env.ZXCV_ANON_KEY!,
})Query
Every table is typed from your schema, so select autocompletes columns and
returns typed rows.
const { data, error } = await zxcv
.from('reviews')
.select('id, rating, body, author')
.eq('product', productId)
.order('created_at', { ascending: false })
.limit(20)Results are already filtered by authorization — the client only ever sees rows a policy granted.
Realtime
const channel = zxcv
.from('reviews')
.on('insert', (review) => addToUI(review))
.subscribe()The change feed honors the same policy predicate as select, so subscribers
never receive a row they couldn’t read.
For coding agents
Run zxcv mcp to expose full project context — schema, policies, and
deployments — to Claude Code, Codex, or any MCP-aware editor.