Optional retryConfig: Partial<RetryConfig>Initialize the adapter with auth credentials. If already connected this will shut down the existing connection first (idempotent).
Get the current connection status and metadata.
Send a message to a conversation on the external platform.
Platform-native conversation/chat ID.
Message content to send.
The platform-assigned message ID.
Register an event handler. Returns an unsubscribe function.
Optional eventTypes: ChannelEventType[]Protected emitEmit an event to all matching subscribers. Subclasses call this when the platform SDK receives an inbound event.
Protected emitConvenience helper: emit a connection_change event with the current
status. Called automatically by setStatus.
Protected hasCheck whether this adapter declares a specific capability.
Protected setTransition to a new connection status and emit an event.
Optional error: stringProtected doEstablish the platform connection using the supplied credentials.
Called by initialize after state has been set to connecting.
Must throw on failure — the base class handles retry and state changes.
Protected doDeliver a message to the external platform.
Called by sendMessage only when the adapter is connected.
Protected doRelease platform resources (close WebSocket, stop polling, etc.).
Called by shutdown before the state transitions to disconnected.
Handle an incoming webhook request from WhatsApp (Twilio or Cloud API).
The host application should forward the raw request body to this method.
For Cloud API, this also handles webhook verification (GET requests
with hub.mode=subscribe).
Parsed JSON body of the webhook request.
Optional queryParams: Record<string, string>Query parameters (for Cloud API verification).
Verification challenge string for GET requests, or void.
Protected statusProtected connectedProtected errorProtected platformProtected authStored auth config so reconnect() can re-use it.
Protected Readonly retryReadonly platformPlatform this adapter serves.
Readonly displayHuman-readable display name (e.g., "WhatsApp Business").
Readonly capabilitiesDeclared capabilities of this adapter.
Channel adapter for WhatsApp supporting both Twilio and Meta Cloud API.
This adapter does NOT start its own HTTP server. Instead, the host application must configure a webhook route and call handleIncomingWebhook with the raw request body.
Capabilities: text, images, video, audio, voice_notes, documents, reactions, buttons, group_chat.