Class WhatsAppChannelAdapter

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.

Hierarchy (view full)

Constructors

Methods

  • 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).

    Parameters

    • body: Record<string, unknown>

      Parsed JSON body of the webhook request.

    • Optional queryParams: Record<string, string>

      Query parameters (for Cloud API verification).

    Returns string | void

    Verification challenge string for GET requests, or void.

Properties

status: ChannelConnectionStatus = 'disconnected'
connectedSince: undefined | string
errorMessage: undefined | string
platformInfo: Record<string, unknown> = {}
auth: undefined | ChannelAuthConfig & {
    params?: WhatsAppAuthParams;
}

Stored auth config so reconnect() can re-use it.

retryConfig: RetryConfig
platform: ChannelPlatform = 'whatsapp'

Platform this adapter serves.

displayName: "WhatsApp" = 'WhatsApp'

Human-readable display name (e.g., "WhatsApp Business").

capabilities: readonly ChannelCapability[] = ...

Declared capabilities of this adapter.