Client Configuration
Last updated 2026-02-13
const client = new RooaakClient({
apiKey: process.env.ROOAAK_API_KEY!,
baseUrl: "https://www.rooaak.com", // default
timeout: 30_000, // default
retry: {
maxRetries: 3,
baseDelayMs: 500,
maxDelayMs: 5000,
retryableStatuses: [429, 500, 502, 503, 504],
},
});Recommended production settings
For first runs (cold start) and webhook-heavy workloads, increase timeout:
const client = new RooaakClient({
apiKey: process.env.ROOAAK_API_KEY!,
timeout: 180_000,
});Retries and write safety
The SDK retries:
- safe methods (
GET,HEAD, etc) - write calls only when an explicit idempotency key is provided (example:
messages.send(..., idempotencyKey))
This is intentional: retries without idempotency can create duplicates.