All Projects → GetStream → stream-chat-ruby

GetStream / stream-chat-ruby

Licence: other
Stream Chat official Ruby API Client

Programming Languages

ruby
36898 projects - #4 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to stream-chat-ruby

talkjs-examples
TalkJS (https://talkjs.com) examples
Stars: ✭ 60 (+140%)
Mutual labels:  chat-api, chat-sdk
Channelize-iOS-Chat-SDK-Sample
Open-source JavaScript SDK to enable Real-time Messaging
Stars: ✭ 30 (+20%)
Mutual labels:  chat-application, chat-sdk
android-chat-tutorial
Sample apps for the Stream Chat Android SDK's official tutorial
Stars: ✭ 44 (+76%)
Mutual labels:  chat-api, chat-sdk
stream-chat-angular
💬 Angular Chat SDK ➜ Stream Chat. Build a chat app with ease.
Stars: ✭ 23 (-8%)
Mutual labels:  chat-sdk
darkwire-server
Encrypted web socket chat - Darkwire.io Chat Server
Stars: ✭ 18 (-28%)
Mutual labels:  chat-application
Flutter-Chat-Bar
Link to the package -. https://pub.dartlang.org/packages/flutter_chat_bar
Stars: ✭ 39 (+56%)
Mutual labels:  chat-application
build-viking-sample
Sample app for Build Viking.
Stars: ✭ 31 (+24%)
Mutual labels:  chat-application
server
即时通讯(IM)系统
Stars: ✭ 6,896 (+27484%)
Mutual labels:  chat-application
Flutter-Chat-Application
Realtime Chat application using stream and linking with firebase firestore database build using flutter and firebase
Stars: ✭ 33 (+32%)
Mutual labels:  chat-application
imsdk-ios
Startalk is a high-performace IM software for business. It has been stably used in Qunar for more than 4 years, providing services as well as consultation after and before sales to business. Startalk is applicable to multiple scenarios, such as office automation, business services, and first-party SDKs for IM scenes
Stars: ✭ 30 (+20%)
Mutual labels:  chat-application
code-sync
Collaborative cloud platform for students, teachers, and professionals.
Stars: ✭ 28 (+12%)
Mutual labels:  chat-application
tinode-js
Tinode javascript bindings
Stars: ✭ 43 (+72%)
Mutual labels:  chat-application
Whizzz-The-ChatApp
Whizzz is a real-time, one-to-one Android chat application made using Firebase, a beautiful user interface, and a push-notification feature.
Stars: ✭ 66 (+164%)
Mutual labels:  chat-application
Chat-App-Android
Chat app based on the MVVM architecture using Kotlin, ViewModel, LiveData, DataBinding and more.
Stars: ✭ 70 (+180%)
Mutual labels:  chat-application
react-chat-client
A simple chat client built in React for communicating with the node-multi-server-chat example
Stars: ✭ 24 (-4%)
Mutual labels:  chat-application
nestDemo-ChatServer
Server side of Chat App implemented using Nest
Stars: ✭ 38 (+52%)
Mutual labels:  chat-application
salesiq-mobilisten-android-sample
Sample App to integrate SalesIQ Android SDK (Mobilisten)
Stars: ✭ 13 (-48%)
Mutual labels:  chat-sdk
darkwire-client
Encrypted web socket chat - Darkwire.io client
Stars: ✭ 23 (-8%)
Mutual labels:  chat-application
MyBot
🧠 Create chatbots easily with Bot Framework! 🤖
Stars: ✭ 30 (+20%)
Mutual labels:  chat-application
ucx chat
UcxUcc is a simple but powerful team collaboration suite of applications designed to improve communications, information sharing and productivity for the businesses small and large.
Stars: ✭ 54 (+116%)
Mutual labels:  chat-application

Official Ruby SDK for Stream Chat

build Gem Version

Official Ruby API client for Stream Chat, a service for building chat applications.
Explore the docs »

Code Samples · Report Bug · Request Feature

📝 About Stream

You can sign up for a Stream account at our Get Started page.

You can use this library to access chat API endpoints server-side.

For the client-side integrations (web and mobile) have a look at the JavaScript, iOS and Android SDK libraries (docs).

⚙️ Installation

stream-chat-ruby supports:

  • Ruby (2.5, 2.6, 2.7, 3.0, 3.1)
$ gem install stream-chat-ruby

Getting started

require 'stream-chat'

client = StreamChat::Client.new(api_key='STREAM_KEY', api_secret='STREAM_SECRET')

💡 Note: since v2.21.0 we implemented Sorbet type checker. As of v2.x.x we only use it for static type checks and you won't notice any difference, but from v3.0.0 we will enable runtime checks 🚨 🚨 🚨.

What this means, is that you'll receive an error during runtime if you pass an invalid type to our methods. To prepare for that, just make sure whatever you pass in, matches the method signature (sig { ... }).

Update (2022-May-24): we have relased v3.0.0 with enabled runtime checks.


Additionally, in a future major version, we would like to enforce symbol hash keys during runtime to conform to Ruby best practises. It's a good idea to prepare your application for that.

# Wrong:
user = { "user" => { "id" => "bob-1"}}
# Correct:
user = { :user => { :id => "bob-1" }}

Generate a token for client-side usage:

client.create_token('bob-1')

Create/Update users

client.upsert_user({
    :id => 'bob-1',
    :role => 'admin',
    :name => 'Robert Tables'
})

# Batch update is also supported
jane = {:id => 'jane-1'}
june = {:id => 'june-1'}
client.upsert_users([jane, june])

Channel types

client.create_channel_type({
    :name => 'livechat',
    :automod => 'disabled',
    :commands => ['ban'],
    :mutes => true
})

channel_types = client.list_channel_types()

Channels

# Create a channel with members from the start
chan = client.channel("messaging", channel_id: "bob-and-jane", data: {:members => ['bob-1', 'jane-77']})
chan.create('bob-1')

# Create a channel and then add members
chan = client.channel("messaging", channel_id: "bob-and-jane")
chan.create('bob-1')
chan.add_members(['bob-1', 'jane-77'])

Reactions

chan.send_reaction(m1['id'], {:type => 'like'}, 'bob-1')

Moderation

chan.add_moderators(['jane-77'])
chan.demote_moderators(['bob-1'])

chan.ban_user('bob-1', timeout: 30)

chan.unban_user('bob-1')

Messages

m1 = chan.send_message({:text => 'Hi Jane!'}, 'bob-1')

deleted_message = client.delete_message(r1['id'])

Devices

jane_phone = client.add_device({:id => 'iOS Device Token', :push_provider => push_provider.apn, :user_id => 'jane-77'})

client.get_devices('jane-77')

client.remove_device(jane_phone['id'], jane_phone['user_id'])

Blocklists

client.create_blocklist('my_blocker', %w[fudge cream sugar])

# Enable it on 'messaging' channel type
client.update_channel_type('messaging', blocklist: 'my_blocker', blocklist_behavior: 'block')

client.get_blocklist('my_blocker')

client.delete_blocklist('my_blocker')

Export Channels

# Register an export
response = client.export_channels({:type => 'messaging', :id => 'jane'})

# Check completion
status_response = client.get_export_channel_status(response['task_id'])
# status_response['status'] == 'pending', 'completed'

Rate limits

# Get all rate limits
limits = client.get_rate_limits

# Get rate limits for specific platform(s)
limits = client.get_rate_limits(server_side: true)

# Get rate limits for specific platforms and endpoints
limits = client.get_rate_limits(android: true, ios: true, endpoints: ['QueryChannels', 'SendMessage'])

✍️ Contributing

We welcome code changes that improve this library or fix a problem, please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on Github. We are very happy to merge your code in the official repository. Make sure to sign our Contributor License Agreement (CLA) first. See our license file for more details.

Head over to CONTRIBUTING.md for some development tips.

🧑‍💻 We are hiring!

We've recently closed a $38 million Series B funding round and we keep actively growing. Our APIs are used by more than a billion end-users, and you'll have a chance to make a huge impact on the product within a team of the strongest engineers all over the world.

Check out our current openings and apply via Stream's website.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].