Skip to main content

Connecting to Realtime Database

Creating a new connection

  1. Open the connections dialogue. See managing connections for more information.
  2. Click the New Connection button at the bottom-left of the dialogue.
  3. From the Database dropdown, select Realtime Database.
  4. Give your connection a Name so you can easily identify it.
  5. Enter the Google Cloud Project ID for the project containing your Realtime Database instance.
  6. Enter the Database URL of your Realtime Database instance.
  7. Select your authentication strategy. You can either delegate access to a service accunt provided by Ezfire or provide a service account key for your own service account. See authenticating a Google Cloud Service for more information. In particular, the service account needs one of the following roles:
    • roles/firebasedatabase.viewer for a read-only connection.
    • roles/firebasedatabase.admin for a read/write connection.
  8. Click the Save button to save your connection.

Your Realtime Database connection is now ready to use.

JavaScript API

Realtime Database connections support running JavaScript queries. For these queries, the db global supports a subset the Database API from the firebase-admin NPM package. In particular, it exports the ref and refFromUrl method. See the official documentation for more information.