Skip to content

TypeScript SDK

The SDK is a small typed client: every path, parameter and response is typed from the same definitions that validate requests, so it matches the API reference exactly.

Terminal window
npm install @limitry/sdk
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" }).
  • unwrap returns the data or throws an ApiError carrying the error envelope’s code, message, status and requestId.
  • Writes may send an idempotency key: api.POST("/workspace/webhook-endpoints", { body, headers: { "idempotency-key": id } }).