Answers for "firebase for react"

2

add firebase in react

import * as firebase from 'firebase'

const firebaseConfig = {
    apiKey: "AIzaSyC6EDL8gMkZc3GGzGveMqWe5zvAr5DNiL4",
    authDomain: "blood-components.firebaseapp.com",
    databaseURL: "https://blood-components.firebaseio.com",
    projectId: "blood-components",
    storageBucket: "blood-components.appspot.com",
    messagingSenderId: "388223113819",
    appId: "1:388223113819:web:1273570a12add0fedafd7e",
    measurementId: "G-K6NM078FWD"
};

// Initialize Firebase
firebase.initializeApp(firebaseConfig);
const auth = firebase.auth();
const db = firebase.firestore();

//initiating references to the databases
const usersRef = db.collection('users')

// for privileges purposes
const functions = firebase.functions();

//google provider sign-in
const googleProvider = new firebase.auth.GoogleAuthProvider();


export { firebase, db, auth, functions, googleProvider }
Posted by: Guest on June-30-2020
7

firebase react js

npm install firebase
Posted by: Guest on July-31-2020
2

firebase react

step : 1 // First install  firebase-tools
npm install firebase-tools -g

step : 2 // login in your gmail account and then create one project.

step : 3 // Then go to your project directory 
firebase login // enter details 

step : 4 
npm run build

step : 5
firebase init

// ? What do you want to use as your public directory? build
// ? Configure as a single-page app (rewrite all urls to /index.html)? Yes
// ? Set up automatic builds and deploys with GitHub? No
// ? File build/index.html already exists. Overwrite? No

step : 6 // your project is now deployed 
firebase deploy

step : 7 
// go to firebase account 
// select your project 
// goto Hoisting
Posted by: Guest on August-01-2021

Browse Popular Code Answers by Language