Skip to content

WhatsAppClientConfig

Defined in: src/index.ts:280

Configuration accepted by WhatsAppClient.

accessToken: string

Defined in: src/index.ts:282

Permanent or temporary access token used to authenticate requests.


optional apiVersion?: string

Defined in: src/index.ts:288

Graph API version, e.g. v26.0. Defaults to DEFAULT_API_VERSION.


optional baseUrl?: string

Defined in: src/index.ts:290

Base URL for the Graph API. Defaults to DEFAULT_BASE_URL.


optional businessAccountId?: string

Defined in: src/index.ts:286

WhatsApp Business Account (WABA) ID.


optional maxRetries?: number

Defined in: src/index.ts:294

Maximum number of retries. Defaults to DEFAULT_MAX_RETRIES.


optional phoneNumberId?: string

Defined in: src/index.ts:284

Phone number ID used as the sender for messaging endpoints.


optional retryMessageSends?: boolean

Defined in: src/index.ts:306

Retry message sends on 5xx, network and timeout failures too. Defaults to false: a POST to {phoneNumberId}/messages (sends, sendRaw, mark-as-read and typing indicators) is retried on HTTP 429 only.

Meta documents no idempotency key for sends. A 5xx, timeout or dropped connection can happen after Meta accepted the message, so with this set to true a retry can deliver the same message twice. Enable it only if you de-duplicate on your side. Requests aborted through a signal and responses that cannot be parsed are never retried. Other requests keep the standard policy.


optional timeoutMs?: number

Defined in: src/index.ts:292

Per-attempt request timeout in ms. Defaults to DEFAULT_TIMEOUT_MS.

Independent open-source project. Not affiliated with, endorsed by or sponsored by Meta or WhatsApp. Released under the MIT licence. Source on GitHub.