{"id":19838772,"url":"https://github.com/ruel/firebase-token-erlang","last_synced_at":"2025-08-01T20:34:36.283Z","repository":{"id":62429655,"uuid":"69748976","full_name":"ruel/firebase-token-erlang","owner":"ruel","description":"Custom Firebase token generator library for Erlang","archived":false,"fork":false,"pushed_at":"2017-04-04T17:48:29.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-06T17:41:30.012Z","etag":null,"topics":["custom-firebase-token","erlang","firebase","firebase-token","otp"],"latest_commit_sha":null,"homepage":null,"language":"Erlang","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/ruel.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":"2016-10-01T16:16:05.000Z","updated_at":"2019-12-18T22:18:21.000Z","dependencies_parsed_at":"2022-11-01T19:47:12.788Z","dependency_job_id":null,"html_url":"https://github.com/ruel/firebase-token-erlang","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ruel/firebase-token-erlang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruel%2Ffirebase-token-erlang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruel%2Ffirebase-token-erlang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruel%2Ffirebase-token-erlang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruel%2Ffirebase-token-erlang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruel","download_url":"https://codeload.github.com/ruel/firebase-token-erlang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruel%2Ffirebase-token-erlang/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268291766,"owners_count":24226952,"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-01T02:00:08.611Z","response_time":67,"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":["custom-firebase-token","erlang","firebase","firebase-token","otp"],"created_at":"2024-11-12T12:18:57.820Z","updated_at":"2025-08-01T20:34:36.249Z","avatar_url":"https://github.com/ruel.png","language":"Erlang","readme":"# Firebase Token Generator - Erlang \n\n[![Build Status](https://travis-ci.org/ruel/firebase-token-erlang.svg?branch=master)](https://travis-ci.org/ruel/firebase-token-erlang) [![Hex.pm](https://img.shields.io/hexpm/v/firebase_token.svg)](https://hex.pm/packages/firebase_token)\n\nHelper module for generating custom Firebase token in Erlang. Custom Firebase tokens are used on applications with totally different authentication methods. These tokens are in JWT (JSON Web Token) format and can be then used by client applications on authenticating to Firebase.\n\nOnly supports Firebase 3.x.x. See https://firebase.google.com/docs/auth/server/create-custom-tokens for more information.\n\n## OTP Version\n\n**Required**: OTP 18 and later\n\n## Setup\n\nThis can be added as a dependency from [hex.pm](https://hex.pm/packages/firebase_token)\n\n```erlang\n{deps, [\n  {firebase_token, \"1.1.0\"}\n]}. \n```\n\n## Usage\n\nOne of the requirements for this library is the service account key JSON file that can be obtained from the [Google API Manager Console](https://console.developers.google.com/apis/credentials)\n\n```erlang\nAccount = firebase_token_account:load_from_file(\"/path/to/service_account.json\"),\n%% Or you can load from binary string input\n%% Account = firebase_token_account:load(\u003c\u003c\"{ ...JSON String... }\"\u003e\u003e),\n\nUid = \u003c\u003c\"1\"\u003e\u003e, %% Main user id string. Length must not exceed by 36\nLife = 3600,   %% Token life (when to expire). Must not exceed 3600 seconds\nExtra = #{     %% Arbitrary values\n  admin =\u003e true\n},\n\n{token, _FirebaseToken} = firebase_token:generate(Account, Uid, Life, Extra).\n```\n\n\u003e **NOTE**: Extras cannot have the following keys: **acr**, **amr**, **at_hash**, **aud**, **auth_time**, **azp**, **cnf**, **c_hash**, **exp**, **firebase**, **iat**, **iss**, **jti**, **nbf**, **nonce** and **sub**.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruel%2Ffirebase-token-erlang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruel%2Ffirebase-token-erlang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruel%2Ffirebase-token-erlang/lists"}