💎 ChatSDK Ruby

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.

FeatureSlackTeamsGChatMattermostDiscordTelegramTwilioMessengerWhatsAppXLinear
Postyesyesyesyesyesyesyesyesyesyesyes
Edityesyesyesyesyesyesnonononoyes
Deleteyesyesyesyesyesyesyesnonoyesyes
Ephemeralyesnoyesyesnonononononono
Reactionsyesnoyesyesyesyesnonoyesyesyes
Filesyesyesnoyesyesyesnoyesyesyesno
Modalsyesnononononononononono
Streamingyesyesyesyesyesyesnonononoyes
DMsyesyesyesyesyesyesyesyesyesyesno
Historyyesnoyesyesyesnoyesnonoyesyes
Typingyesyesnoyesyesyesnoyesnonono

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) # => false

All Capabilities

The full list of capabilities that an adapter can declare:

CapabilityMethod it gates
:edit_messagesedit_message
:delete_messagesdelete_message
:ephemeral_messagespost_ephemeral
:file_uploadsupload_file
:reactionsadd_reaction, remove_reaction
:modalsopen_modal
:typing_indicatorstart_typing
:streaming_editUsed by the streaming system
:threadsThread support
:direct_messagesopen_dm
:message_historyfetch_messages
:scheduled_messagesschedule_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"]
end

Tier 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!")
end

Building Custom Adapters

See Building Adapters for a guide on creating your own platform adapter.

On this page