Platform Adapters
Capability matrix, escape hatches, and overview of all platform adapters.
A platform adapter translates between ChatSDK's normalized API and a specific chat platform. Each adapter is a subclass of ChatSDK::Adapter::Base.
Capability Matrix
Not every platform supports every feature. Adapters declare their capabilities, and ChatSDK raises NotSupportedError if you call a method the adapter does not support.
| Feature | Slack | Teams | GChat | Mattermost | Discord | Telegram | Twilio | Messenger | X | Linear | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Post | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes |
| Edit | yes | yes | yes | yes | yes | yes | no | no | no | no | yes |
| Delete | yes | yes | yes | yes | yes | yes | yes | no | no | yes | yes |
| Ephemeral | yes | no | yes | yes | no | no | no | no | no | no | no |
| Reactions | yes | no | yes | yes | yes | yes | no | no | yes | yes | yes |
| Files | yes | yes | no | yes | yes | yes | no | yes | yes | yes | no |
| Modals | yes | no | no | no | no | no | no | no | no | no | no |
| Streaming | yes | yes | yes | yes | yes | yes | no | no | no | no | yes |
| DMs | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | no |
| History | yes | no | yes | yes | yes | no | yes | no | no | yes | yes |
| Typing | yes | yes | no | yes | yes | yes | no | yes | no | no | no |
Official Adapters
- Slack --
gem "chat_sdk-slack"-- Full-featured adapter using the Slack Web API and Block Kit. - Microsoft Teams --
gem "chat_sdk-teams"-- Bot Framework adapter with Adaptive Cards. - Google Chat --
gem "chat_sdk-gchat"-- Google Chat API adapter with Card v2. - Mattermost --
gem "chat_sdk-mattermost"-- Mattermost REST API adapter with message attachments. - Discord --
gem "chat_sdk-discord"-- Discord REST API v10 adapter with Ed25519 verification and embed rendering. - Telegram --
gem "chat_sdk-telegram"-- Telegram Bot API adapter with webhook secret token verification and inline keyboard rendering. - Twilio --
gem "chat_sdk-twilio"-- Twilio SMS/MMS adapter with HMAC-SHA1 signature verification. - Messenger --
gem "chat_sdk-messenger"-- Facebook Messenger adapter with HMAC-SHA256 verification and Generic/Button template rendering. - WhatsApp --
gem "chat_sdk-whatsapp"-- WhatsApp Business Cloud API adapter with HMAC-SHA256 verification and interactive message rendering. - X --
gem "chat_sdk-x"-- X API v2 adapter with HMAC-SHA256 webhook verification for tweets, DMs, and likes. - Linear --
gem "chat_sdk-linear"-- Linear GraphQL API adapter with HMAC-SHA256 webhook verification for issue comment threading.
Checking Capabilities at Runtime
slack = ChatSDK::Slack::Adapter.new
slack.supports?(:modals) # => true
slack.supports?(:edit_messages) # => true
teams = ChatSDK::Teams::Adapter.new(app_id: "...", app_password: "...")
teams.supports?(:modals) # => false
teams.supports?(:ephemeral_messages) # => falseAll Capabilities
The full list of capabilities that an adapter can declare:
| Capability | Method it gates |
|---|---|
:edit_messages | edit_message |
:delete_messages | delete_message |
:ephemeral_messages | post_ephemeral |
:file_uploads | upload_file |
:reactions | add_reaction, remove_reaction |
:modals | open_modal |
:typing_indicator | start_typing |
:streaming_edit | Used by the streaming system |
:threads | Thread support |
:direct_messages | open_dm |
:message_history | fetch_messages |
:scheduled_messages | schedule_message |
Escape Hatches
Sometimes you need platform-specific functionality that is not part of the normalized API. ChatSDK provides three tiers of escape hatches.
Tier 1: Raw Payload Access
Every Message and Event includes a raw attribute with the original platform payload:
bot.on_new_mention do |thread, message|
# Access the raw Slack event payload
slack_ts = message.raw["ts"]
slack_user = message.raw["user"]
endTier 2: Direct Client Access
Each adapter exposes its underlying API client via adapter.client:
slack_adapter = bot.adapter(:slack)
slack_client = slack_adapter.client # Slack::Web::Client
# Call any Slack API method directly
slack_client.users_info(user: "U12345")Tier 3: Conditional Logic by Platform
Use event.platform or adapter.name to branch:
bot.on_new_mention do |thread, message|
if message.platform == :slack
thread.react(message.id, "eyes")
end
thread.post("Acknowledged!")
endBuilding Custom Adapters
See Building Adapters for a guide on creating your own platform adapter.