SDK (TypeScript)
Use the TypeScript SDK to call DiffMon APIs with typed responses and retries.
SDK (TypeScript)
The SDK wraps the public API with typed methods, sensible defaults, and retry helpers.
Installing
npm install @diffmon/sdkExample usage
import { DiffMonClient } from '@diffmon/sdk';
const client = new DiffMonClient({ token: process.env.DIFFMON_TOKEN! });
const monitors = await client.monitors.list({ limit: 10 });
console.log(monitors.items.map((m) => m.name));Error handling
- All methods return typed errors with status codes and request IDs.
- Retries are baked in for 429/5xx responses with jitter.
Compatibility
- Targets modern runtimes; works in Node and server-side frameworks.
- Uses the same OpenAPI schema as the dashboard to stay in sync.