Sendblue
iMessage, SMS, and RCS adapter for Chat SDK, built and maintained by Sendblue. Tapbacks, typing indicators, delivery status callbacks, and number lookup.
Create a new bot
Scaffold a Next.js bot with the Sendblue adapter using create-chat-sdk:
pnpm create chat-sdk@latest my-bot --adapter sendblue 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 chat-adapter-sendblue chat @chat-adapter/state-memoryThe adapter uses the official Sendblue TypeScript SDK. For production, use a persistent state adapter such as @chat-adapter/state-redis instead of in-memory state.
Quick start
Add a webhook route so Sendblue can deliver inbound messages.
Platform setup
Get your API credentials
Find your API credentials and assigned numbers in the Sendblue dashboard, or with the CLI:
Register the webhook URL
Point your Sendblue receive webhook at your webhook endpoint, for example:
Configuration
createSendblueAdapter() reads credentials from environment variables by default. You can also pass them explicitly:
Environment variables
| Variable | Required | Description |
|---|---|---|
SENDBLUE_API_KEY | Yes | Your Sendblue API key ID |
SENDBLUE_API_SECRET | Yes | Your Sendblue API secret key |
SENDBLUE_FROM_NUMBER | Yes | Your Sendblue number in E.164 format |
SENDBLUE_WEBHOOK_SECRET | No | Shared secret for webhook verification |
SENDBLUE_STATUS_CALLBACK_URL | No | Status callback URL for outbound message delivery events |
Webhooks
Create a webhook route and forward incoming Sendblue requests to Chat SDK:
Webhook verification
If you set SENDBLUE_WEBHOOK_SECRET, Sendblue should send the same secret with webhook requests. The adapter verifies the sb-signing-secret header by default. Override the header name if needed:
Service filtering
By default, the adapter processes only inbound iMessage traffic. To also accept SMS and RCS:
Sending messages
Use the standard Chat SDK thread methods. Outbound messages go through Sendblue with iMessage-first delivery and automatic SMS/RCS fallback where available. Markdown is stripped to plain text because iMessage does not render it.
Attachments
Inbound media URLs from Sendblue are parsed into Chat SDK attachment objects. To send media, use Sendblue's media_url parameter through the underlying SDK:
Reactions (tapbacks)
addReaction sends iMessage tapbacks. The adapter maps common emoji names to Sendblue's six tapback types:
| Tapback | Aliases |
|---|---|
love | heart |
like | thumbs_up, thumbsup, +1 |
dislike | thumbs_down, thumbsdown, -1 |
laugh | haha |
emphasize | exclamation, !! |
question | ? |
The Sendblue API can add tapbacks but not remove them.
Typing indicators
startTyping() sends the animated typing bubble to the recipient. It works in 1:1 conversations only, not group chats.
Message history
fetchMessages() retrieves conversation history from the Sendblue API with cursor-based pagination.
Number lookup
Check whether a phone number supports iMessage, SMS, or RCS:
Before high-volume sends, you can also use Sendblue's Lookup API to confirm iMessage support for a recipient.
Direct SDK access
For Sendblue APIs outside the standard Chat SDK adapter interface (media, contacts, webhooks, groups, and newer API features), use the underlying Sendblue SDK:
Thread IDs
Thread IDs encode the Sendblue line number and contact (or group) so conversations stay tied to a specific phone line:
Use encodeThreadId / decodeThreadId to work with them programmatically.
Production notes
- Use a persistent Chat SDK state adapter in production so subscribed threads and conversation state survive deploys.
- Store Sendblue API keys in environment variables or your host's secret manager.
- Sendblue media URLs can expire, so persist inbound media if you need long-term access.
- Keep your
from_numberstable per contact so end users always see the same Sendblue line.
Limitations
- iMessage does not support editing sent messages through the API, so
editMessagethrows. deleteMessagedoes not remove messages already delivered to recipients.- Tapbacks can be added but not removed through the API.
- Typing indicators work in 1:1 chats only, not group conversations.
Feature support
Messaging
| Feature | Supported |
|---|---|
| Post message | |
| Message replies | |
| Edit message | |
| Delete message | |
| File uploads | Inbound + via SDK |
| Streaming | |
| Scheduled messages |
Rich content
| Feature | Supported |
|---|---|
| Card format | |
| Buttons | |
| Link buttons | |
| Select menus | |
| Tables | |
| Charts | |
| Fields | |
| Images in cards | |
| Modals |
Conversations
| Feature | Supported |
|---|---|
| Slash commands | |
| Mentions | |
| Add reactions | Tapbacks |
| Remove reactions | |
| Typing indicator | 1:1 only |
| Mark as read | |
| Message edit events | |
| Message delete events | |
| DMs | |
| Ephemeral messages | |
| User lookup | evaluateService |
| Parent subject | |
| Native client | |
| Custom API endpoint |
Message history
| Feature | Supported |
|---|---|
| Fetch messages | |
| Fetch single message | |
| Fetch thread info | |
| Fetch channel messages | |
| List threads | |
| Fetch channel info | |
| Post channel message |
Resources
Sendblue maintains this adapter as Chat SDK and the Sendblue API evolve. For account, delivery, or credential help, contact Sendblue support.