TypeScript SDK
The SDK is a small typed client. Every path, parameter and response takes its type from the same definitions that validate requests, so it always matches the API reference.
Install
Section titled “Install”npm install @limitry/sdkMake a call
Section titled “Make a call”import { createClient, unwrap } from "@limitry/sdk";
const api = createClient({ token: process.env.API_KEY! });
const endpoints = unwrap(await api.GET("/workspace/webhook-endpoints"));for (const endpoint of endpoints.items) console.log(endpoint.url);- With an API key, every call acts in the key’s workspace.
- With a personal access token, name the workspace:
createClient({ token, workspace: "acme" }). unwrapreturns the data, or throws anApiErrorwith the error envelope’scode,message,statusandrequestId.- Writes can send an idempotency key:
api.POST("/workspace/webhook-endpoints", { body, headers: { "idempotency-key": id } }).
Limits in one wrapper
Section titled “Limits in one wrapper”createLimits(client) gives you guard, which checks and then runs
the work, and hold, which reserves an estimate, runs the work and
commits what it actually used. See
Add Limitry with your agent for both, and
for how fail modes apply when Limitry can’t be reached.