Connect unlimited WhatsApp accounts, queue messages, schedule delivery, receive webhooks — all from a single Node.js server you control.
∞
Staff accounts
3
Message types
16+
REST endpoints
0
Monthly cost
A complete WhatsApp messaging infrastructure in one server.
Each staff member gets an isolated WhatsApp session identified by a free-form staff_id. No limit on number of accounts.
Insert messages into MySQL and deliver via cron trigger. Supports text, PDF, and media files. Auto-retry up to configurable max attempts.
Set scheduled_at on any queued message. The cron processor delivers only when the time arrives.
Set WEBHOOK_URL to receive incoming messages and delivery ACKs (sent / delivered / read) pushed to your system instantly.
Real-time ACK events update each message status in DB: sent → delivered → read. Queryable via API or visible in dashboard.
Socket.IO-powered unified dashboard: stats, live feed, send messages, manage queue, view incoming, edit templates — all in one page.
Optional API key protection on all /api/* endpoints via x-api-key header, Bearer token, or query param.
30 req/min limit on direct-send endpoints. Configurable random delay between queue messages to mimic human behavior and avoid WA bans.
Store reusable message templates in DB. Retrieve via API or select from the dashboard to fill forms instantly. Supports create, update, delete.
LocalAuth saves sessions to disk. On server restart, all staff sessions reconnect automatically — no re-scan QR needed.
Send one message to hundreds of numbers in a single API call. Automatic delay between sends, per-number success/fail result returned.
Public /api/health endpoint returns DB status, uptime, and active client count. Ready for uptime monitors and load balancers.
Two send modes — immediate or queued
POST to /api/send-text with staff_id + phone + message
Server validates number is registered on WhatsApp
Message sent instantly, DB updated, messageId returned
ACK events update status to delivered → read automatically
⚠ Requires WA client to be connected
POST to /api/queue-text (or queue-pdf / queue-media)
Row inserted to wa_outgoing with status=pending
Cron calls /api/run-cron?token=SECRET every N minutes
Processor sends pending messages, updates status, retries on failure
✓ Works even if client connects after queueing
Your App
REST / Cron
This Server
Express + Socket.IO
Sessions
whatsapp-web.js
Delivery
WhatsApp Web
Persistence
MySQL
Real-time
Socket.IO → Browser
Push
Webhook → Your URL
Running in 4 steps
git clone https://github.com/ahmadfauzirahman99/wa-multi-staff-gateway.git
cd wa-multi-staff-gateway
npm install
cp .env.example .env
# Edit .env — set DB credentials and CRON_TOKEN
mysql -u root -p -e "CREATE DATABASE simrs_wa CHARACTER SET utf8mb4"
mysql -u root -p simrs_wa < schema-update.sql
node server-new.js
# Open in browser:
# http://localhost:3030/main-dashboard.html — Dashboard
# http://localhost:3030/qr-scanner.html — Connect WhatsApp
Simple REST API. Full interactive docs at /api-docs.html
curl -X POST http://localhost:3030/api/queue-text \
-H "Content-Type: application/json" \
-H "x-api-key: your-api-key" \
-d '{
"staff_id": "staff1",
"wa_number": "628123456789",
"message": "Hello from WA Gateway!",
"scheduled_at": "2025-12-31 08:00:00"
}'
# Response:
# { "success": true, "id": 42 }
Self-hosted, open source, free forever. Your data stays on your server.