npm / @chat-adapter/whatsapp
@chat-adapter/whatsapp
What changed in @chat-adapter/whatsapp 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
5 breaking1 security9 new APIs and options5 behavior and defaults8 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@chat-adapter/whatsapp 428 changes
Breaking changes 5
The log entry for a failed WhatsApp subscription check no longer includes tokenMatch.
Webhook signatures must use the sha256= prefix followed by exactly 64 hexadecimal digits; other shapes are rejected before comparison.
Outbound calls throw a ValidationError before making a request if the thread ID does not decode or its phone number ID is not numeric.
Transport failures and unparseable response bodies now throw NetworkError instead of leaking raw fetch errors.
Updates the default API version to v25.0.
Security 1
WhatsApp attachment downloads use guarded downloading: private and internal addresses are refused, responses are capped at 25 MB, and downloads time out after 30 seconds. The access token is kept on Meta media hosts and the configured Graph origin.
New APIs and options 9
Adds a handlers option for platform-specific Markdown serialization.
Exported for non-2xx Graph API responses, with Meta error details, HTTP status, the raw envelope, and a code mapped to the shared AdapterError taxonomy.
Adds native message replies with WhatsApp contextual reply support.
Adds a shared thread API for marking messages as read across WhatsApp, Messenger, and XChat.
Supports typed Attachment payloads for outbound sends, including binary or HTTPS link passthrough, multi-file sequencing, MIME mapping, caption fallbacks, and card-plus-file sequencing.
Adds sending of pre-approved template messages, enabling business-initiated conversations outside the 24-hour customer service window.
Adds typing indicator support by sending Meta's read-plus-typing payload when a recent inbound message is available.
The config argument is now optional, and every WhatsAppAdapterConfig field is optional; the factory still falls back to WHATSAPP_* environment variables.
Adds a WhatsApp adapter using Meta's WhatsApp Business Cloud API.
Behavior and default changes 5
Inbound and outbound WhatsApp messages now support business-scoped user IDs.
A card with only one eligible LinkButton is now sent as a native cta_url interactive message instead of formatted text.
The context type now makes all fields optional and includes forwarded-message and product-inquiry variants, so consumers must guard optional fields such as
fromandid.Supports binary FileUpload uploads for outbound files and attachments.
The adapter now depends on chat as a full dependency rather than an optional dependency, so installing the adapter also installs chat.
Fixes and other changes 8
If computing the signature throws, WhatsApp logs a warning and responds with 401.
WhatsApp now checks converted platform text before parsing and falls back to plain text when parsing limits are exceeded, preserving message content while avoiding failures from pathological or deeply nested markdown.
Replies, reactions, read receipts, typing indicators, and media uploads are sent from the phone number encoded in the thread.
Literal tildes, asterisks, underscores, and backslashes are preserved unless escaping is needed to prevent WhatsApp formatting; formatting markers inside code remain unchanged, and hard breaks become plain newlines.
Empty
fromandwa_idvalues are treated as absent, allowing messages from username users who hide their phone number to reach handlers.Incoming WhatsApp messages preserve the first line of code blocks in message text and formatted content, and bold/strikethrough rewriting no longer corrupts fenced code.
Link button URLs are now included in interactive button message bodies and media captions, rather than being dropped.
Prevents card titles and body content from appearing twice when sending cards with files on WhatsApp, and avoids adding full card fallback text as an image caption when an interactive message follows.