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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WhatsAppClient(
config):WhatsAppClient
Defined in: src/index.ts:340
Parameters
Section titled “Parameters”config
Section titled “config”Returns
Section titled “Returns”WhatsAppClient
Accessors
Section titled “Accessors”blocks
Section titled “blocks”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”messages
Section titled “messages”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”phoneNumbers
Section titled “phoneNumbers”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”templates
Section titled “templates”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”Methods
Section titled “Methods”getApiVersion()
Section titled “getApiVersion()”getApiVersion():
string
Defined in: src/index.ts:491
Returns the Graph API version in use.
Returns
Section titled “Returns”string
getBaseUrl()
Section titled “getBaseUrl()”getBaseUrl():
string
Defined in: src/index.ts:496
Returns the resolved, versioned base URL, e.g. https://graph.facebook.com/v26.0.
Returns
Section titled “Returns”string
getBusinessAccountId()
Section titled “getBusinessAccountId()”getBusinessAccountId():
string|undefined
Defined in: src/index.ts:486
Returns the configured business account ID, if any.
Returns
Section titled “Returns”string | undefined
getPhoneNumberId()
Section titled “getPhoneNumberId()”getPhoneNumberId():
string|undefined
Defined in: src/index.ts:481
Returns the configured phone number ID, if any.
Returns
Section titled “Returns”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.