apiKey is required.
Options
Invalid options throw an
AuthenticaValidationError when the client is created.
The SDK does not retry requests and has no per-call cancellation. Use
timeout to bound how long a request can take.Client identification
By default, every request includes this header:- It contains only the SDK name and version.
- It contains no API key, account details or end-user data.
- It is not used for authentication. Your key is sent only in
X-Authorization.
Advanced options
Custom baseUrl
Custom baseUrl
baseUrl must use https. Plain http is allowed only for localhost, 127.0.0.1 and [::1]. It must not contain credentials, a query string or a fragment.The SDK sends your API key to whatever host you configure. Set baseUrl only from trusted server configuration, never from user input or tenant-editable settings.Custom fetch
Custom fetch
A custom
fetch receives every request, including your API key and request bodies. Use only implementations you control or fully trust.Your implementation must:- never log or store credentials or request bodies
- not retry requests internally, since a retried OTP send can deliver a second message and use extra credits
- honor
redirect: 'manual', so your API key is never forwarded to another host - return a response with
status,okandtext(); withoutheaders,retryAfterSecondsis never set