Skip to content
YasadDocs
Sign inGet started
Developer docs1 min read

TypeScript SDK

Install and use the server-side client.

A server-only client for Node 24 that wraps the HTTP API with your key's workspace and role.

Terminal
npm install @yasad/client
TypeScript
import { Yasad } from '@yasad/client';
const yasad = new Yasad(); // YASAD_API_URL and YASAD_API_KEY from the server environment
const requestId = crypto.randomUUID(); // keep it and reuse it if you retry this create
const customer = await yasad.customers.create({ requestId, name: 'Jane Smith', email: 'jane@example.com' });

new Yasad() reads YASAD_API_URL and YASAD_API_KEY from process.env; start plain Node with node --env-file=.env (frameworks load .env themselves). new Yasad({ envFile: '.env' }) reads both from that file only, and new Yasad({ apiKey, baseUrl }) uses exactly what you pass. A key is never paired with another setting's address, is sent only over HTTPS (plain HTTP only for local development addresses), and is never sent to a guessed default. Catch YasadError for the status, code, message and details.recovery. Env files with FRESH_API_URL/FRESH_API_KEY still work, and Fresh/FreshError remain as aliases. Offline? curl -fsS https://your-workspace-api/sdk/yasad-client.tgz -o yasad-client.tgz && npm install ./yasad-client.tgz installs the same package.

InterfaceOperations
yasad.capabilities(), yasad.export()Discover operations; export a snapshot
yasad.customers, yasad.resources, yasad.reservations, yasad.orders, yasad.paymentsNative records
yasad.collections, yasad.dataCollections and typed records
yasad.files, yasad.emails, yasad.events, yasad.webhooksServices
yasad.usage()Rolling 30-day activity and storage
Type to search