Skip to content


At this point you will need the R package, install it from Github if you haven’t already done so.


Navigate to your credentials page:

  1. Click the ⚙ gear icon in the top left.
  2. Click “project settings”
  3. Scroll to the bottom of the “General” tab to find your app credentials.

In there you should find two key things apiKey and projectId. We will need these to configure {firebase}

Project ID

If you manually changed the project_id use that in the function call below, not the one originally created by Google. In brief, use the id that is found in the URL of your project.

You have to either create a configuration file with the firebase_config function or set the following environment variables.


This method is recommended over the used of the config file. You are less likely to leak sensitive information this way.

Set the following environment variables:


These can be placed in your .Renviron, the easiest way to do so is with usethis::edit_r_environ()

Do not commit

Do not commit this file to your version control system, it contains sensitive information.

This will create a firebase.rds file at the root of your project.

    api_key = "xXxxXxx", 
    project_id = "my-project-package"

This is necessary for every project that uses {firebase}; the package will, first, look for it in the working directory by default, second it will look for the environment variables.