ookamiiixd / baileys-api

Simple WhatsApp REST API with multiple device support
MIT License
432 stars 328 forks source link

Notifying frontend client of new msg #111

Closed pablocruzpineda closed 1 year ago

pablocruzpineda commented 1 year ago

How to notify frontend client when new msg has been received? Do I need to implement something like socket.io? Or how can I manage this with Baileys directly from the client side? Thanks for your answer.

zulfio commented 1 year ago

Baileys is running on the server side, so you can't use baileys directly from the client side.

Yes, you need websocket/socket.io to implement that

ookamiiixd commented 1 year ago

Well that's depend, if you want to listen to realtime data, use Websocket or Server Sent Events. If you only need some callback, a webhook should be enough