Client Configuration
Request Options
You can pass an optional configuration object to any API call to override default behaviors on a per-request basis.
Additional Headers & Query Parameters
Append custom headers or query parameters to specific requests:
Retries
The SDK is instrumented with automatic retries using exponential backoff. A request will be retried as long as it is deemed retryable (e.g., 408 Timeout, 429 Too Many Requests, or 5XX Server Errors) and the attempt count has not exceeded the limit (default: 2).
Timeouts
The SDK defaults to a 60-second timeout. Override this using the timeoutInSeconds option:
Aborting Requests
You can abort requests at any point by passing in an AbortSignal.
Accessing Raw Response Data
To access the raw response data (including headers), chain the .withRawResponse() method. This returns a promise that resolves to an object containing both the parsed data and the rawResponse.
Customizing the Fetch Client
If you are running in an unsupported environment or need to intercept network traffic, you can provide a custom fetch implementation when instantiating the client.
