
<aside>
👋 Follow this guide to get Firebase setup in your Divjoy codebase. If you've chosen Firebase Auth or Cloud Firestore (or both) then this guide is for you.
</aside>
<aside>
👀 Click the ▶︎ icon next to any step to see a detailed walkthrough with screenshots.
</aside>
Basic Setup
Follow these steps if you're using Firebase Auth or Cloud Firestore
- Signup for an account at firebase.com or login to your existing account.
- Create a new Firebase project
- Go to project settings and setup a web app. Firebase allows you to have multiple app types (iOS, Android, web), but we'll just be creating one for the web right now.
- Copy your Project ID, API Key, and Auth Domain into your codebase
.env
file.
- Go to the "Service accounts" section of your project settings and generate a new private key.
- Open the service accounts file you just downloaded and copy the entire
private_key
and client_email
values into your codebase .env
file. This is necessary for any server logic that needs to talk to Firebase.

Firebase Auth
Follow these steps if you're using Firebase Auth (skip if using a different auth provider)
- Go to the Authentication "Sign-in method" section
- Enable the Email/Password provider
- [optional] Enable social auth providers. This will involve creating apps with each provider and adding your credentials. You can also come back to this step later, as it's not required to get your web app up and running.
- Tell Firebase to use your own UI for email-based actions (password reset, email verification, etc) by going to "Templates" and changing the "Action URL" to
http://localhost:3000/firebase-action
. This page is automatically inserted by Divjoy when you export your codebase.
- Important: If you're using Cloud Firestore then authentication will not work until that is setup. The auth logic we give you in
src/util/auth.js
automatically merges extra user data from Cloud Firestore and will fail if it's unreachable. Continue on to the next section to setup Cloud Firestore.