Ruby SDK
Add secure, scalable video to your Ruby project
The FastPix Ruby SDK gives you everything you need to manage video from your backend. Upload files from a public URL, attach metadata, and retrieve playback links, all without building encoding pipelines or managing storage. With this SDK, you can:
- Upload and organize video assets
- Define access control and metadata
- Generate HLS playback URLs
- Streamline video delivery from your Ruby server
Find more in the SDK reference
To explore more examples, API methods, and advanced usage, see the FastPix Ruby SDK on GitHub.
Prerequisites
Before you start using the SDK, make sure you have the following:
- Ruby 2.7 or later: This SDK is compatible with Ruby 2.7 or higher
- RubyGems and Bundler: Required for dependency management
- IDE: RubyMine, VS Code with Ruby extensions, or any text editor of your choice
- FastPix API credentials: You’ll need an Access Token and a Secret Key. You can generate these credentials by following the steps in the authentication guide
- Basic understanding of Ruby and REST APIs: Familiarity with Ruby development and API integration concepts
Installation
Install the FastPix Ruby SDK using Bundler. Add to your Gemfile:
Then run:
Or install the gem directly:
Import the SDK
Example
Let’s create a file named example.rb
This example shows how to upload a video from a public URL with metadata and public access:
NOTE
In the following example, replaceyour-access-tokenandyour-secret-keywith the Access Token ID and Secret Key values from the.envfile you downloaded.
After the video is processed, you can use the media ID to fetch playback info, monitor status, or transform content through the API.
Run the example
To execute the Ruby script, use the following command. Make sure to replace example.rb with your actual file name if it’s different:
NOTE
Some methods might throw errors when you are on a trial plan.