Skip to content

mimamch/whatsapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✨ Official Whatsapp Business API Client Package

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

Installation

npm install whatsapp-api-client

Usage

Import package into your code

import whatsapp from "whatsapp-api-client";
// or for CommonJS
const whatsapp = require("whatsapp-api-client");

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

About

Official Whatsapp Business API Client Package Library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published