Overview
Features
Typed API surface
TypeScript definitions for all request params and response fields, enabling strong typing and editor hover docs.
Robust error handling
Custom APIError subclasses mapped to HTTP status codes (BadRequestError, AuthenticationError, NotFoundError, etc.).
Automatic retries
Automatic retries for select errors (default 2) with exponential backoff; configurable maxRetries globally or per request.
Request timeouts
Default 1 minute timeout with configurable timeout option; On timeout, APIConnectionTimeoutError is thrown; timeouts are retried by default.
Auto-pagination
Paginated list endpoints; iterate with for await…of across pages; or fetch single pages; hasNextPage/getNextPage helpers.
Raw response access
Access raw Response data via asResponse() or withResponse(); separate raw data from parsed data.
Logging support
Configurable logLevel via environment variable or client option; supports custom logger; debug mode logs HTTP traffic with header redactions.
Custom fetch and proxies
Default fetch is global; you can provide your own fetch or fetchOptions to support proxies (Node with ProxyAgent, Bun, Deno); examples included.
Who Is This For?
- Developers:Build server-side applications that securely access Dodo Payments REST API using the provided TypeScript/JavaScript client.
- Backend teams:Leverage the TS/JS client to implement payment workflows, error handling, retries, and pagination against the Dodo Payments API.




