{"id":19312520,"url":"https://github.com/muxinc/mux-ruby","last_synced_at":"2025-04-12T20:45:57.413Z","repository":{"id":35813002,"uuid":"176368728","full_name":"muxinc/mux-ruby","owner":"muxinc","description":"Official Mux API wrapper for ruby projects, supporting both Mux Data and Mux Video.","archived":false,"fork":false,"pushed_at":"2025-03-31T11:37:18.000Z","size":1049,"stargazers_count":50,"open_issues_count":12,"forks_count":12,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-04-04T00:10:00.540Z","etag":null,"topics":["mux","ruby","video","video-analytics","video-processing","video-streaming"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muxinc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-18T21:01:03.000Z","updated_at":"2025-03-31T11:21:42.000Z","dependencies_parsed_at":"2024-04-05T12:30:50.168Z","dependency_job_id":"0c87495d-f589-44d5-8107-499a83b0e33c","html_url":"https://github.com/muxinc/mux-ruby","commit_stats":{"total_commits":97,"total_committers":12,"mean_commits":8.083333333333334,"dds":0.5979381443298969,"last_synced_commit":"f24e12a73d63d3c74c5f283775083a06fa0621ef"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muxinc%2Fmux-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muxinc%2Fmux-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muxinc%2Fmux-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muxinc%2Fmux-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muxinc","download_url":"https://codeload.github.com/muxinc/mux-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631692,"owners_count":21136559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mux","ruby","video","video-analytics","video-processing","video-streaming"],"created_at":"2024-11-10T00:35:09.847Z","updated_at":"2025-04-12T20:45:57.378Z","avatar_url":"https://github.com/muxinc.png","language":"Ruby","readme":"![Mux Ruby Banner](github-ruby-sdk.png)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://rubygems.org/gems/mux_ruby\"\u003e\u003cimg src=\"https://img.shields.io/gem/v/mux_ruby\" title=\"RubyGems\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/muxinc/mux-ruby/workflows/ci.yaml\"\u003e\u003cimg src=\"https://github.com/muxinc/mux-ruby/actions/workflows/ci.yaml/badge.svg\" title=\"CI\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://rubygems.org/gems/mux_ruby\"\u003eRubyGems\u003c/a\u003e |\n  \u003ca href=\"https://docs.mux.com\"\u003eMux Docs\u003c/a\u003e |\n  \u003ca href=\"https://docs.mux.com/api-reference\"\u003eMux API Reference \u003c/a\u003e\n\u003c/p\u003e\n\n# Mux Ruby\n\nOfficial Mux API wrapper for ruby projects, supporting both Mux Data and Mux Video.\n\n[Mux Video](https://mux.com/video) is an API-first platform, powered by data and designed by video experts to make beautiful video possible for every development team.\n\n[Mux Data](https://mux.com/data) is a platform for monitoring your video streaming performance with just a few lines of code. Get in-depth quality of service analytics on web, mobile, and OTT devices.\n\nNot familiar with Mux? Check out https://mux.com/ for more information.\n\nThis SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:\n\n- API version: v1\n- Package version: 5.0.0\n- Build package: org.openapitools.codegen.languages.RubyClientCodegen\nFor more information, please visit [https://docs.mux.com](https://docs.mux.com)\n\n## Installation\n\n### Build a gem\n\nTo build the Ruby code into a gem:\n\n```shell\ngem build mux_ruby.gemspec\n```\n\nThen either install the gem locally:\n\n```shell\ngem install ./mux_ruby-5.0.0.gem\n```\n\n(for development, run `gem install --dev ./mux_ruby-5.0.0.gem` to install the development dependencies)\n\nor publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).\n\nFinally add this to the Gemfile:\n\n    gem 'mux_ruby', '~\u003e 5.0.0'\n\n### Install from Git\n\nIf the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:\n\n    gem 'mux_ruby', :git =\u003e 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'\n\n### Include the Ruby code directly\n\nInclude the Ruby code directly using `-I` as follows:\n\n```shell\nruby -Ilib script.rb\n```\n\n## Getting Started\n\n### Overview\n\nMux Ruby is a code generated lightweight wrapper around the Mux REST API and reflects them accurately. This has a few consequences you should watch out for:\n\n1) For almost all API responses, the object you're looking for will be in the `data` field on the API response object, as in the example below. This is because we designed our APIs with similar concepts to the [JSON:API](https://jsonapi.org/) standard. This means we'll be able to return more metadata from our API calls (such as related entities) without the need to make breaking changes to our APIs. We've decided not to hide that in this library.\n\n2) We don't use a lot of object orientation. For example API calls that happen on a single asset don't exist in the asset class, but are API calls in the AssetsApi which require an asset ID.\n\n### Usage With Webhooks\n\nAt this moment, this SDK is not suitable for parsing or modeling webhook payloads, due to some incompatibilities in our API spec and our SDK generation tooling. We are working on resolving these issues, but for now you should only use this SDK for Mux's REST APIs.\n\n### Authentication\nTo use the Mux API, you'll need an access token and a secret. [Details on obtaining these can be found here in the Mux documentation.](https://docs.mux.com/docs#section-1-get-an-api-access-token)\n\nIts up to you to manage your token and secret. In our examples, we read them from `MUX_TOKEN_ID` and `MUX_TOKEN_SECRET` in your environment.\n\n### Example Usage\nBelow is a quick example of using Mux Ruby to list the Video assets stored in your Mux account.\n\nBe sure to also checkout the [examples directory](examples/):\n* [List Assets, Live Streams, Signing Keys, and Uploads.](examples/video/list-everything.rb)\n* [Create an Asset, wait for it to become availiable, and print its playback URL](examples/video/ingest.rb)\n* [Create a new Live Stream and retrieve its Stream key.](examples/video/create-live-stream.rb)\n\nThere's also example usage of every API call (also used for testing):\n* [Video](examples/video/)\n  * [Assets](examples/video/exercise-assets.rb)\n  * [Live Streams](examples/video/exercise-live-streams.rb)\n  * [Signing Keys](examples/video/exercise-signing-keys.rb)\n  * [Uploads](examples/video/exercise-uploads.rb)\n* [Data](examples/data/)\n  * [Errors](examples/data/exercise-errors.rb)\n  * [Exports](examples/data/exercise-exports.rb)\n  * [Filters](examples/data/exercise-filters.rb)\n  * [Metrics](examples/data/exercise-metrics.rb)\n  * [Video Views](examples/data/exercise-video-views.rb)\n\n```ruby\n#!/usr/bin/env ruby\n\nrequire 'mux_ruby'\n\n# Auth Setup\nopenapi = MuxRuby.configure do |config|\n  config.username = ENV['MUX_TOKEN_ID']\n  config.password = ENV['MUX_TOKEN_SECRET']\nend\n\n# API Client Init\nassets_api = MuxRuby::AssetsApi.new\n\n# List Assets\nputs \"Listing Assets in account:\\n\\n\"\n\nassets = assets_api.list_assets()\nassets.data.each do | asset |\n  puts \"Asset ID: #{asset.id}\"\n  puts \"Status: #{asset.status}\"\n  puts \"Duration: #{asset.duration.to_s}\\n\\n\"\nend\n```\n\n## Exceptions \u0026 Error Handling\n\nAll errors inherit from `ApiError`, you can catch it or you can catch one of the more specific Errors below.\n\n### NotFoundError\n\n`NotFoundError` is thrown when a resource is not found. This is useful when trying to get an entity by its ID, for example `get_asset(\"some-id-here\")` in the AssetsApi.\n\n### UnauthorizedError\n\n`UnauthorizedError` is thrown when Mux cannot authenticate your request. [You should check you have configured your credentials correctly.](#authentication)\n\n### ServiceError\n\n`ServiceError` is thrown when Mux returns a HTTP 5XX Status Code. If you encounter this reproducibly, please get in touch with [support@mux.com](mailto:support@mux.com).\n\n## Documentation\n\n[Be sure to check out the documentation in the `docs` directory.](docs/)\n\n## Issues\n\nIf you run into problems, [please raise a GitHub issue,](https://github.com/muxinc/mux-ruby/issues) filling in the issue template. We'll take a look as soon as possible.\n\n## Contributing\n\nWe now accept PRs against this package! Please make your modifications to the templates in `gen/templates`, not the code itself, or [please open an issue.](https://github.com/muxinc/mux-ruby/issues)\n\n## License\n\n[MIT License.](LICENSE) Copyright 2019 Mux, Inc.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuxinc%2Fmux-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuxinc%2Fmux-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuxinc%2Fmux-ruby/lists"}