Entity proxy
Pass an entity definition toclient.entity() — you get back a fully typed proxy with list, get, create, update, and delete methods:
List options
Thelist() method accepts filter, sort, pagination, and field selection options:
Service proxy
Pass a service definition toclient.service() — each action becomes a directly callable method:
body schema. Actions without a body schema accept an optional { headers } options object.
TestResponse
Every method returns aTestResponse<T> — a discriminated union on ok:
Custom headers
Per-request headers
Passheaders in the options for any method:
Default headers with withHeaders()
Create a new client with merged default headers. The original client is not modified:
Raw HTTP methods
For endpoints not covered by entity/service proxies, use the raw HTTP methods:get, post, put, patch, delete, head.
Auth-enabled servers
When your server is created withdb + auth (returning a ServerInstance), the test client automatically uses requestHandler — which routes /api/auth/* requests through the auth handler. No extra configuration needed.
Full example
Next steps
E2E Testing
Browser-based tests with Playwright and authenticated users.
Entities
Define entities with models, access rules, and hooks.
Services
Custom service actions with typed input/output.
Authentication
Session config, stores, and access control.