Beta โ€” under active development

Chat SDK for Ruby

Build bots that work across every chat platform. One API, normalized events, cards DSL, streaming โ€” write once, deploy to Slack, Teams, Google Chat, and more.

setup.rb
bot = ChatSDK::Chat.new(
  user_name: "my-bot",
  adapters: {
    slack: ChatSDK::Slack::Adapter.new,
    teams: ChatSDK::Teams::Adapter.new
  },
  state: ChatSDK::State::Redis.new
)
events.rb
bot.on_new_mention do |thread, message|
  thread.subscribe
  thread.post("Hi #{message.author.name}!")
end

bot.on_reaction(%w[thumbsup]) do |event|
  event.thread.post("Thanks for the reaction!")
end

bot.on_slash_command("/weather") do |event|
  forecast = Weather.fetch(event.text)
  event.respond(forecast)
end
cards.rb
thread.post(ChatSDK.card(title: "Deploy v2.1.0") do
  text "Ready to ship to production"
  fields do
    field "Branch", "main"
    field "Author", "@alice"
  end
  actions do
    button "Approve", id: "deploy:approve", style: :primary
    button "Cancel", id: "deploy:cancel", style: :danger
    link_button "View diff", url: "https://github.com/..."
  end
end)
ai.rb
bot.on_new_mention do |thread, message|
  # Fetch conversation history
  history = ChatSDK::AI.to_ai_messages(thread.messages)

  # Stream any LLM response back to chat
  response = MyLLM.stream(messages: history)
  thread.post_ai_stream(response)
end

Everything you need

A complete framework for multi-platform chat bots โ€” from webhook ingestion to LLM streaming.

Three tiers of control

Use the normalized API or drop down when you need platform-specific access.

1Normalized
thread.post("hello")

Cross-platform, zero config

2Adapter
adapter.post_message(...)

Platform-aware, normalized format

3Raw Client
client.chat_postMessage(...)

Full native API access

Start building

Add to your Gemfile and go.

$ gem install chat_sdk chat_sdk-slack