Skip to content

Instantly share code, notes, and snippets.

@vaibhavgehani
Last active October 3, 2022 14:13
Show Gist options
  • Save vaibhavgehani/7f791983da920cb1e0216490be5086a7 to your computer and use it in GitHub Desktop.
Save vaibhavgehani/7f791983da920cb1e0216490be5086a7 to your computer and use it in GitHub Desktop.
import { initializeApp } from 'firebase/app';
import { initializeFirestore } from 'firebase/firestore'
import { getAuth } from "firebase/auth";
const firebaseConfig = {
apiKey: "<your_firebase_project_value>",
authDomain: "<your_firebase_project_value>",
projectId: "<your_firebase_project_value>",
storageBucket: "<your_firebase_project_value>",
messagingSenderId: "<your_firebase_project_value>",
appId: "<your_firebase_project_value>",
measurementId: "<your_firebase_project_value>"
};
// app instance
const app = initializeApp(firebaseConfig);
// auth instance
const auth = getAuth(app);
// db instance (firestore)
const db = initializeFirestore(app, {experimentalForceLongPolling: true});
// using app and db in other files
export {
app,
db,
auth
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment