惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hacker News: Ask HN
Hacker News: Ask HN
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog RSS Feed
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
量子位
博客园_首页
Vercel News
Vercel News
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Forbes - Security
Forbes - Security
IT之家
IT之家
N
News and Events Feed by Topic
S
Security Affairs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Webroot Blog
Webroot Blog
Recorded Future
Recorded Future
L
LangChain Blog
Y
Y Combinator Blog
AI
AI
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Know Your Adversary
Know Your Adversary
AWS News Blog
AWS News Blog
Help Net Security
Help Net Security
Cyberwarzone
Cyberwarzone
L
Lohrmann on Cybersecurity
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google Online Security Blog
Google Online Security Blog
V2EX - 技术
V2EX - 技术
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
PCI Perspectives
PCI Perspectives
I
Intezer
T
Tenable Blog
G
Google Developers Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Troy Hunt's Blog
L
LINUX DO - 最新话题
云风的 BLOG
云风的 BLOG
C
CXSECURITY Database RSS Feed - CXSecurity.com
有赞技术团队
有赞技术团队
O
OpenAI News
P
Proofpoint News Feed
TaoSecurity Blog
TaoSecurity Blog
C
Check Point Blog
Last Week in AI
Last Week in AI
S
Schneier on Security
Simon Willison's Weblog
Simon Willison's Weblog
Blog — PlanetScale
Blog — PlanetScale

Chat SDK Documentation

Approvals | Chat SDK Vercel Connect | Chat SDK Teams Low-Level APIs | Chat SDK CLI | Chat SDK Platform Adapters | Chat SDK State Adapters | Chat SDK Cards | Chat SDK Getting Started | Chat SDK Introduction | Chat SDK Modals | Chat SDK Slack Low-Level APIs | Chat SDK Streaming | Chat SDK Testing | Chat SDK Overview | Chat SDK toAiMessages | Chat SDK Cards | Chat SDK Overview | Chat SDK Markdown | Chat SDK Modals | Chat SDK AI SDK Tools | Chat SDK Types | Chat SDK Message Subject | Chat SDK Conversation History | Chat SDK Transcripts | Chat SDK Slack bot with Next.js and Redis Actions | Chat SDK Direct Messages | Chat SDK Emoji | Chat SDK Error Handling | Chat SDK File Uploads | Chat SDK Handling Events | Chat SDK Posting Messages | Chat SDK Slash Commands | Chat SDK State Adapters | Chat SDK Threads, Messages, and Channels | Chat SDK Creating a Chat Instance | Chat SDK Channel | Chat SDK Chat | Chat SDK Platform Adapters | Chat SDK Overlapping Messages | Chat SDK Ephemeral Messages | Chat SDK Message | Chat SDK Thread | Chat SDK Building a community adapter | Chat SDK Documenting your adapter | Chat SDK Publishing your adapter | Chat SDK Testing adapters | Chat SDK Code review GitHub bot with Hono and Redis Discord support bot with Nuxt and Redis Durable chat sessions with Next.js, Workflow, and Redis Schedule Slack posts with Next.js, Workflow, and Neon PostableMessage | Chat SDK
WhatsApp Business Cloud
Vercel · 2026-04-06 · via Chat SDK Documentation

@chat-adapter/whatsapp

WhatsApp Business Cloud adapter for Chat SDK, using the WhatsApp Business Cloud API.

Installation

Usage

When using createWhatsAppAdapter() without arguments, credentials are auto-detected from environment variables.

1. Create a Meta app

  1. Go to developers.facebook.com/apps
  2. Click Create App, select Business type
  3. Add the WhatsApp product to your app
  4. Go to WhatsApp > API Setup and note your Phone Number ID and Access Token

2. Configure webhooks

  1. Go to WhatsApp > Configuration in your Meta app
  2. Set Callback URL to https://your-domain.com/api/webhooks/whatsapp
  3. Set Verify Token to a secret string of your choice (this becomes WHATSAPP_VERIFY_TOKEN)
  4. Subscribe to the messages webhook field

3. Get credentials

From your Meta app dashboard, copy:

  • App Secret (under App Settings > Basic) as WHATSAPP_APP_SECRET
  • Access Token (under WhatsApp > API Setup) as WHATSAPP_ACCESS_TOKEN
  • Phone Number ID (under WhatsApp > API Setup) as WHATSAPP_PHONE_NUMBER_ID

For production, generate a permanent System User Token instead of the temporary access token.

Configuration

All options are auto-detected from environment variables when not provided. You can call createWhatsAppAdapter() with no arguments if the env vars are set.

*Required at runtime — either via config or environment variable.

Environment variables

Webhook setup

WhatsApp uses two webhook mechanisms:

  1. Verification handshake (GET) — Meta sends a hub.verify_token challenge that must match your WHATSAPP_VERIFY_TOKEN.
  2. Event delivery (POST) — incoming messages, reactions, and interactive responses, verified via X-Hub-Signature-256.

Features

Messaging

Rich content

Conversations

Incoming message types

Message history

Interactive messages

Card elements are automatically converted to WhatsApp interactive messages:

  • 3 or fewer buttons — rendered as WhatsApp reply buttons (max 20 chars per title)
  • More than 3 buttons — falls back to formatted text
  • Max body text — 1024 characters

Thread ID format

Example: whatsapp:1234567890:15551234567

Troubleshooting

Webhook verification failing

  • Confirm WHATSAPP_VERIFY_TOKEN matches the value you entered in the Meta dashboard
  • Ensure your endpoint returns the hub.challenge value for GET requests

Messages not arriving

  • Check that you subscribed to the messages webhook field in Meta app settings
  • Verify WHATSAPP_APP_SECRET is correct — signature verification silently rejects invalid payloads
  • Ensure your phone number is registered and verified in the WhatsApp Business dashboard

"Invalid signature" errors

  • Double-check WHATSAPP_APP_SECRET matches the value under App Settings > Basic
  • The adapter uses HMAC-SHA256 to verify the X-Hub-Signature-256 header

Token expired

  • Temporary tokens from the API Setup page expire after 24 hours
  • For production, create a System User in Meta Business Suite and generate a permanent token

License

MIT