Requirements
- Node.js β₯ 18 (the bridge is built and run from the CLI).
- A phone with WhatsApp to scan the QR code.
Configuration
Set under channels.whatsapp in ~/.flowly/config.json:
{
"channels": {
"whatsapp": {
"enabled": true,
"bridgeUrl": "ws://localhost:3001",
"allowFrom": []
}
}
}| Key | Type | Default | Description |
|---|---|---|---|
enabled | bool | false | Start the WhatsApp adapter at gateway boot. |
bridgeUrl | string | ws://localhost:3001 | WebSocket URL of the Node bridge. |
allowFrom | string[] | [] | Allowed phone numbers. Empty = allow all. |
Connect method
The adapter connects to the bridge at bridgeUrl and exchanges JSON frames: inbound message frames are turned into agent messages, and it also handles status, qr, and error frames. Outbound replies are sent as {"type":"send","to":<chat_id>,"text":<content>}. The adapter reconnects on drop with a 5-second backoff. Access is enforced via allowFrom; the WhatsApp adapter does not use the pairing store.
Bridge setup and login
The bridge is provisioned, built, and run by the CLI:
flowly channels login
flowly channels statusflowly channels login builds the bridge if needed (npm install && npm run build) and runs it, printing a QR code to scan with WhatsApp on your phone. The bridge lives at ~/.flowly/bridge.
flowly channels status shows WhatsApp's enabled state and bridge URL. channels status currently reports only WhatsApp.
Setup steps
- Ensure Node.js β₯ 18 is installed.
- Set
channels.whatsapp.enabledtotrue. - Run
flowly channels loginand scan the QR code with WhatsApp. - Optionally restrict access via
allowFrom. - Start the gateway:
flowly gateway(the bridge must be running for messages to flow).