The official JavaScript / TypeScript client for the WorkoutX API. Access 1,400+ exercises with GIF animations, the AI Workout Generator, supplements, and the Body Scan API — from a single, fully-typed client that runs in Node.js and the browser. Zero runtime dependencies.
📦 Publishing to npm shortly — not yet installable. Get your key now and you'll be ready the moment it lands.
One client covers both products — the Exercise API (API-key auth) and the Body Scan API (user JWT). The SDK attaches the right credential automatically.
TypeScript types for every endpoint and response. Autocomplete in your editor means no more guessing field names or URLs.
Automatic retries with backoff on rate limits (429) and 5xx, honoring Retry-After. Structured WorkoutXError with status, code and tips.
Exercises, GIFs, workouts, supplements and Body Scan — all under wx.*. Auth handled transparently per product.
Exercise IDs are not sequential, so passing a human name to get() returns a 404. The find() helper tries an ID first, then falls back to a name search — so you never hit that mistake.
Run npm install @workoutx/sdk (or pnpm/yarn). It works in Node.js 18+ and modern browsers and ships with TypeScript types.
Yes. The SDK uses the native fetch API, so it runs in Node.js 18+, Deno, Bun, edge runtimes, and browsers without polyfills.
Create a free account in the Developer Portal and copy your wx_... key. Pass it as apiKey when constructing the client.
Body Scan uses a logged-in user's JWT. Pass scan: { token }, or scan: { email, password } to let the SDK log in automatically and cache the token.
In public frontend code, anyone can read your API key. For browser apps, proxy requests through your own backend instead of shipping the key to the client.
gifUrl() puts the key in the query string so <img> can load it. Since URLs can leak via logs and referrers, use a separate, restricted key for GIFs where possible.
The Body Scan email/password auto-login should only run server-side. In clients, pass a short-lived scan.token obtained from your backend instead.
Free tier included. 1,400+ exercises, GIFs, workouts, and Body Scan in one SDK.
Get your free API key