Connect a Firebase Realtime Database

Overview

Firebase is a Google product that simplifies the development of mobile apps by providing out-of-the-box solutions for common mobile development needs, such as a simple realtime database and authentication. You can use a single Firebase project for both a realtime database and authentication.

Thunkable provides a default Firebase account for testing purposes, but before you distribute your app we strongly recommend connecting it to your personal Firebase account.

Please note that while the images and instructions from the Firebase account are accurate at the time of this doc’s publishing, they may change slightly over time.

Create a Firebase Account

  1. Visit Firebase.

  2. Click Get Started or Sign in.

  3. Sign in with your existing Google account credentials or create an account.

Create a Firebase Project

  1. On your Firebase console, click + Add project.

  2. Give your project a name.

  3. Click Continue.

  4. Indicate whether or not you want to enable Google Analytics.

  5. Click Create project.

  6. When your new project is ready, click Continue.

Create a Realtime Database

To create a Firebase Realtime Database:

  1. Within your Firebase project, click to expand the Build menu in the left sidebar.

  2. Select Realtime Database.

  3. Click Create Database.

  4. Select your Realtime Database location. This is where your data will be stored.

  5. Click Next.

  6. Select your preferred security rules. Start in locked mode - Your data is private by default. Client read/write access will only be granted as specified by your security rules. Start in test mode - Your data is open by default to enable quick setup. However, you must update your security rules within 30 days to enable long-term client read/write access.

  7. Click Enable.

  8. Build your database to your specifications.

Sample Realtime Database

Below is a simple example of a Firebase Realtime Database.

Connect Your Firebase Account to Thunkable

To connect your Firebase and Thunkable accounts, you need to locate two Firebase properties:

  • API Key

  • Database URL

These will need to be entered into Thunkable, so we recommend you have two browser tabs open, one for Firebase and one for Thunkable.

  1. On your Firebase console, select your project.

  2. Click the gear icon next to Project Overview.

  3. In the Your apps section, locate the web app's SDK code snippet.

  4. Copy the apiKey.

  5. In your Thunkable tab, click the Settings gear icon in the sidebar.

  6. Scroll to the Firebase section and paste the apiKey into the Firebase API Key field.

  7. Return to Firebase, and within the SDK code snippet, locate and copy the projectId.

  8. Back in Thunkable, in the Database URL field, recreate this formula: https://projectId.firebaseio.com with your copied projectId from the previous step.

Video Tutorials

How to Read Data in a Firebase Realtime Database

In this tutorial, you’ll learn how to read data from a connected Firebase Realtime Database.

How to Update Data in a Firebase Realtime Database

In this tutorial, you’ll learn how to update data in a connected Firebase Realtime Database.

User Sign Up, Sign In, and Authentication with Firebase

Have feedback on this doc? Please take a moment to share your feedback here: Thunkable Docs Feedback. Your valuable insights will help us improve and better serve you in the future.

Last updated