chat-adapter-sendblue
Sendblue adapter for Chat SDK — send and receive iMessage and SMS from your bot.
Install
Quick start
The factory reads credentials from environment variables by default:
Or pass them explicitly:
Webhooks
Point your Sendblue webhook URLs to your server. The adapter handles three webhook types:
- Inbound messages — incoming iMessage/SMS routed to your bot
- Outbound status — delivery confirmations for messages you sent
- Typing indicators — when a contact starts typing
Webhook verification
If you configure a webhook secret in Sendblue, pass it as SENDBLUE_WEBHOOK_SECRET (or in the config). The adapter checks the x-webhook-secret header on every request. You can override the header name:
Features
Sending messages
The adapter sends outbound iMessages (with SMS fallback) through Chat SDK's standard postMessage interface. Markdown is automatically stripped to plain text since iMessage does not render it.
Attachments
Inbound media URLs from Sendblue are parsed into Chat SDK attachment objects with auto-detected MIME types. To send media, use Sendblue's media_url parameter through the SDK directly:
Reactions (tapbacks)
iMessage tapbacks are supported via addReaction. The adapter maps common emoji names to Sendblue's six tapback types:
Typing indicators
startTyping() sends the animated "..." bubble to the recipient. Only supported for 1:1 conversations (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 or SMS:
Read receipts
Send read receipts for a conversation (requires Sendblue account-level activation):
Direct SDK access
For anything not covered by the Chat SDK adapter interface, access the official Sendblue SDK directly:
Service filtering
By default, the adapter only processes inbound messages delivered via iMessage. To also accept SMS and RCS:
Thread ID format
Thread IDs encode the Sendblue line number and contact (or group) so that conversations are sticky to a specific phone line:
Use encodeThreadId / decodeThreadId to work with them programmatically.
Platform limitations
- No message editing — iMessage does not support editing sent messages via API.
editMessagethrows. - No unsend —
deleteMessageis a soft-delete in Sendblue's database only. - No reaction removal — tapbacks can be added but not removed via the API.
- Inbound media expiry — Sendblue inbound
media_urlvalues expire after 30 days. Persist them if needed. - Typing indicators — only work for 1:1 chats, not group conversations.
License
MIT