wppmeta
v1.0.13
Published
Library of integration with whatsapp cloud api
Downloads
17
Maintainers
Readme
wppmeta
library not official javascript to WhatsApp Cloud API. Repository of wppmeta.
Features supported
- Sending messages
- Sending Media (images, audio, video and ducuments)
- Sending location
Future updates
- Sending messages for templates
- Sending messages for buttons
- Create templates of messages
- Update templates of messages
- Delete templates of messages
Installing from npm
$ npm install wppmeta
Setting up
Before getting started with the library, you need to go through the steps and gather some information to get the library working properly.
Follow the steps of Facebook Cloud Api for you to get started.
After the steps, collect your TOKEN and TEST WHATSAPP NUMBER
Lastly verify the number you will be using for testing on the To field
Once you're follow the above procedures, now you're ready to start hacking with the Wrapper.
Get Started library WppMeta
Here how you authenticate your application, you need to specofy two things the TOKEN
and phone_number_id
of your test number
import { WppMeta } from 'wppmeta'
const whatsaApp = WppMeta.config({
accountId: "YOUR_ACCOUNT_ID",
phoneId: "YOUR_PHONE_ID",
token: 'YOUR_TOKEN_AUTHORIZATION_BEARER',
});
Get List of Phones
const phones = await whatsaApp.getPhones()
Register Phone
const success = await whatsaApp.registerPhone({
phoneId: 'PHONE_ID',
pin: '6-digit'
})
Send Message type simple text
const response = await whatsaApp.sendText({
to: 'PHONE',
body: {
message: 'MESSAGE',
useUrl: false
}
})
Send Message type midia
const response = await whatsaApp.sendMidia({
to: 'PHONE',
mediaObjectId: 'MEDIA_ID'
})
Send Message type location
const response = await whatsaApp.sendLocation({
to: 'PHONE',
location: {
address: 'ADDRESS',
latitude: 'LATITUDE',
longitude: 'LONGITUDE',
name: 'NAME_LOCATION'
}
})
NOTE:
For more info check Notification Payload refernce and Notification Payload Examples
Issues
If you will face any issue with the usage of this package please raise one so as we can quickly fix it as soon as possible;
Contributing
This is an opensource project under MIT License
so any one is welcome to contribute from typo, to source code to documentation, JUST FORK IT
.