{"id":25728358,"url":"https://github.com/kenjij/firebase-ruby","last_synced_at":"2026-02-28T12:10:35.901Z","repository":{"id":56846513,"uuid":"97535866","full_name":"kenjij/firebase-ruby","owner":"kenjij","description":"Pure simple Ruby based Firebase REST library","archived":false,"fork":false,"pushed_at":"2021-04-02T20:59:52.000Z","size":30,"stargazers_count":8,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-11T01:21:55.722Z","etag":null,"topics":["database","firebase","ruby"],"latest_commit_sha":null,"homepage":null,"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/kenjij.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":null,"security":null,"support":null}},"created_at":"2017-07-18T00:54:06.000Z","updated_at":"2024-02-26T09:51:43.000Z","dependencies_parsed_at":"2022-09-09T01:00:35.954Z","dependency_job_id":null,"html_url":"https://github.com/kenjij/firebase-ruby","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/kenjij/firebase-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Ffirebase-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Ffirebase-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Ffirebase-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Ffirebase-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenjij","download_url":"https://codeload.github.com/kenjij/firebase-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Ffirebase-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29933093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T09:58:13.507Z","status":"ssl_error","status_checked_at":"2026-02-28T09:57:57.047Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["database","firebase","ruby"],"created_at":"2025-02-26T00:17:32.514Z","updated_at":"2026-02-28T12:10:35.860Z","avatar_url":"https://github.com/kenjij.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# firebase-ruby\n\n[![Gem Version](https://badge.fury.io/rb/firebase-ruby.svg)](http://badge.fury.io/rb/firebase-ruby) [![Code Climate](https://codeclimate.com/github/kenjij/firebase-ruby/badges/gpa.svg)](https://codeclimate.com/github/kenjij/firebase-ruby) [![security](https://hakiri.io/github/kenjij/firebase-ruby/master.svg)](https://hakiri.io/github/kenjij/firebase-ruby/master)\n\nA pure Ruby library for [Firebase Realtime Database](https://firebase.google.com/products/database/) [REST API](https://firebase.google.com/docs/reference/rest/database/) which has only one external dependency: [jwt](http://jwt.github.io/ruby-jwt/).  `firebase-ruby` uses Ruby's built-in Net::HTTP for all HTTP access.\n\n## Getting Started\n\n### Firebase Realtime Database\n\nFirebase SDK makes it easy to work with Realtime Database. However, on the server-side you you'll likely have to work with the REST API directly, and on top of this you will need to deal with OAuth, which can get complicated in a server environment.\n\nTo use firebase-ruby, you'll need a [Service Account and its Private Key](https://firebase.google.com/docs/database/rest/auth#generate_an_access_token). This needs to be in JSON format. Now, you have two ways to use it.\n\n_See [Access Token](#oauth-20-access-token) for more details on that._\n\n### Usage 1) CLI: fbrb\n\nThis gem has a built-in command `fbrb` as an example use and for quick testing.\n\n```sh\nfbrb -k privatekey.json /\n```\n\nThis will download the entire database in JSON format. By using the private key JSON file provided via Firebase console when creating a service account, necessary information such as project ID, URL, credentials are automatically applied.\n\n### Usage 2) In Your App\n\n```ruby\nrequire 'firebase-ruby'\n\n# If you want to enable debug logging\nFirebase.logger = Logger.new(STDOUT)\nFirebase.logger.level = Logger::DEBUG\n\ndb = Firebase::Database.new()\ndb.set_auth_with_key(path: path_to_key_file)\n# or alternatively supply the JSON as string\ndb.set_auth_with_key(json: json_string)\n\ndb.get('/users/jack/name')\n#{\n#  \"first\": \"Jack\",\n#  \"last\": \"Sparrow\"\n#}\n\ndb.put('/users/jack/name', {first: \"Jack\", last: \"Sparrow\"})\n#{\n#  \"first\": \"Jack\",\n#  \"last\": \"Sparrow\"\n#}\n\ndb.post('/message_list', {user_id: \"jack\", text: \"Ahoy!\"})\n#{\n#  \"name\": \"-INOQPH-aV_psbk3ZXEX\"\n#}\n\ndb.patch('/users/jack/name', {last: \"Jones\"})\n#{\n#  \"last\": \"Jones\"\n#}\n\ndb.delete('/users/jack/name/last')\n```\n\n### AWS Lambda Layers\n\nTrying to use it in a Lambda function but lost figuring out how to install gems? See [firebase-lambda-layer](https://github.com/kenjij/firebase-lambda-layer).\n\n## OAuth 2.0 Access Token\n\nUsing the given credentials, `firebase-ruby` will automatically retrieve the [access token](https://firebase.google.com/docs/reference/rest/database/user-auth) from Google's server. The token is valid for 1 hour but a new token will be fetched right before it expires.\n\n`firebase-ruby` keeps the Google OAuth 2.0 process a black box. But for more details, see the document on Google Developers which the process is based on: [Using OAuth 2.0 for Server to Server Applications](https://developers.google.com/identity/protocols/oauth2/service-account).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjij%2Ffirebase-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenjij%2Ffirebase-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjij%2Ffirebase-ruby/lists"}