NodeJs WhatsApp Library#
Javascript library for integration with WhatsAPP messenger via API of green-api.com service. To use the library you have to get a registration token and an account id in the personal area. There is a free developer account tariff plan.
API#
You can find REST API documentation by url. The library is a wrapper for REST API, so the documentation at the above url applies to the library as well.
Authorization#
To send a message or to execute some other Green-API method, you have to have the WhatsApp account in the phone application to be authorized. To authorize your account please go to the personal area and scan a QR-code using the WhatsApp application.
How to send a text message#
How to send a file by url#
How to send a file by uploading from the disk#
How to receive and process a notification#
How to receive and process notifications using a server#
How to get a QR code#
Development environment unrolling#
- Clone the repository via
git clone
- Install dependencies via
npm install
- Globally install the
rollup
library for building. - For webhooks add
express
as a new dependency via npm - Create a
.env
file in the root directory and set the environment variables. The example of variables are in the env.example file
Building#
You can compile both browser and node/webpack versions of the library with one command
npm run build
Service methods documentation#
External products#
License#
Licensed under MIT terms. Please see file LICENSE