Firebase
* React js
Set
REACT_APP_DEFAULTAUTH=firebase
in the
.env
file. Also fill all the firebase credentials in the
.env
file. Remove the fake-backend setup code from the
App.js
Now just uncomment the below firebase setup code in the
App.js
file. // Import Firebase Configuration file import { initFirebaseBackend } from "./helpers/firebase_helper"; const firebaseConfig = { apiKey: process.env.REACT_APP_APIKEY, authDomain: process.env.REACT_APP_AUTHDOMAIN, databaseURL: process.env.REACT_APP_DATABASEURL, projectId: process.env.REACT_APP_PROJECTID, storageBucket: process.env.REACT_APP_STORAGEBUCKET, messagingSenderId: process.env.REACT_APP_MESSAGINGSENDERID, appId: process.env.REACT_APP_APPID, measurementId: process.env.REACT_APP_MEASUREMENTID, }; // init firebase backend initFirebaseBackend(firebaseConfig);
* Vite + React js
Set
VITE_APP_DEFAULTAUTH=firebase
in the
.env
file. Also fill all the firebase credentials in the
.env
file. Remove the fake-backend setup code from the
App.jsx
Now just uncomment the below firebase setup code in the
App.jsx
file. // Import Firebase Configuration file import { initFirebaseBackend } from "./helpers/firebase_helper"; const firebaseConfig = { apiKey: process.env.VITE_APP_APIKEY, authDomain: process.env.VITE_APP_AUTHDOMAIN, databaseURL: process.env.VITE_APP_DATABASEURL, projectId: process.env.VITE_APP_PROJECTID, storageBucket: process.env.VITE_APP_STORAGEBUCKET, messagingSenderId: process.env.VITE_APP_MESSAGINGSENDERID, appId: process.env.VITE_APP_APPID, measurementId: process.env.VITE_APP_MEASUREMENTID, }; // init firebase backend initFirebaseBackend(firebaseConfig);
Follow the below step to setup your Firebase application :-
Do your Firebase project setup in https://console.firebase.google.com/