WhatsApp Chat Plugin
WhatsApp Web (Baileys) bridge for Fusion. It pairs with your phone (QR or pairing code), keeps a background connection alive, forwards inbound direct text messages to a Fusion AI session, and sends the assistant reply back to WhatsApp.
No Meta Cloud app, webhook URL, verify token, or Graph API credentials are required.
Setup
- Enable/install the plugin, then open Settings → Plugins → Fusion Plugins → WhatsApp Chat.
- Use the pairing panel at the top of the plugin settings. It shows live connection status and, in QR mode, a QR code to scan from WhatsApp Linked devices.
- Configure
allowedSenders(empty means nobody is allowed). - Choose
pairingMode:qr(default): scan the in-settings QR code in WhatsApp.code: setpairingPhoneNumber(E.164 digits without+) and use Request pairing code in the settings panel.
- Wait for the panel to report
connected. Use Logout / re-pair to start a fresh pairing session; if a QR is still pending, refresh or wait for a new one.
Settings
pairingMode:qrorcode.pairingPhoneNumber: E.164 digits without+(used forcodemode).allowedSenders: allowed WhatsApp JIDs or E.164 digits.agentSystemPrompt: system prompt for replies.historyTurnLimit: persisted turn window (default40).dedupeRetentionDays: replay-protection retention window for inbound message IDs (default7days). Rows older than this are pruned lazily whenever a new inbound message is processed.
Routes
GET /api/plugins/fusion-plugin-whatsapp-chat/statusGET /api/plugins/fusion-plugin-whatsapp-chat/qrPOST /api/plugins/fusion-plugin-whatsapp-chat/pair-codePOST /api/plugins/fusion-plugin-whatsapp-chat/logout
Storage and lifecycle
- Starts socket on
onLoad, stops ononUnload. - Persists transcript and dedupe state in:
whatsapp_chat_sessionswhatsapp_chat_dedupe
- Persists Baileys auth state in:
whatsapp_auth_credswhatsapp_auth_keys
- After restart, plugin reconnects automatically when auth is valid.
Troubleshooting
- Stuck
awaiting-qr: use Refresh status in the plugin settings panel and scan the newly displayed QR promptly. - Need to re-pair: use Logout / re-pair in plugin settings; it starts a fresh QR or code pairing session.
- Pair code not generated: ensure
pairingPhoneNumberis E.164 digits without+, then use Request pairing code in the settings panel. - No replies: check
allowedSenders; empty list blocks all inbound messages by design.
Compliance warning
Baileys is an unofficial WhatsApp Web protocol client. Use may violate WhatsApp Terms of Service. This plugin is intended for self-hosted, single-user use at your own risk.