REST API wrapper for whatsapp-web.js
10K+
REST API wrapper for the whatsapp-web.js library, providing an easy-to-use interface to interact with the WhatsApp Web platform. It is designed to be scalable, secure, and easy to integrate with other applications.
It came from my lack of knowlege with NodeJS and the need to create OTP authentication flow where I couldn't trust external services.
This project is far from perfect: star it, create issues, features or pull requests ❣️
NOTE: I can't guarantee you will not be blocked by using this method, although it has worked for me. WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered totally safe.
Handle multiple client sessions (session data saved locally), identified by phone number
All Endpoints are secured by a global API key saved in the .env file
On server start, all previous clients are restored
git clone https://github.com/chrishubert/whatsapp-web-api.git
cd whatsapp-web-api
docker-compose.yml with updated ENV variables:Prepare a valid callback URL (You can use https://webhook.site/ to create a free webhook URL for testing)
- BASE_WEBHOOK_URL=https://example.com/webhook # UPDATE & MANDATORY
docker-compose up -d
Request a QR code through API at http://localhost:3000/api/startSession/1
Use a QR generator service (https://www.nayuki.io/page/qr-code-generator-library) with the qr received from the Callback
Scan the QR with your phone (it may take time to setup the session)
Enjoy!
git clone https://github.com/chrishubert/whatsapp-web-api.git
cd whatsapp-web.js-rest-api
npm install
env.example file to .env and update the required environment variables:cp env.example .env
npm run start
http://localhost:3000Run the test suite with the following command:
npm test
API documentation can be found in the swagger.yml file. Import this file into Swagger Editor or any other OpenAPI-compatible tool to view and interact with the API documentation.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with WhatsApp or any of its subsidiaries or its affiliates. The official WhatsApp website can be found at https://whatsapp.com. "WhatsApp" as well as related names, marks, emblems and images are registered trademarks of their respective owners.
This project is licensed under the MIT License - see the LICENSE.md file for details.
Content type
Image
Digest
sha256:e929c16a9…
Size
313.4 MB
Last updated
almost 2 years ago
docker pull chrishubert/whatsapp-web-api