A lightweight Listener for Whatsapp
49
A lightweight, efficient WhatsApp listener built with Go and Whatsmeow. Designed for seamless integration with CRM systems, bots, and logging services via configurable webhooks.
The application is available as a Docker image on Docker Hub. You can run it using Docker or Docker Compose as follows:
docker pull optiwariindia/whatsmeow:1.0.0
docker run -d optiwariindia/whatsmeow:1.0.0 --volume $(pwd)/config.yml:/app/config.yml --volume $(pwd)/gateway.db:/app/gateway.db
version: '3.8'
services:
whatsapp-listener:
image: optiwariindia/whatsmeow:1.0.0
volumes:
- ./config.yml:/app/config.yml
- ./gateway.db:/app/gateway.db
The config.yml file allows you to specify webhook endpoints for message forwarding. You can define multiple webhooks using this file. An example configuration is shown below:
webhooks:
- url: "https://your-api.com/webhook"
name: "primary-receiver"
- url: "http://backup-service:9090/log"
name: "backup-logger"
The first time you run the application, it will generate a QR code in the logs. Scan this QR code with your WhatsApp mobile app to authenticate the session. Once authenticated, the session will be saved in gateway.db for future use. To view the QR code, check the container logs:
docker logs <container_id>
or
docker-compose logs whatsapp-listener
( from the directory where docker-compose.yml is located )
Incoming messages are POSTed as JSON with the following structure:
{
"sender": `$sender.phone}@s.whatsapp.net`, // whatsapp Number (without + with country code)
"sender_name": `${sender.whatsapp_name}`, // Name as saved by sender on whatsapp profile
"content": "Hello, this is a test message.", // Message text content
"timestamp": "2026-06-15T12:00:00Z", // Timestamp in ISO 8601 format GMT
"is_group": false, // true if the message is from a group chat false otherwise,
"message_id": "A5........7877CF2ECC3D1C" // Unique message ID from WhatsApp
}
MIT
Maintained by Om Prakash Tiwari
Content type
Image
Digest
sha256:d2634900e…
Size
13.6 MB
Last updated
4 months ago
docker pull optiwariindia/whatsmeow:1.0.0