git clone https://github.com/danarn17/baileys-whatsapp-api danarn17
cd danarn17
npm install
npm start
Make a post to http://localhost:3000/new
with:
{
"webhook": "https://123412341234.ngrok.io/"
}
You can get a free subdomain to proxy the request to your localhost:
You don't need to respond to that request, copying the log from the ngrok dashboard is enough.
The QRcode will be sent to the webhook. You will need to transform it into an image. You can use:
The QRcode has a 20 seconds life.
You can read the QRCode from the terminal too.
GET {host}/
hello worldGET {host}/:number/up
start baileysGET {host}/:number/down
stop bailes