Chat with Dexter through WhatsApp by linking your phone to the gateway. Messages you send to yourself (self-chat) are processed by Dexter and responses are sent back to the same chat.
- ✅ Prerequisites
- 🔗 How to Link WhatsApp
- 🚀 How to Run
- 💬 How to Chat
- ⚙️ Configuration
- 👥 Group Chat
- 🔄 How to Relink
- 🐛 Troubleshooting
- 🔧 Full Reset
- Dexter installed and working (see main README)
- WhatsApp installed on your phone
- Your phone connected to the internet
Link your WhatsApp account to Dexter by scanning a QR code:
bun run gateway:loginThis will:
- Display a QR code in your terminal
- Open WhatsApp on your phone
- Go to Settings > Linked Devices > Link a Device
- Scan the QR code
After linking, you'll be asked how you want to use Dexter:
Use your own WhatsApp to talk to Dexter by messaging yourself. The linked phone number is added to allowFrom and self-chat mode is activated automatically.
If Dexter has its own phone number (e.g. a separate SIM), choose this option and enter the phone number(s) allowed to message it. The gateway will be configured with dmPolicy: "allowlist" so other people can DM the bot.
Credentials are saved to .dexter/credentials/whatsapp/default/.
Start the gateway to begin receiving messages:
bun run gatewayYou should see:
[whatsapp] Connected
Dexter gateway running. Press Ctrl+C to stop.
The gateway will now listen for incoming WhatsApp messages and respond using Dexter.
Once the gateway is running:
- Open WhatsApp on your phone
- Go to your own chat (message yourself)
- Send a message like "What is Apple's revenue?"
- You'll see a typing indicator while Dexter processes
- Dexter's response will appear in the chat
Example conversation:
You: What was NVIDIA's revenue in 2024?
Dexter: NVIDIA's revenue for fiscal year 2024 was $60.9 billion...
The gateway configuration is stored at .dexter/gateway.json. It's auto-created when you run gateway:login.
Self-chat configuration (personal phone, message yourself):
{
"gateway": {
"accountId": "default",
"logLevel": "info"
},
"channels": {
"whatsapp": {
"enabled": true,
"allowFrom": ["+1234567890"]
}
},
"bindings": []
}Bot phone configuration (dedicated Dexter phone, others message it):
{
"gateway": {
"accountId": "default",
"logLevel": "info"
},
"channels": {
"whatsapp": {
"enabled": true,
"accounts": {
"default": {
"dmPolicy": "allowlist",
"allowFrom": ["+1555YOURNUM"],
"groupPolicy": "disabled",
"groupAllowFrom": []
}
},
"allowFrom": ["+1555YOURNUM"]
}
},
"bindings": []
}Key settings:
| Setting | Description |
|---|---|
channels.whatsapp.allowFrom |
Phone numbers allowed to message Dexter (E.164 format) |
channels.whatsapp.enabled |
Enable/disable the WhatsApp channel |
accounts.<id>.dmPolicy |
DM access policy: pairing (default), allowlist, open, or disabled |
accounts.<id>.allowFrom |
Per-account allowed senders (overrides top-level allowFrom) |
gateway.logLevel |
Log verbosity: silent, error, info, debug |
Dexter can participate in WhatsApp group chats, responding only when @-mentioned.
Add group policy to your account in .dexter/gateway.json:
| Setting | Description |
|---|---|
groupPolicy |
"open" (any group), "allowlist" (restricted), or "disabled" (default) |
groupAllowFrom |
Which groups Dexter can participate in (["*"] for any) |
You don't need to list individual group members — when groupPolicy is "open", Dexter will respond to @-mentions from anyone in any group it's added to.
- Add Dexter's WhatsApp number to a group
- Send messages normally — Dexter stays silent
- @-mention Dexter (tap
@and select from the picker) to get a response - Dexter sees recent group messages for context, so it can follow the conversation
Note: You must use WhatsApp's @-mention picker (tap @ then select the contact) — typing a phone number manually won't trigger a response.
If you need to relink your WhatsApp (e.g., after logging out or switching phones):
- Stop the gateway (Ctrl+C)
- Delete the credentials:
rm -rf .dexter/credentials/whatsapp/default
- Run login again:
bun run gateway:login
- Scan the new QR code
Gateway shows "Disconnected":
- Check your internet connection
- Try relinking (see above)
Messages not being received:
- Verify your phone number is in
allowFromin.dexter/gateway.json - Make sure you're messaging yourself (self-chat mode)
Debug logs:
- Check
.dexter/gateway-debug.logfor detailed logs
If you're experiencing persistent issues (connection problems, encryption errors, messages not sending), perform a full reset:
-
Stop the gateway (Ctrl+C if running)
-
Unlink from WhatsApp:
- Open WhatsApp on your phone
- Go to Settings > Linked Devices
- Tap on the Dexter device and select Log Out
-
Clear all local data:
rm -rf .dexter/credentials/whatsapp/default rm -rf .dexter/gateway.json rm -rf .dexter/gateway-debug.log
-
Relink and start fresh:
bun run gateway:login
-
Scan the QR code and start the gateway:
bun run gateway
This clears all cached credentials and encryption sessions, which resolves most connection issues.
{ "channels": { "whatsapp": { "enabled": true, "accounts": { "default": { "groupPolicy": "open", // "open", "allowlist", or "disabled" "groupAllowFrom": ["*"] // no need to list individual group members } }, "allowFrom": ["+1234567890"] // existing DM allowlist (unrelated to groups) } } }