Dial
Give your Chat SDK bot a phone number. Send and receive SMS, MMS, and iMessage, and receive inbound voice-call transcripts, through HMAC-signed webhooks without channel-specific handlers.
Create a new bot
Scaffold a Next.js bot with the Dial adapter using create-chat-sdk:
pnpm create chat-sdk@latest my-bot --adapter dial memory -yThe generated app uses the Memory state adapter for local development. To add the adapter to an existing app, start at Install.
Install
pnpm add @getdial/chat-sdk-adapter chat @chat-adapter/state-memoryThe adapter is ESM-only, requires Node 18 or later, and has a peer dependency on chat ^4.20.0. For production, use a persistent state adapter such as @chat-adapter/state-redis instead of in-memory state.
Quick start
The same onNewMention handler that answers Slack, Teams, or Discord messages fires for phone traffic to your Dial number. thread.post sends replies back over the same channel.
Bind the webhook in whichever HTTP framework you use. The adapter works in any framework Chat SDK supports:
Configuration
| Prop | Type | Description |
|---|---|---|
apiKey? | string | Dial API key (`sk_live_…`). Mint from the Dial dashboard. Falls back to `DIAL_API_KEY`. |
fromNumberId? | string | Dial's ID of the phone number the bot sends from. Copy from the Phone Numbers page in the Dial dashboard, or `dial number list --json`. Falls back to `DIAL_FROM_NUMBER_ID`. |
webhookSecret? | string | HMAC-SHA256 signing secret Dial issued when you created the webhook subscription. When set, incoming requests are verified against `X-Dial-Signature` and rejected `401` on mismatch. Falls back to `DIAL_WEBHOOK_SECRET`. |
apiBaseUrl? | string | Override the Dial API host. Defaults to `https://api.getdial.ai`. Falls back to `DIAL_API_URL`. |
botName? | string | Display name Chat SDK uses for the bot. Defaults to `"bot"`. Falls back to `BOT_USERNAME`. |
logger? | Logger | Chat SDK `Logger` instance. Defaults to `ConsoleLogger("info").child("dial")`. |
Environment variables
| Variable | Required | Description |
|---|---|---|
DIAL_API_KEY | Yes | Dial API key (sk_live_…). Used when apiKey isn't set. |
DIAL_FROM_NUMBER_ID | Yes | Dial's ID of the phone number the bot sends from. Used when fromNumberId isn't set. |
DIAL_WEBHOOK_SECRET | No | Webhook signing secret (whsec_…). When set, the adapter verifies incoming requests. Used when webhookSecret isn't set. |
DIAL_API_URL | No | Dial API host. Defaults to https://api.getdial.ai. Used when apiBaseUrl isn't set. |
BOT_USERNAME | No | Bot display name. Defaults to "bot". Used when botName isn't set. |
Webhooks
Point a Dial webhook subscription at the endpoint you handed to bot.webhooks.dial. Create the subscription from the Dial dashboard's Webhooks page or over the API:
Set DIAL_WEBHOOK_SECRET to the whsec_… secret returned when you create the subscription. See the Dial Webhooks reference for the signature format, retries, and delivery semantics.
Signature verification
When webhookSecret is set, every request must carry:
The adapter recomputes the HMAC with Node's crypto.createHmac and compares it with timingSafeEqual, the same HMAC-SHA256 primitive Dial's server signs with. It rejects timestamps older than 5 minutes to prevent replayed requests, and answers 401 on any mismatch.
Channels
| Direction | Channel | Text | Media |
|---|---|---|---|
| Inbound | SMS | Yes | — |
| Inbound | MMS | Yes | Yes (image / video / audio / file) |
| Inbound | iMessage | Yes | Yes |
| Inbound | Voice call | Yes (as transcript) | — |
| Outbound | SMS / MMS / iMessage | Yes | Yes (via attachment URLs) |
Inbound SMS, MMS, and iMessage messages become Chat SDK messages, with any media as attachments. Outbound sends go through the official @getdial/sdk Node SDK.
A voice call surfaces through the call.transcribed event. The adapter fetches the transcript with @getdial/sdk.getCall() and forwards it as a message on the caller's thread.
Thread IDs
A Chat SDK thread 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 (subscriptions, locks, conversation memory) is scoped to the pair, so concurrent conversations don't leak into each other. Subscriptions, handlers, posts, and per-thread state work the same as with any other adapter.
Feature support
Messaging
| Feature | Supported |
|---|---|
| Post message | |
| Message replies | |
| Edit message | |
| Delete message | |
| File uploads | MMS & iMessage media |
| Streaming | |
| Scheduled messages |
Rich content
| Feature | Supported |
|---|---|
| Card format | |
| Buttons | |
| Link buttons | |
| Select menus | |
| Tables | Flattened to ASCII code blocks |
| Charts | |
| Fields | |
| Images in cards | |
| Modals |
Conversations
| Feature | Supported |
|---|---|
| Slash commands | |
| Mentions | DMs only; every phone pair is 1:1 |
| Add reactions | Native Tapbacks on iMessage, both directions; emoji delivered as text on SMS |
| Remove reactions | |
| Typing indicator | iMessage numbers only; silently ignored on SMS |
| Mark as read | |
| Message edit events | |
| Message delete events | |
| DMs | |
| Ephemeral messages | |
| User lookup | |
| Parent subject | |
| Native client | |
| Custom API endpoint | apiBaseUrl override |
Message history
| Feature | Supported |
|---|---|
| Fetch messages | Backfills from the account's 100 most recent messages; no pagination |
| Fetch single message | |
| Fetch thread info | |
| Fetch channel messages | |
| List threads | |
| Fetch channel info | |
| Post channel message |
Resources
- Adapter source and issues:
GetDial-AI/chat-sdk-adapter - Dial docs for this adapter: docs.getdial.ai/integrations/agent-clients/vercel-chat-sdk
- Dial platform docs: docs.getdial.ai
- Node SDK the adapter wraps:
@getdial/sdk