โ๏ธNodejs SDK
Installation
You can install the Waabot SDK using npm, yarn, or pnpm.
Using npm
npm install waabot-v2-sdkUsing yarn
yarn add waabot-v2-sdkUsing pnpm
pnpm add waabot-v2-sdkGetting Started
Initializing the SDK
First, instantiate the SDK with your apiKey and apiSecret.
require('dotenv').config();
const { Waabot } = require('waabot-v2-sdk');
const apiKey = process.env.apiKey;
const apiSecret = process.env.apiSecret;
const to = process.env.to;
const app = new Waabot({ apiKey, apiSecret });Listening to New Messages
You can listen to new messages with the following code:
The interface of the message is as follows:
Sending a Text Message
To send a text message, use the following code:
Sending Reply Buttons
To send a message with reply buttons, use the following code:
Creating a Template
To create a template, use the following code:
Sending a Template
To send a template message, use the following code:
These examples should help you get started with the Waabot SDK for Node.js. For more information, please refer to the official documentation at npmjs.com/package/waabot-v2-sdk.
Last updated