Five steps, no CLI. You need Node 24 and a Yasad workspace you own (or its owner nearby).
#1. Create a key for your app
In Yasad, open Apps, choose your app (or add it), and under API keys press Create API key. Pick the narrowest permission that fits: a public website takes Customer website (storefront), a staff tool takes Staff tools (operator). Yasad shows the key once, as two lines:
ExampleYASAD_API_URL=https://api.staging.yasad.appYASAD_API_KEY=ysk_...
#2. Put them in your server's .env
Paste both lines into the .env file on your app's server (and add .env to .gitignore), or into your host's secret settings for deployments. Never use a NEXT_PUBLIC_ or VITE_ name: those are copied into the browser.
#3. Install the SDK
Terminalnpm install @yasad/client
#4. Check the connection
JavaScript// check.mjsimport { Yasad } from '@yasad/client';const yasad = new Yasad(); // reads YASAD_API_URL and YASAD_API_KEY from the environmentconst me = await yasad.capabilities();console.log(me.workspaceId, me.role, me.operations.length + ' operations');
Terminalnode --env-file=.env check.mjs
Plain Node doesn't read .env by itself: --env-file loads it. On Windows, save .env as UTF-8 (Windows PowerShell 5's > writes UTF-16, which --env-file misreads), and check it with npx @yasad/cli doctor --env .env. Next.js, Remix and most frameworks load .env for server code automatically. If a shell already exports YASAD_API_URL, it wins over the file; use new Yasad({ envFile: '.env' }) to read both values from the file only.
Your app's page in Yasad now shows Working.
#5. Make a change
Creating a customer needs a key with Staff tools (operator) or Customer website (storefront, through an order). A view-only key gets 403 FORBIDDEN.
JavaScriptimport { randomUUID } from 'node:crypto';import { Yasad, YasadError } from '@yasad/client';const yasad = new Yasad();// Keep the requestId with your intent. If the call times out, send the same requestId and input// again: Yasad returns the original customer instead of creating a second one.const requestId = randomUUID();try {const customer = await yasad.customers.create({ requestId, name: 'Avery Lee', email: 'avery@example.test' });console.log('Created', customer.id);} catch (err) {if (err instanceof YasadError) console.error(err.status, err.code, err.message, err.details?.recovery);throw err;}
See Safe retries for timeouts and conflicts.
#Next.js
TypeScript// lib/yasad.ts — server code onlyimport 'server-only';import { Yasad } from '@yasad/client';export const yasad = new Yasad(); // .env.local is loaded by Next.js
On Vercel or another host, add YASAD_API_URL and YASAD_API_KEY as server environment variables, with a separate key per environment.
#curl
Terminalset -a; . ./.env; set +a # export the two values into this shellcurl -fsS -H "Authorization: Bearer $YASAD_API_KEY" "$YASAD_API_URL/v1/capabilities"
#Keys for AI assistants
An AI assistant that works on your workspace (Claude Code, Codex, Cursor) connects separately, with its own key: see Connect an AI agent. An app your assistant builds still gets its own app key from step 1.