reinaldocoelho/Baileys-whatsapp-api ? reverse-engineered prompt
Reverse engineered prompt
Build me a lightweight WhatsApp Web API library in TypeScript that connects directly over WebSocket, so it does not need Selenium or a browser. It should work with both the multi device version and the older web version, let me log in with a QR code, send and receive messages, and expose connection updates and message events in a simple way.
I want it to be easy to use for building bots, with a clean example app that shows how to connect, listen for incoming messages, reply to them, and save login state so I do not have to scan the QR every time. Please include the basic auth persistence flow, a simple reconnect example, and a way to fetch or retry messages when needed. Keep it small, type safe, and practical, and if you need to check current docs or protocol details online, do that.