Integration Modes
Native Mode (Recommended)
- In-process integration using whatsmeow
- No separate bridge server needed
- QR code authentication on first run
- Session persistence across restarts
- Requires building with
-tags whatsapp_native
Bridge Mode
- Connect to external WebSocket bridge
- Useful if you already have a WhatsApp bridge running
- Requires separate bridge server setup
- More complex deployment
Native mode is optional to keep the default binary small. You need to build PicoClaw with WhatsApp support enabled, or use a pre-built binary with native support.
Prerequisites
- WhatsApp account on your phone
- PicoClaw installed with LLM provider configured
- For native mode: PicoClaw built with
-tags whatsapp_native
Native Mode Setup
Build with WhatsApp Support
Native WhatsApp support is optional. Build PicoClaw with the native tag:The binary will include native WhatsApp integration.
Configure Native Mode
Edit
~/.picoclaw/config.json:| Field | Value | Description |
|---|---|---|
enabled | true | Enable WhatsApp channel |
use_native | true | Use native whatsmeow integration |
session_store_path | "" | Leave empty to use <workspace>/whatsapp/ |
allow_from | [] | List of allowed phone numbers (empty = allow all) |
If
session_store_path is empty, sessions are stored in ~/.picoclaw/workspace/whatsapp/ by default.Start Gateway and Scan QR Code
Run the Gateway:On first run, a QR code will be printed in the terminal:
- Open WhatsApp on your phone
- Go to Settings → Linked Devices
- Tap Link a Device
- Scan the QR code from the terminal
- Wait for connection confirmation
Bridge Mode Setup
Set Up WhatsApp Bridge
Bridge mode requires a separate WebSocket bridge server. Popular options:
- whatsapp-web.js
- Baileys
- Custom bridge implementation
ws://localhost:3001).Configure Bridge Mode
Edit
~/.picoclaw/config.json:| Field | Value | Description |
|---|---|---|
enabled | true | Enable WhatsApp channel |
use_native | false | Use bridge mode |
bridge_url | WebSocket URL | Bridge server endpoint |
allow_from | Array of numbers | Allowed phone numbers (optional) |
Configuration Options
Native Mode Configuration
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | Yes | Enable WhatsApp channel |
use_native | boolean | Yes | Set to true for native mode |
session_store_path | string | No | Session storage path (default: <workspace>/whatsapp/) |
allow_from | array | No | Allowed phone numbers in international format |
Bridge Mode Configuration
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | Yes | Enable WhatsApp channel |
use_native | boolean | Yes | Set to false for bridge mode |
bridge_url | string | Yes | WebSocket URL of bridge server |
allow_from | array | No | Allowed phone numbers |
Access Control
Allow specific numbers:+[country code][number]
Allow everyone:
Features
Text Messages
Send and receive text messages with full conversation context.Group Chats
Bot can participate in WhatsApp groups (if invited and allowed byallow_from).
Media Support
Depending on your bridge/native implementation:- Image recognition (with vision-capable LLM)
- Document handling
- Voice message transcription (with Groq/Whisper)
Session Persistence
In native mode, the session is saved to disk. After the initial QR scan:- Subsequent restarts don’t require re-scanning
- Session remains valid unless you unlink the device
- Sessions are stored in
<workspace>/whatsapp/
Troubleshooting
”WhatsApp native support not enabled”
Cause: PicoClaw binary doesn’t include WhatsApp native support Solution: Rebuild with the native tag:QR Code Not Displaying
Possible causes:- Terminal doesn’t support QR code rendering
- Configuration has
use_native: false - Session already exists (check
<workspace>/whatsapp/)
- Verify
use_native: truein config - Delete existing session files to force re-authentication
- Use a different terminal emulator
”Connection Closed” or Disconnected
Possible causes:- WhatsApp unlinked the device
- Phone is offline
- Session expired
- Check WhatsApp → Settings → Linked Devices
- Ensure your phone has internet connection
- Delete session and re-scan QR code:
Bridge Mode Connection Failed
Check:- Bridge server is running
bridge_urlis correct- Network connectivity between PicoClaw and bridge
- Bridge logs for errors
Bot Doesn’t Respond
Possible causes:- Number not in
allow_fromlist - LLM provider issues
- Session disconnected
- Check
allow_fromconfiguration - Test LLM with
picoclaw agent -m "test" - Review Gateway logs for errors
Privacy & Security
Best Practices
- Session Storage: Keep
session_store_pathsecure with proper file permissions - Access Control: Always use
allow_fromfor personal bots - Regular Audits: Check linked devices periodically in WhatsApp
- Backup: Back up session files if you don’t want to re-scan QR codes
- Monitoring: Review Gateway logs for unexpected activity
Complete Example
Next Steps
Telegram Channel
Simpler setup for testing
Discord Channel
Team collaboration platform
QQ Channel
Popular in China
Configuration
Advanced configuration options