Ruby Matrix SDK

A Ruby gem for easing the development of software that communicates with servers implementing the Matrix protocol.

There is a Matrix room for the discussion about usage and development at

Live YARD documentation can be found at;

Example usage

For more fully-featured examples, check the examples folder.

# Raw API usage
require 'matrix_sdk'

api = ''

api. user: 'example', password: 'notarealpass'
# => {:user_id=>""}

# It's possible to call arbitrary APIs as well
api.request :get, :federation_v1, '/version'
# => {:server=>{:version=>"0.28.1", :name=>"Synapse"}}
# Client wrapper with login
require 'matrix_sdk'

client = ''
client. 'username', 'notarealpass' #, no_sync: true

# => 5
hq = client.find_room ''
# => #<MatrixSdk::Room:00005592a1161528 @id="!" @name="Matrix HQ" @topic="The Official Matrix HQ - please come chat here! | To support development: | Try for a glossy web client | Looking for homeserver hosting? Check out!" @canonical_alias="" @aliases=[""] @join_rule=:public @guest_access=:can_join @event_history_limit=10>
# => true
hq.send_text "This is an example message - don't actually do this ;)"
# => {:event_id=>"$"}
# Client wrapper with token
require 'matrix_sdk'

client = ''
client.api.access_token = 'thisisnotarealtoken'

# Doesn't automatically trigger a sync when setting the token directly
# => 0

# => 5
#!/bin/env ruby
# Bot DSL
require 'matrix_sdk/bot'

command :plug do
  room.send_text <<~PLUG
    The Ruby SDK is a fine method for writing applications communicating over the Matrix protocol.
    It can easily be integrated with Rails, and it supports most client/bot use-cases.


Bug reports and pull requests are welcome on GitHub at


The gem is available as open source under the terms of the MIT License.