Skip to content

WhatsApp Integration

WhatsApp integration provides two-way messaging without cloud dependencies. Built on the Baileys library for local, direct WhatsApp Web connections.

  • Two-way messaging — Send and receive messages
  • Typing indicators — Shows the agent is “typing”
  • Read receipts — Messages are marked as read
  • Acknowledgment reactions — Quick feedback on received messages
  • QR code pairing — Scan from the web dashboard for remote setup
  • No cloud dependency — Direct local connection, no Meta Business API

The setup wizard offers WhatsApp as a messaging option:

Terminal window
npx instar
# Choose WhatsApp when prompted
# Scan the QR code with your phone

WhatsApp messages are routed to Claude Code sessions the same way Telegram messages are. The agent responds naturally, and replies appear in WhatsApp.

The key difference from Telegram: WhatsApp doesn’t have forum topics, so conversations are threaded per-contact internally rather than per-topic. Each authorized sender gets their own session with full conversation history. Group conversations get a separate session per group, configurable for the activation policy.

Two backends ship in the same adapter:

BackendCostConnectionBest for
baileys (default)FreeQR code, local WhatsApp Web bridgePersonal use, small numbers of senders, no Meta Business account
business-apiPaidWebhook with Meta-issued bot tokensProduction scale, team accounts, no QR-scan friction

Configure via the backend key in the WhatsApp adapter config. Baileys is the default because it works with zero account setup.

Authorized DMs respect a configurable trigger:

ModeBehavior
always (default)Every DM from an authorized sender arrives at the session
mentionOnly DMs that mention the bot arrive — useful when sharing DMs but only addressing the bot deliberately
offDMs are dropped

Set via directMessageTrigger in the WhatsApp adapter config.

WhatsAppGroupConfig lets you opt the agent into specific groups with per-group activation modes (always-listen, mention-only, command-only). Groups not listed are ignored. See the configuration reference for the schema.

WhatsApp uses Meta’s webhook contract for inbound events rather than a separate set of REST routes. Outbound sends happen through the adapter’s internal API — your agent doesn’t typically need to call these directly.