Connecting a Firebase Account

In order to connect your Firebase account, you'll need to configure it in our Data modal.

You can navigate to that modal by clicking "Data" in the left-side panel, or by attempting to add data to a specific screen in your app by selecting that screen and navigating to the "Data" tab in the right-side panel.

Once you've navigated to the Data modal, you'll choose "Firebase"

The first step in connecting your Firebase account is to paste in your config snippet. This can be found in your Firebase Project Settings in the General tab.

The snippet has the following format:

const firebaseConfig = {
  apiKey: "My apiKey",
  authDomain: "My authDomain",
  projectId: "My projectId",
  storageBucket: "My storageBucket",
  messagingSenderId: "My messagingSenderId",
  appId: "My appId",
};

Once you've copied that snippet, just paste it directly in the Draftbit Data modal.

Step 2 is to upload your Firebase Service Account file. The format of that file is .json.

You can find that file in your Firebase Project Settings in the Service accounts tab. Once there, click the "Generate new private key" button and Firebase will download the .json file to your local storage.

Once you've download the Service Account file, you can upload it to Draftbit.

When you've completed Steps 1 and 2, click "Connect" you'll see the collections available in your connected Firestore appear in Step 3. You're done!

Note: If you connect a Firestore database that has no collections or documents, you'll get a message at Step 3 indicating such. That's ok! Once you've added collections/documents to your Firestore schema, simply hit "Refresh" in the Draftbit Data modal and your collection data will then sync.

❗️

If you experience errors connecting to Firebase

  • Make sure you have your security rules set to allow for client read/write access
  • Make sure you have a Firestore database set up

Did this page help you?