Connecting to Realtime Database
Creating a new connection
- Open the connections dialogue. See managing connections for more information.
- Click the
New Connection
button at the bottom-left of the dialogue. - From the
Database
dropdown, selectRealtime Database
. - Give your connection a
Name
so you can easily identify it. - Enter the Google Cloud
Project ID
for the project containing your Realtime Database instance. - Enter the
Database URL
of your Realtime Database instance. - 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.
- 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.