0.0.4-alpha • Published 1 year ago

@mimamch/whatsapp v0.0.4-alpha

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

✨ Official Whatsapp Business API Client Package

Visit Official API Documentation. And Visit Platform WhatsApp Business for more information.

Installation

npm install @mimamch/whatsapp

Usage

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
});
0.0.4-alpha

1 year ago

0.0.3-alpha

1 year ago

0.0.2-alpha

1 year ago

0.0.1-alpha

1 year ago