-
Notifications
You must be signed in to change notification settings - Fork 91
Description
Problem
The Chat SDK supports 7 platforms (Slack, Teams, Google Chat, Discord, Telegram, GitHub, Linear) but WhatsApp is missing despite clear demand—a WhatsApp adapter PR was previously rejected, and WhatsApp is now a critical business messaging platform.
More fundamentally, there's no clear architectural pattern for adding new adapters. Issue #178 identifies this as a gap: the Gateway/Transport Listener Adapter Interface needs definition before scaling to more platforms.
Why this matters
-
Business case: WhatsApp has 500M+ active business accounts and is the primary messaging platform in many regions. Users building bots for these markets need WhatsApp support.
-
Architecture clarity: Each new adapter follows ad-hoc patterns. Without a formal interface, maintainers must review each adapter's design individually. This slows contribution velocity and creates inconsistent behavior across platforms.
-
Test coverage gap: The test matrix in the README shows feature parity by platform, but there's no validation that new adapters actually implement the promised interface. A WhatsApp adapter currently has no specification to conform to.
What good looks like
Part 1: Define the Adapter Interface
Create docs/ADAPTER_INTERFACE.md that specifies:
- Required event handlers:
onNewMention(),onSubscribedMessage(),onReaction(), etc. with TypeScript signatures - Platform capability flags: Each adapter declares what it supports (e.g.,
supportsModals: falsefor WhatsApp) - Message formatting rules: How JSX cards map to platform-specific formats (Block Kit vs Adaptive Cards vs WhatsApp templates)
- State management contract: How adapters interact with
stateparameter fromChatconstructor - Error handling expectations: Required vs optional error types
Part 2: WhatsApp Adapter Implementation
With the interface defined, implement @chat-adapter/whatsapp that:
- Uses the official WhatsApp Business API (Cloud API)
- Implements core handlers: mentions, messages, reactions, media uploads
- Explicitly marks unsupported features in docs (no modals, no native emoji reactions)
- Includes adapter tests validating conformance to
ADAPTER_INTERFACE.md - Updates the platform matrix in README with accurate feature support
Acceptance criteria
-
ADAPTER_INTERFACE.mdexists with formal TypeScript interface definitions - Existing adapters (Slack, Teams, Discord) are audited against the interface and any gaps documented
-
@chat-adapter/whatsappimplements the interface with passing tests - README platform matrix updated with WhatsApp feature support
- New adapters can follow the documented pattern without design review overhead
Reference
Related: #178 (architecture), #147 (messenger adapter pattern)
Contributed by Klement Gunndu