Skip to content

Instantly share code, notes, and snippets.

@vaibhavgehani
Created September 28, 2022 08:54
Show Gist options
  • Select an option

  • Save vaibhavgehani/3872b1cad34b91c7e804bba45d1b2e65 to your computer and use it in GitHub Desktop.

Select an option

Save vaibhavgehani/3872b1cad34b91c7e804bba45d1b2e65 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_project_key>",
authDomain: "<your_project_key>",
projectId: "<your_project_key>",
storageBucket: "<your_project_key>",
messagingSenderId: "<your_project_key>",
appId: "<your_project_key>",
measurementId: "<your_project_key>"
};
// 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