TypeScript SDK
Generated REST client (@zts/sdk) for integrations and workers.
@zts/sdk is a generated TypeScript client for the REST API at /api/rest. It does not speak MCP — agents use the MCP endpoint instead.
Use the SDK for integrations, background workers, and serverless functions. First-party web, mobile, and extension apps should use tRPC directly.
Install
Inside the monorepo:
In an external project:
Configure
Or from environment variables:
| Variable | Purpose |
|---|---|
ZTS_API_KEY | zts_… API key (required) |
ZTS_BASE_URL | Full REST prefix, e.g. https://demo.zerotoshipped.com/api/rest |
Defaults baseUrl to http://localhost:3000/api/rest when omitted.
Usage
The generated client exposes two API classes: Users and Images.
Available methods
Users
userGetCurrentUseruserGetUserForEditingProfileuserUpdateProfileuserGetPreferencesuserGetSinglePreferenceuserUpdatePreferenceuserMarkUserAsOnboardeduserResetUserOnboarding
Images
utImageDelete
All POST-style methods expect a body object (use {} when the procedure has no input).
Regenerate after API changes
When you add or change procedures with apiExposure():
This runs:
@zts/trpc generate:openapi→packages/sdk/openapi.json@hey-api/openapi-tscodegen →packages/sdk/src/client/tsccompile
The committed openapi.json should stay in sync with what /api/openapi.json serves in production.