Logo for the site

Config file setup for firebase + database

Just a copy and paste for the config file in Firebase

  • #react
  • #firebase

Create a directory and a file in that directory named config.js. Copy and paste this into it and you are done. Ofcourse with your own configs!

/src/Firebase/config.js
import { initializeApp } from 'firebase/app'
import { getFirestore } from 'firebase/firestore' // added row

const firebaseConfig = {
    apiKey: "AIzaSyC87utLU93uTFRaXCLUVmEDLkn9JBl_px4",
    authDomain: "example-fac5e.firebaseapp.com",
    projectId: "example-fac5e",
    storageBucket: "example-fac5e.appspot.com",
    messagingSenderId: "1043671646322",
    appId: "1:1043671646322:web:ce7c55c505179e9e3242eb"
}

const app = initializeApp(firebaseConfig)

const db = getFirestore(app) // added row

export { db } // added row

Tweet this snippet

Edit on github

call-n

Passionate software engineer trying to learn as much about code and design

Links

All rights reserved © calo.dev 2022