Vercel
Chat SDK by Vercel is the open-source toolkit for building chat interfaces — it powers conversational UIs across Slack, Teams, Discord, WhatsApp, Telegram, and more. AgentPhone is an official vendor adapter, bringing SMS, MMS, iMessage, and voice to the Chat SDK ecosystem through one interface.
Four channels, one adapter
Inbound SMS, MMS, and iMessage arrive as standard Chat SDK message events. Voice calls land as messages containing the full transcript and summary when the call ends — your bot logic handles everything through the same handler pipeline.
Get started
Save the setup as lib/chat.ts. Set AGENTPHONE_API_KEY, AGENTPHONE_AGENT_ID, and AGENTPHONE_WEBHOOK_SECRET on the server. Signature verification only runs when a webhook secret is configured; fail deployment if any required variable is missing.
For a Next.js App Router endpoint, save this as app/api/webhook/route.ts:
Point your AgentPhone webhook at that route. Save the secret returned by registration. This example uses in-memory Chat SDK state for local development; use a supported durable state adapter for multi-instance or serverless deployments. Handle subscribed messages as well as new mentions:
iMessage reactions
The AgentPhone adapter supports iMessage tapbacks — send and receive love, like, dislike, laugh, emphasize, and question:
Inbound reactions fire the standard onReaction handler — no special handling required.
Voice call transcripts
When a call ends, the transcript arrives as a Chat SDK message with the full text, a summary, and call metadata:
This adapter processes completed-call notifications; it does not supply live voice turn responses. Use hosted voice or a voice webhook for the conversation itself. A follow-up SMS is a separate send and needs outbound SMS readiness.

