Sendblue Chat SDK Adapter: iMessage for Chat SDK Bots
Chat SDK gives developers one framework for building bots across messaging channels. The Sendblue adapter brings iMessage, SMS, and RCS into that same model, so teams can build one bot and reach customers in the Messages app they already use.
Today we are documenting support for the Sendblue Chat SDK adapter. It lets a Chat SDK bot receive inbound Sendblue webhooks, send outbound messages through Sendblue, and use iMessage-specific features such as typing indicators, tapback reactions, delivery callbacks, and message history.
Install the Adapter
Install Chat SDK and the Sendblue adapter package:
npm install chat chat-adapter-sendblue @chat-adapter/state-memory
@chat-adapter/state-memory is useful for local development and examples. In production, use persistent Chat SDK state such as Redis or Postgres so subscribed threads and conversation state survive deploys.
Add your Sendblue credentials to the environment:
SENDBLUE_API_KEY=your-api-key-id
SENDBLUE_API_SECRET=your-api-secret-key
SENDBLUE_FROM_NUMBER=+15551234567
SENDBLUE_WEBHOOK_SECRET=optional-shared-secret
Create a Chat SDK Bot
The adapter plugs into Chat SDK the same way as other channel adapters:
import { Chat } from "chat";
import { createSendblueAdapter } from "chat-adapter-sendblue";
import { createMemoryState } from "@chat-adapter/state-memory";
const chat = new Chat({
userName: "imessage-bot",
adapters: {
sendblue: createSendblueAdapter(),
},
state: createMemoryState(),
});
chat.onDirectMessage(async (thread, message) => {
await thread.post(`Got it: ${message.text}`);
});
Handle Sendblue Webhooks
Point your Sendblue receive webhook at a route in your app, then pass requests to Chat SDK:
// app/api/webhooks/sendblue/route.ts
import { chat } from "@/lib/chat";
export async function POST(request: Request) {
await chat.initialize();
return chat.webhooks.sendblue(request);
}
From there, inbound iMessages show up as Chat SDK messages and outbound replies are delivered through Sendblue. iPhone users get blue bubbles, while SMS and RCS can be accepted when you enable those services in the adapter config.
Why This Matters
AI agents are moving from demos to real customer workflows. Those workflows need channels where people actually respond. Sendblue gives Chat SDK bots a native messaging surface on iPhone, with automatic fallback for non-iMessage recipients and webhooks for replies and status updates.
For teams already using Chat SDK, this means you can keep your bot logic in one place while adding iMessage as a production channel. For Sendblue developers, it means faster access to the broader Chat SDK adapter ecosystem.
What Is Supported
- Inbound and outbound one-to-one messages
- iMessage-first delivery with SMS/RCS service filtering
- Delivery status callbacks
- Typing indicators for one-to-one conversations
- Tapback reactions through Sendblue reaction types
- Message history with cursor pagination
- Direct access to the official Sendblue TypeScript SDK for media, contacts, groups, and newer API features
Start Building
We are excited to make iMessage a first-class channel for Chat SDK builders. If you are building an agent that should talk to customers over text, this is the shortest path from bot logic to real blue-bubble conversations.