Vercel Chat SDK adds WhatsApp adapter support
WhatsApp Now Available in Chat SDK
Vercel's Chat SDK has extended its multi-platform bot framework to include WhatsApp adapter support, enabling developers to build conversational bots that work seamlessly across six major platforms with a unified codebase.
Key Features
The WhatsApp adapter provides:
- Message support with reactions and read receipts
- Auto-chunking for long messages
- Multi-media downloads including images, voice messages, and stickers
- Location sharing with embedded Google Maps URLs
- Interactive replies with card-based UI elements (up to 3 options per card)
Implementation
Getting started requires minimal setup:
import { Chat } from "chat";
import { createWhatsAppAdapter } from "@chat-adapter/whatsapp";
const bot = new Chat({
userName: "mybot",
adapters: {
whatsapp: createWhatsAppAdapter(),
},
});
bot.onNewMention(async (thread, message) => {
await thread.post(`You said: ${message.text}`);
});
Important Limitations
Developers should be aware of WhatsApp-specific constraints:
- 24-hour messaging window: Bots can only respond to messages within 24 hours of receipt
- No message history or editing: Bots cannot retrieve past messages or modify sent ones
- Card limitations: Interactive cards render as reply buttons and fall back to formatted text
Next Steps
Complete documentation and an adapters directory are available at chat-sdk.dev. This addition, including a community contribution from @ghellach, brings the Chat SDK closer to true platform-agnostic bot development.