Phone numbers and WABA
Manage the business account and its phone numbers directly from the client.
client.phoneNumbers methods default to the configured phoneNumberId, and
client.waba methods default to the configured businessAccountId; both accept
an optional trailing id to override the default per call. When neither is set,
the call throws WhatsAppValidationError.
// List the phone numbers owned by the business account.const { data } = await client.waba.listPhoneNumbers();console.log(data.map((n) => n.display_phone_number));
// Read the WhatsApp Business Profile for the configured phone number.const profile = await client.phoneNumbers.getBusinessProfile();console.log(profile?.about);
// Register a phone number for the Cloud API with its six-digit two-step PIN.await client.phoneNumbers.register({ pin: '123456' });The verification flow (requestVerificationCode/verifyCode), two-step PIN
management (setTwoStepPin — there is no API to disable it), profile updates
(updateBusinessProfile), and app webhook subscriptions
(client.waba.subscribeApp/unsubscribeApp/listSubscribedApps) are all
available. Phone-number deletion is intentionally out of scope.
Independent open-source project. Not affiliated with, endorsed by or sponsored by Meta or WhatsApp. Released under the MIT licence. Source on GitHub.