A server-only client for Node 24 that wraps the HTTP API with your key's workspace and role.
Terminalnpm install @yasad/client
TypeScriptimport { Yasad } from '@yasad/client';const yasad = new Yasad(); // YASAD_API_URL and YASAD_API_KEY from the server environmentconst requestId = crypto.randomUUID(); // keep it and reuse it if you retry this createconst 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.
| Interface | Operations |
|---|---|
yasad.capabilities(), yasad.export() | Discover operations; export a snapshot |
yasad.customers, yasad.resources, yasad.reservations, yasad.orders, yasad.payments | Native records |
yasad.collections, yasad.data | Collections and typed records |
yasad.files, yasad.emails, yasad.events, yasad.webhooks | Services |
yasad.usage() | Rolling 30-day activity and storage |