Skip to main content

Basic Usage

Install the package and start logging messages in minutes:

Type Safety

The SDK provides full TypeScript support with built-in types for all requests and responses:

Handling Errors Gracefully

The SDK throws specific error classes for different failure scenarios, making error handling straightforward:
Available Error Classes:
  • AuthenticationError - Invalid or missing API key
  • PermissionDeniedError - Insufficient permissions
  • NotFoundError - Resource not found
  • RateLimitError - Too many requests
  • ValidationError - Invalid request data

Configure Retry Behavior

Automatically retry failed requests with intelligent backoff:
Default Retry Strategy:
  • Retries on connection errors, 408, 409, 429, and 5xx responses
  • Maximum of 2 retries with exponential backoff
  • Configurable per client or per request

Set Request Timeouts

Control how long to wait for responses:
Timeout Behavior:
  • Default timeout: 60 seconds
  • Throws APIConnectionTimeoutError on timeout
  • Configurable globally or per request

Advanced Features

Access Raw HTTP Response

Get full control over the HTTP response for custom handling:

Configure Logging

Control SDK logging verbosity and use custom loggers:
Log Levels:
  • error - Only errors (default)
  • warn - Warnings and errors
  • info - General information
  • debug - Detailed debugging info