Skip to content

WhatsAppClient

Defined in: src/index.ts:328

WhatsApp Cloud API client.

Normalizes configuration, resolves the versioned Graph API base URL, owns the HTTP core, and exposes resource APIs such as WhatsAppClient.messages.

new WhatsAppClient(config): WhatsAppClient

Defined in: src/index.ts:340

WhatsAppClientConfig

WhatsAppClient

get blocks(): BlocksResource

Defined in: src/index.ts:446

Typed Block API. Lazily instantiated on first access and reused thereafter, bound to the internal request path and the configured default phone number ID.

BlocksResource


get calls(): CallsResource

Defined in: src/index.ts:472

Typed WhatsApp Business Calling API. Lazily instantiated on first access and reused thereafter, bound to the internal request path and the configured default phone number ID.

CallsResource


get flows(): FlowsResource

Defined in: src/index.ts:459

Typed Flows management API. Lazily instantiated on first access and reused thereafter, bound to the internal request path and the configured default business account ID.

FlowsResource


get media(): MediaResource

Defined in: src/index.ts:394

Typed Media API. Lazily instantiated on first access and reused thereafter, bound to the internal request path and the configured default phone number ID.

MediaResource


get messages(): MessagesResource

Defined in: src/index.ts:381

Typed outbound Messages API. Lazily instantiated on first access and reused thereafter, bound to the internal request path and the configured default phone number ID.

MessagesResource


get phoneNumbers(): PhoneNumbersResource

Defined in: src/index.ts:407

Typed phone-number management API. Lazily instantiated on first access and reused thereafter, bound to the internal request path and the configured default phone number ID.

PhoneNumbersResource


get templates(): TemplatesResource

Defined in: src/index.ts:433

Typed message-template management API. Lazily instantiated on first access and reused thereafter, bound to the internal request path and the configured default business account ID.

TemplatesResource


get waba(): WabaResource

Defined in: src/index.ts:420

Typed WhatsApp Business Account (WABA) management API. Lazily instantiated on first access and reused thereafter, bound to the internal request path and the configured default business account ID.

WabaResource

getApiVersion(): string

Defined in: src/index.ts:491

Returns the Graph API version in use.

string


getBaseUrl(): string

Defined in: src/index.ts:496

Returns the resolved, versioned base URL, e.g. https://graph.facebook.com/v26.0.

string


getBusinessAccountId(): string | undefined

Defined in: src/index.ts:486

Returns the configured business account ID, if any.

string | undefined


getPhoneNumberId(): string | undefined

Defined in: src/index.ts:481

Returns the configured phone number ID, if any.

string | undefined

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