-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirebase.js
More file actions
35 lines (30 loc) · 1.07 KB
/
firebase.js
File metadata and controls
35 lines (30 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
import { getAnalytics, isSupported } from "firebase/analytics";
import {getFirestore} from "firebase/firestore";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: `process.env.FIREBASE_API_KEY`,
authDomain: "ai-flashcards-5b6c4.firebaseapp.com",
projectId: "ai-flashcards-5b6c4",
storageBucket: "ai-flashcards-5b6c4.appspot.com",
messagingSenderId: "572318878584",
appId: "1:572318878584:web:48b2647e3a07444b0ed68d",
measurementId: "G-E9MKPCXV3B"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
let analytics;
if (typeof window !== 'undefined') {
// Client-side code
isSupported().then((supported) => {
if (supported) {
analytics = getAnalytics(app);
}
});
}
const db = getFirestore(app)
export {db, analytics}