Skip to main content

Interface: ClientOptions

Defined in: packages/sdk/src/types.ts:24

Per-request lifecycle hooks for logging / telemetry.

Extends

Properties

PropertyTypeDescriptionInherited fromDefined in
apiKeystringSecret API key (pk_live_…). Server-to-server only — never ship to a browser.-packages/sdk/src/types.ts:26
baseUrlstringBase URL of the Mailroom deployment, e.g. https://mailroom.example.com-packages/sdk/src/types.ts:28
defaultBrand?stringBrand applied to send()/campaign() when the call omits one.-packages/sdk/src/types.ts:36
fetch?{ (input: URL | RequestInfo, init?: RequestInit): Promise<Response>; (input: string | URL | Request, init?: RequestInit): Promise<Response>; }Override fetch (tests / non-global-fetch runtimes).-packages/sdk/src/types.ts:30
headers?Record<string, string>Extra headers added to every request (e.g. tracing).-packages/sdk/src/types.ts:38
maxRetries?numberMax retries on 429/5xx/network errors. Default 2.-packages/sdk/src/types.ts:34
onRequest?(info: { attempt: number; method: string; url: string; }) => void-RequestHooks.onRequestpackages/sdk/src/types.ts:19
onResponse?(info: { attempt: number; method: string; status: number; url: string; }) => void-RequestHooks.onResponsepackages/sdk/src/types.ts:20
onRetry?(info: { attempt: number; delayMs: number; method: string; reason: string; url: string; }) => void-RequestHooks.onRetrypackages/sdk/src/types.ts:21
timeoutMs?numberPer-attempt timeout in ms. Default 30000.-packages/sdk/src/types.ts:32