Configure a client
The SDK does not read environment variables itself. In these examples, your application passes the credential from
process.env.
OAuth access tokens
For an application acting on behalf of a user, supplyaccessToken instead of apiKey. A callback can retrieve the current token before a request:
Timeouts and cancellation
Client defaults apply to every operation. PasstimeoutMs, maxRetries or signal in the last argument, after the method’s inputs, to override one request. For generated client.api methods, this is the second argument; resource shortcuts can place it first, second or third. See Request option examples. The timeout covers the whole request, including token resolution, retries, retry delays and response reads. An AbortSignal lets your application cancel it earlier.
Retry behavior
Eligible GET and HEAD requests can be retried after a network failure or HTTP429, 502, 503 or 504. The SDK honors Retry-After when present and uses bounded backoff otherwise.
Write requests are never retried automatically, including after a rate limit. Raising maxRetries does not enable write retries. This protects actions such as placing calls, sending messages and purchasing resources from accidental duplication.
Handle errors
Do not log credentials or whole sensitive request bodies. A request ID, when available, helps support locate the failed request.
Troubleshooting
Check the same credential independently with the CLI: