{"id":32168578,"url":"https://github.com/scripbox/firebase-admin-ex","last_synced_at":"2025-10-29T03:10:03.673Z","repository":{"id":55550018,"uuid":"128357578","full_name":"scripbox/firebase-admin-ex","owner":"scripbox","description":"Firebase Admin Elixir SDK","archived":false,"fork":false,"pushed_at":"2023-03-11T16:10:45.000Z","size":54,"stargazers_count":47,"open_issues_count":3,"forks_count":32,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-21T15:55:55.116Z","etag":null,"topics":["elixir","elixir-lang","firebase","firebase-admin","firebase-admin-sdk","firebase-messaging"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/scripbox.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-06T06:37:01.000Z","updated_at":"2025-06-25T07:36:05.000Z","dependencies_parsed_at":"2024-11-23T13:07:14.416Z","dependency_job_id":"f10da433-3733-4567-8745-f56a9cc28af5","html_url":"https://github.com/scripbox/firebase-admin-ex","commit_stats":{"total_commits":28,"total_committers":4,"mean_commits":7.0,"dds":0.3571428571428571,"last_synced_commit":"10aec5c47fbebcc8b14553f71a5d57380399ac9f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scripbox/firebase-admin-ex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scripbox%2Ffirebase-admin-ex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scripbox%2Ffirebase-admin-ex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scripbox%2Ffirebase-admin-ex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scripbox%2Ffirebase-admin-ex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scripbox","download_url":"https://codeload.github.com/scripbox/firebase-admin-ex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scripbox%2Ffirebase-admin-ex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280290185,"owners_count":26305279,"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-10-21T02:00:06.614Z","response_time":58,"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":["elixir","elixir-lang","firebase","firebase-admin","firebase-admin-sdk","firebase-messaging"],"created_at":"2025-10-21T15:56:04.120Z","updated_at":"2025-10-21T15:56:05.146Z","avatar_url":"https://github.com/scripbox.png","language":"Elixir","readme":"# Firebase Admin Elixir SDK\n\n[![Build Status](https://travis-ci.org/scripbox/firebase-admin-ex.svg?branch=master)](https://travis-ci.org/scripbox/firebase-admin-ex)\n\n## Overview\n\nThe Firebase Admin Elixir SDK enables access to Firebase services from privileged environments\n(such as servers or cloud) in Elixir.\n\nFor more information, visit the\n[Firebase Admin SDK setup guide](https://firebase.google.com/docs/admin/setup/).\n\n## Installation\n\n* Add `firebase_admin_ex` to your list of dependencies in `mix.exs`:\n\n```ex\ndefmodule YourApplication.Mixfile do\n  use Mix.Project\n\n  # Run \"mix help deps\" to learn about dependencies.\n  defp deps do\n    [\n      {:firebase_admin_ex, \"~\u003e 0.1.0\"}\n    ]\n  end\nend\n```\n\nNext, run `mix deps.get` to pull down the dependencies:\n\n```sh\n$ mix deps.get\n```\n\nNow you can make an API call by obtaining an access token and using the\ngenerated modules.\n\n### Obtaining an Access Token\nAuthentication is typically done through [Application Default Credentials][adc]\nwhich means you do not have to change the code to authenticate as long as\nyour environment has credentials.\n\nStart by creating a [Service Account key file][service_account_key_file].\nThis file can be used to authenticate to Google Cloud Platform services from any environment.\nTo use the file, set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to\nthe path to the key file. Alternatively you may configure goth (the\nthe authentication ssyas described at\nhttps://github.com/peburrows/goth#installation\n\nFor example:\n\n```sh\n$ export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service_account.json\n```\n\nIf you are deploying to App Engine, Compute Engine, or Container Engine, your\ncredentials will be available by default.\n\n### Usage\n\n#### Messaging\n\n* Sending a `WebMessage`\n\n```ex\n# Get your device registration token\nregistration_token = \"user-device-token\"\n\n# Define message payload attributes\nmessage = FirebaseAdminEx.Messaging.Message.new(%{\n  data: %{},\n  token: registration_token,\n  webpush: FirebaseAdminEx.Messaging.WebMessage.Config.new(%{\n    headers: %{},\n    data: %{},\n    title: \"notification title\",\n    body:  \"notification body\",\n    icon:  \"https://icon.png\"\n  })\n})\n\n# Call the Firebase messaging V1 send API\nproject_id = \"YOUR-FIREBASE-PROJECT-ID\"\n{:ok, response} = FirebaseAdminEx.Messaging.send(project_id, message)\n```\n\n* Sending a `AndroidMessage`\n\n```ex\n# Get your device registration token\nregistration_token = \"user-device-token\"\n\n# Define message payload attributes\nmessage = FirebaseAdminEx.Messaging.Message.new(%{\n  data: %{},\n  token: registration_token,\n  android: FirebaseAdminEx.Messaging.AndroidMessage.Config.new(%{\n    headers: %{},\n    data: %{},\n    title: \"notification title\",\n    body:  \"notification body\",\n    icon:  \"https://icon.png\"\n  })\n})\n\n# Call the Firebase messaging V1 send API\nproject_id = \"YOUR-FIREBASE-PROJECT-ID\"\n{:ok, response} = FirebaseAdminEx.Messaging.send(project_id, message)\n```\n\n* Sending a `APNSMessage`\n\n```ex\n# Get your device registration token\nregistration_token = \"user-device-token\"\n\n# Define message payload attributes\nmessage = FirebaseAdminEx.Messaging.Message.new(%{\n  data: %{},\n  token: registration_token,\n  apns: FirebaseAdminEx.Messaging.APNSMessage.Config.new(%{\n    headers: %{},\n    payload: %{\n      aps: %{\n        alert: %{\n          title: \"Message Title\",\n          body: \"Message Body\"\n        },\n        sound: \"default\",\n        \"content-available\": 1\n      },\n      custom_data: %{}\n    }\n  })\n})\n\n# Call the Firebase messaging V1 send API\nproject_id = \"YOUR-FIREBASE-PROJECT-ID\"\n{:ok, response} = FirebaseAdminEx.Messaging.send(project_id, message)\n```\n\n#### Authentication Management\n\nThe `FirebaseAdminEx.Auth` module allows for some limited management of the\nFirebase Autentication system. It currently supports getting, deleting and creating users.\n\n* Getting a user by `uid`:\n\n```ex\niex(1)\u003e FirebaseAdminEx.Auth.get_user(\"hYQIfs35Rfa4UMeDaf8lhcmUeTE2\")\n{:ok,\n \"{\\n  \\\"kind\\\": \\\"identitytoolkit#GetAccountInfoResponse\\\",\\n  \\\"users\\\": [\\n    {\\n      \\\"localId\\\": \\\"hYQIfs35Rfa4UMeDaf8lhcmUeTE2\\\",\\n      \\\"providerUserInfo\\\": [\\n        {\\n          \\\"providerId\\\": \\\"phone\\\",\\n          \\\"rawId\\\": \\\"+61400000111\\\",\\n          \\\"phoneNumber\\\": \\\"+61400000111\\\"\\n        }\\n      ],\\n      \\\"lastLoginAt\\\": \\\"1543976568000\\\",\\n      \\\"createdAt\\\": \\\"1543976568000\\\",\\n      \\\"phoneNumber\\\": \\\"+61400000111\\\"\\n    }\\n  ]\\n}\\n\"}\n```\n\n* Getting a user by phone number\n\n```ex\niex(1)\u003e FirebaseAdminEx.Auth.get_user_by_phone_number(\"+61400000111\")\n{:ok,\n \"{\\n  \\\"kind\\\": \\\"identitytoolkit#GetAccountInfoResponse\\\",\\n  \\\"users\\\": [\\n    {\\n      \\\"localId\\\": \\\"hYQIfs35Rfa4UMeDaf8lhcmUeTE2\\\",\\n      \\\"providerUserInfo\\\": [\\n        {\\n          \\\"providerId\\\": \\\"phone\\\",\\n          \\\"rawId\\\": \\\"+61400000111\\\",\\n          \\\"phoneNumber\\\": \\\"+61400000111\\\"\\n        }\\n      ],\\n      \\\"lastLoginAt\\\": \\\"1543976568000\\\",\\n      \\\"createdAt\\\": \\\"1543976568000\\\",\\n      \\\"phoneNumber\\\": \\\"+61400000111\\\"\\n    }\\n  ]\\n}\\n\"}\n```\n\n* Getting a user by email address\n\n```ex\niex(1)\u003e FirebaseAdminEx.Auth.get_user_by_email(\"user@example.com\")\n{:ok,\n \"{\\n  \\\"kind\\\": \\\"identitytoolkit#GetAccountInfoResponse\\\",\\n  \\\"users\\\": [\\n    {\\n      \\\"localId\\\": \\\"hYQIfs35Rfa4UMeDaf8lhcmUeTE2\\\",\\n      \\\"providerUserInfo\\\": [\\n        {\\n          \\\"providerId\\\": \\\"phone\\\",\\n          \\\"rawId\\\": \\\"+61400000111\\\",\\n          \\\"phoneNumber\\\": \\\"+61400000111\\\"\\n        \\\"email\\\": \\\"user@example.com\\\"\\n      }\\n      ],\\n      \\\"lastLoginAt\\\": \\\"1543976568000\\\",\\n      \\\"createdAt\\\": \\\"1543976568000\\\",\\n      \\\"phoneNumber\\\": \\\"+61400000111\\\"\\n    }\\n  ]\\n}\\n\"}\n```\n\n* Deleting a user\n\n```ex\niex(4)\u003e FirebaseAdminEx.Auth.delete_user(\"hYQIfs35Rfa4UMeDaf8lhcmUeTE2\")\n{:ok, \"{\\n  \\\"kind\\\": \\\"identitytoolkit#DeleteAccountResponse\\\"\\n}\\n\"}\n```\n\n* Creating a user\n\n```ex\niex(4)\u003e FirebaseAdminEx.Auth.create_email_password_user(%{\"email\" =\u003e \"user@email.com\", \"password\" =\u003e \"hYQIfs35Rfa4UMeDaf8lhcmUeTE2\"})\n{:ok,\n \"{\\n  \\\"kind\\\": \\\"identitytoolkit#SignupNewUserResponse\\\",\\n  \\\"email\\\": \\\"user@email.com\\\",\\n  \\\"localId\\\": \\\"s5dggHJyr3fgdgJkLe234G6h6y\\\"\\n}\\n\"}\n```\n\n* Generating the email action link for sign-in flows\n\n```ex\n# Define ActionCodeSettings\naction_code_settings = \n  FirebaseAdminEx.Auth.ActionCodeSettings.new(\n    %{\n      requestType: \"EMAIL_SIGNIN\",\n      email: \"user@email.com\",\n      returnOobLink: true,\n      continueUrl: \"www.test.com/sign-in\",\n      canHandleCodeInApp: false,\n      dynamicLinkDomain: \"\",\n      androidPackageName: \"\",\n      androidMinimumVersion: \"\",\n      androidInstallApp: false,\n      iOSBundleId: \"\"\n    }\n  )\nclient_email = \"YOUR-FIREBASE-CLIENT-EMAIL\"\nproject_id = \"YOUR-FIREBASE-PROJECT-ID\"\niex(4)\u003e FirebaseAdminEx.Auth.generate_sign_in_with_email_link(action_code_settings, client_email, project_id)\n{:ok,\n \"{\\n  \\\"kind\\\": \\\"identitytoolkit#GetOobConfirmationCodeResponse\\\",\\n  \\\"email\\\": \\\"user@email.com\\\",\\n  \\\"oobLink\\\": \\\"https://YOUR-FIREBASE-CLIENT.firebaseapp.com/__/auth/action?mode=signIn\u0026oobCode=xcdwelFRvfbtghHjswvw2f3g46hh6j8\u0026apiKey=Fgae35h6j78_vbsddgs34th6h6hhekj97gfj\u0026lang=en\u0026continueUrl=www.test.com/sign-in\\\"\\n}\\n\"}\n```\n\n## Firebase Documentation\n\n* [Setup Guide](https://firebase.google.com/docs/admin/setup/)\n* [Authentication Guide](https://firebase.google.com/docs/auth/admin/)\n* [Cloud Messaging Guide](https://firebase.google.com/docs/cloud-messaging/admin/)\n\n## License and Terms\n\nYour use of Firebase is governed by the\n[Terms of Service for Firebase Services](https://firebase.google.com/terms/).\n\n## Disclaimer\n\nThis is not an officially supported Google product.\n\n[adc]: https://cloud.google.com/docs/authentication#getting_credentials_for_server-centric_flow\n[service_account_key_file]: https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount\n[hex_pm]: https://hex.pm/users/google-cloud\n[goth]: https://hex.pm/packages/goth\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscripbox%2Ffirebase-admin-ex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscripbox%2Ffirebase-admin-ex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscripbox%2Ffirebase-admin-ex/lists"}