Home / Docs

Documentation

How DiffMon works across monitoring, alerts, security, and API integration.

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

Shell
npm install @diffmon/sdk

Example usage

TypeScript
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.