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

ChannelSendReceiveMediaReactions
SMSYesYes
MMSYesYesYes
iMessageYesYesYesYes
VoiceTranscripts

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 in 30 seconds

$npm install @agentphone/chat-sdk-adapter chat
1import { Chat } from "chat";
2import { createMemoryState } from "@chat-adapter/state-memory";
3import { createAgentPhoneAdapter } from "@agentphone/chat-sdk-adapter";
4
5const agentphone = createAgentPhoneAdapter({
6 // apiKey: "...", // or set AGENTPHONE_API_KEY
7 // agentId: "agent_...", // or set AGENTPHONE_AGENT_ID
8 // webhookSecret: "whsec_...",
9});
10
11const chat = new Chat({
12 userName: "my-bot",
13 adapters: { agentphone },
14 state: createMemoryState(),
15});
16
17chat.onNewMention(async (thread, message) => {
18 await thread.subscribe();
19 await thread.post(`Got your message: ${message.text}`);
20});

Point your AgentPhone webhook at your server and you’re live. The adapter verifies HMAC-SHA256 signatures with replay protection out of the box.

iMessage reactions

AgentPhone is the only Chat SDK adapter with iMessage tapback support — send and receive love, like, dislike, laugh, emphasize, and question:

1await chat.adapters.agentphone.addReaction(threadId, messageId, "love");

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:

1chat.onNewMention(async (thread, message) => {
2 if (message.raw.callId) {
3 console.log("Summary:", message.raw.summary);
4 console.log("Transcript:", message.raw.transcript);
5 console.log("Duration:", message.raw.durationSeconds, "s");
6 }
7});

A customer calls in, the transcript arrives, and your bot follows up via SMS — all through one handler.