The quickstart with Baileys®' WhatsApp Web API you've always wanted
docker compose up
Note: You'll need the latest LTS version of Node installed on your system.
- Clone the repository and cd into it:
git clone https://github.com/codespearhead/baileys-quickstart
cd baileys-quickstart
- Download the dependencies used in the minimal reproducible example
npm i
- Transpile the Server.ts:
npm run build
- Run the minimal working example:
npm start
Note that method readMessage from ServiceLayer.js will be called upon receiving a message. Implement function realBusinessLogic in that file to override the default replies, as shown in branch "whatsapp-click-to-chat".
After scanning the QRCode, send "ping" (without quotes) to the WhatsApp account logged into the program. It'll send "pong" back.
Warning: WhatsApp's averse to any type of automation that it considers to be "Harm[ful] to WhatsApp or [their] Users" on its platform, unless it's coming from an official WhatsApp Businesses API partner. So, it’s advisable to read WhatsApp's Terms of Service in order not to break them. Use this software at your own risk.
Note: This repository was built upon the currently official quickstart of Baileys®, which as of today doesn't qualify as a MRE.
Note: We are not affiliated, associated, authorized, endorsed by or in any way officially connected to WhatsApp, LLC. (www.whatsapp.com).
Note: We are not affiliated, associated, authorized, endorsed by or in any way officially connected to Baileys®. (https://github.com/WhiskeySockets/Baileys).
Note: Copyright Disclaimer under section 107 of the Copyright Act 1976, allowance is made for “fair use” for purposes such as criticism, comment, news reporting, teaching, scholarship, education and research. Fair use is a use permitted by copyright statute that might otherwise be infringing. Non-profit, educational or personal use tips the balance in favor of fair use.