Repository navigation
Installation
- Frappe Framework v15+ / ERPNext v15+
- frappe_whatsapp app installed and configured
- Node.js 18+ and npm
- A server with SSH access (or local machine)
npm install -g @open-wa/wa-automate
openwa --port 2785cd ~
git clone https://github.com/rmyndharis/OpenWA.git OpenWA
cd OpenWA
npm install
npm run buildCreate or edit ~/OpenWA/.env:
AUTO_START_SESSIONS=true
PORT=2785
SSRF_ALLOWED_HOSTS=your-site-name,your-server-ip,localhost,127.0.0.1,minio
# your-site-name = your Frappe/ERPNext site name (e.g., my-site)
# your-server-ip = the IP used to connect from VM to host (e.g., 192.168.1.15)
# minio = MinIO service hostname (if used for file storage)
CORS_ORIGINS=http://192.168.1.15
CSP_UPGRADE_INSECURE_REQUESTS=falseImportant: If
~/OpenWA/data/.env.generatedexists, delete it — it overrides your.envsettings.
rm ~/OpenWA/data/.env.generatedsystemd keeps OpenWA running across server reboots and auto-restarts on crash:
sudo tee /etc/systemd/system/openwa.service << 'EOF'
[Unit]
Description=OpenWA WhatsApp API
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/home/Manaa-soft/OpenWA
ExecStart=/usr/bin/node dist/main
Restart=always
RestartSec=5
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable openwa
sudo systemctl restart openwa
sudo systemctl status openwaImportant: If Puppeteer can't find Chrome, change User=root to your username:
sudo sed -i 's/User=root/User=Manaa-soft/' /etc/systemd/system/openwa.service
sudo systemctl daemon-reload
sudo systemctl restart openwaBoot chain: [VM Boots] → [systemd launches OpenWA] → [sessions auto-start]
curl http://localhost:2785/api/sessionsYou should see a JSON response with an empty array or existing sessions.
- Open the OpenWA dashboard:
http://localhost:2886 - Scan the QR code with your phone
- Or start manually:
cd ~/OpenWA && npm run start
If you can't scan QR codes, use pairing code from the Frappe Desk (see Configuration).
# List sessions
curl http://localhost:2785/api/sessions
# Copy the sessionId (UUID) from the response
# Get the API key from the OpenWA dashboard (localhost:2886)cd ~/frappe-bench
bench get-app https://github.com/Manaa-Soft/openwa_bridge.git --branch developbench --site your-site.local install-app openwa_bridge
bench --site your-site.local migrate
bench restartbench pip install PyMuPDF # For dynamic image headersThe auto-reconnect feature requires the Frappe scheduler:
bench --site your-site.local scheduler enable
bench restart- Go to WhatsApp > WhatsApp Account in Frappe Desk
- Open your account (or create one)
- Check OpenWA Enabled
- Fill in:
-
OpenWA Base URL:
http://localhost:2785 -
OpenWA API Key:
<your-api-key>(from OpenWA dashboard) -
OpenWA Webhook Secret:
<your-shared-secret>
-
OpenWA Base URL:
- Click Setup OpenWA — this creates a session and displays a QR code
- Scan the QR code with your phone
See Configuration for detailed field descriptions.
The webhook auto-syncs when you save the WhatsApp Account. But you can also create it manually:
-
URL:
https://your-site.local/api/method/openwa_bridge.inbound.receive_openwa_message - Method: POST
-
Events:
message.received,message.sent,message.ack,message.failed,message.revoked,message.reaction,session.status,session.qr,session.authenticated,session.disconnected
# On server
cd ~/frappe-bench/apps/openwa_bridge
# Discard local changes
git checkout -- .
git clean -fd openwa_bridge/public/
# Pull latest
git pull --no-rebase origin develop
# Migrate + build + restart
bench migrate --site your-site.local
bench build --app openwa_bridge
bench restartAfter installation, verify each item:
- OpenWA is running:
curl http://localhost:2785/api/sessions - WhatsApp Account shows "Connected" in Frappe Desk
- Send a test text message from Desk → received on phone
- Send a test image from Desk → received on phone
- Send a message from phone → appears in Frappe as incoming
- Create a WhatsApp Template → check "Synced to OpenWA"
- Configure a notification → submit a doc → message sent
- Configuration — detailed account and webhook setup
- Architecture — understand the system design
- API Reference — all available endpoints