whatsapp-api-client
v0.0.4-alpha
Published
Whatsapp Business API Official Client
Downloads
19
Maintainers
Readme
✨ Official Whatsapp Business API Client Package
Visit Official API Documentation. And Visit Platform WhatsApp Business for more information.
Installation
npm install @mimamch/whatsappUsage
Import package into your code
import whatsapp from "@mimamch/whatsapp";
// or for CommonJS
const whatsapp = require("@mimamch/whatsapp");Create instance
const client = whatsapp.createClient({
accessToken: "YOUR_ACCESS_TOKEN",
waBusinessAccountid: "YOUR_WA_BUSINESS_ACCOUNT_ID",
});🚀 Send your first OTP message
⚠️ Note: You need to create an auth OTP template with copy code action
await client.utils.sendOtpWithCopyCode({
phoneNumberId: "YOUR_PHONE_NUMBER_ID", // get this ID from https://developers.facebook.com
to: "YOUR_ACTIVE_PHONE_NUMBER", // including country code
templateName: "YOUR_OTP_TEMPLATE_ID",
templateLanguageCode: "en_US", // en_US | id | etc.
code: "123456", // Your OTP Code
});