Vercel Chat SDK
Vercel Chat SDK is a TypeScript framework for building multi-channel bots: one bot handler responds to messages across Slack, Teams, Discord, and other channels through adapters. The @getdial/chat-sdk-adapter package plugs Dial into that adapter surface so the same bot handler also answers phone traffic — SMS, MMS, iMessage, and inbound voice-call transcripts — with replies sent back over the phone through Dial.
Written and maintained by Dial. Published on npm as @getdial/chat-sdk-adapter. Source at GetDial-AI/chat-sdk-adapter.
Install
chat is Vercel’s Chat SDK; both packages are required. Node 18+.
Usage
The bot.webhooks.dial(request) call routes the inbound HTTP request through the adapter’s signature verification, envelope parsing, and Chat SDK’s per-thread state — your handler runs identically to a Slack or Teams mention.
Configuration
createDialAdapter(config?) reads the environment when a field is omitted. Explicit config values win.
Webhook setup
Point a Dial webhook subscription at the endpoint you handed to bot.webhooks.dial. Create the subscription from the Webhooks page or over the API:
The whsec_… secret returned at creation goes in DIAL_WEBHOOK_SECRET. See the Webhooks reference for retries, signature format, and event types.
What the adapter carries
Voice calls surface to the bot as their transcript, delivered via the call.transcribed event. Very short calls that never generate a transcript don’t fire an onNewMention.
Threads
A Chat SDK thread here is a pair of phone numbers — your Dial-owned number and the peer’s — encoded as:
Every distinct pair is a distinct thread. Chat SDK’s per-thread state (conversation history, subscriptions, locks) is scoped per-pair, so multiple concurrent conversations don’t leak into each other.
Design notes
- Outbound sends and transcript fetches go through the official
@getdial/sdkNode SDK — no hand-rolled HTTP. - Signature verification uses Node’s built-in
crypto.createHmac+timingSafeEqual, matching the exact primitive Dial’s server signs with. - ESM-only, TypeScript-first. The adapter ships
dist/index.js+dist/index.d.ts— no source, no tests, nonode_modules. - Peer-depends on
chat ^4.20.0— installchatalongside this adapter.
Learn more
- Chat SDK docs: chat-sdk.dev
- Adapter source + issues:
GetDial-AI/chat-sdk-adapter - Node SDK the adapter wraps:
@getdial/sdk - Related Dial concepts: Webhooks, Events overview