gem install getstream-rubyActivity Feeds v3 is in beta — try it out!
Installation
GitHub repository: https://github.com/GetStream/getstream-ruby. Feel free to submit bug reports and feature requests.
The package is tested against these environments:
- Ruby 3.0+
- Ruby 3.1+
- Ruby 3.2+
- Ruby 3.3+
Note: Ruby 3.0 or higher is required.
To create a client, you’ll need your API key and secret. Both of them can be found in your Stream Dashboard.
You can optionally pass a timeout for the API requests, the default timeout is 6000ms.
require 'getstream_ruby' # Create client using manual configuration client = GetStreamRuby.manual( api_key: 'your_api_key', api_secret: 'your_api_secret' ) # Get the feeds client feeds_client = client.feeds # Your feeds operations here...Alternative initialization methods
Using .env file
Create a .env file in your project root:
STREAM_API_KEY=your_api_key STREAM_API_SECRET=your_api_secretThen initialize the client:
require 'getstream_ruby' # Initialize client from .env file client = GetStreamRuby.env # or client = GetStreamRuby.client # defaults to .env # Get the feeds client feeds_client = client.feedsUsing environment variables
require 'getstream_ruby' # Set environment variables (or export them in your shell) ENV['STREAM_API_KEY'] = 'your_api_key' ENV['STREAM_API_SECRET'] = 'your_api_secret' # Initialize client from environment variables client = GetStreamRuby.env_vars # Get the feeds client feeds_client = client.feeds