{"id":18728728,"url":"https://github.com/rubyonworld/layer-ruby","last_synced_at":"2025-08-29T02:32:55.883Z","repository":{"id":174007976,"uuid":"542157905","full_name":"RubyOnWorld/layer-ruby","owner":"RubyOnWorld","description":"Ruby client for the Layer Server API and Layer Client API.","archived":false,"fork":false,"pushed_at":"2022-09-27T18:27:10.000Z","size":93,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-19T20:32:46.685Z","etag":null,"topics":["api","client","layer","ruby","server"],"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/RubyOnWorld.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-27T15:28:51.000Z","updated_at":"2022-09-27T22:40:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"99b020cd-0ead-4e83-8b86-deb873093da1","html_url":"https://github.com/RubyOnWorld/layer-ruby","commit_stats":null,"previous_names":["rubyonworld/layer-ruby"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RubyOnWorld/layer-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Flayer-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Flayer-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Flayer-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Flayer-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubyOnWorld","download_url":"https://codeload.github.com/RubyOnWorld/layer-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Flayer-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272611920,"owners_count":24964385,"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","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","client","layer","ruby","server"],"created_at":"2024-11-07T14:23:56.712Z","updated_at":"2025-08-29T02:32:55.849Z","avatar_url":"https://github.com/RubyOnWorld.png","language":"Ruby","readme":"# Ruby Client for Layer\n\n[![Build Status](https://travis-ci.org/benedikt/layer-ruby.svg?branch=master)](https://travis-ci.org/benedikt/layer-ruby)\n[![Gem Version](https://badge.fury.io/rb/layer-ruby.svg)](http://badge.fury.io/rb/layer-ruby)\n[![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/gems/layer-ruby)\n\nRuby client for the [Layer Server API](https://docs.layer.com/reference/server_api/introduction) and [Layer Client API](https://docs.layer.com/reference/client_api/introduction).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'layer-ruby', require: 'layer'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install layer-ruby\n\n## Usage\n\nPlease refer to the [Layer Platform API documentation](https://developer.layer.com/docs/platform) and [Layer Client REST API documentation](https://developer.layer.com/docs/client/rest) for details about the required payloads and responses.\n\n### Configuration\n\nTo use the Layer Platform API, you need your Layer APP ID as well as a Layer Platform API Token. The gem reads both values from the `LAYER_APP_ID` and `LAYER_PLATFORM_TOKEN` environment variables. Alternatively you can specify the values by configuring the `Layer::Client` like this:\n\n```ruby\nLayer::Client.configure do |config|\n  config.app_id = 'YOUR_APP_ID_HERE'\n  config.token = 'YOUR_PLATFORM_TOKEN_HERE'\nend\n```\n\n### Using the gem with multiple applications at once\n\nIt's possible to create a new instance of `Layer::Client::Platform` and passing both the app id and the token to the initializer:\n\n```ruby\nplatform_client = Layer::Client::Platform.new('YOUR_APP_ID_HERE', 'YOUR_PLATFORM_TOKEN_HERE')\n```\n\nThe client will not use any global configuration. You can pass the client as a second parameter to any operations (`create`, `find`) described above.\n\n### Using the Layer Client REST API\n\nTo use the Layer Client REST API, you need a way to generate identitiy tokens. You might want to use the [layer-identity_token](https://github.com/dreimannzelt/layer-identity_token) gem for that. Using this gem, you can create a new client using the REST API like this:\n\n```ruby\nclient = Layer::Client.authenticate { |nonce| Layer::IdentityToken.new('user_id_here', nonce) }\n```\n\nAfterwards, pass the client as an additional argument to the resource's methods:\n\n```ruby\n# Finds all conversations of the authenticated user\nLayer::Conversation.all(client)\n```\n\n### Documentation\n\nPlease refer to [the full documentation](http://rubydoc.info/gems/layer-ruby) for details on how to use Announcements, Block Lists, Conversations, Messages, Rich Content, and WebHooks.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/benedikt/layer-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n## Related Work\n\nCheck out the [layer-identity_token](https://github.com/dreimannzelt/layer-identity_token) gem to generate authentication tokens for the Layer SDK.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Flayer-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubyonworld%2Flayer-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Flayer-ruby/lists"}