-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirebase.js
More file actions
39 lines (31 loc) · 1.16 KB
/
firebase.js
File metadata and controls
39 lines (31 loc) · 1.16 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
36
37
38
39
// Import the functions you need from the SDKs you need
import firebase from 'firebase/compat/app';
import 'firebase/compat/auth';
import 'firebase/compat/firestore';
import { getAnalytics } 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: "AIzaSyB3Sg6CeSBvfzYaQ_PFuefJPKSGmvlWtQk",
authDomain: "weather-app-76e7d.firebaseapp.com",
projectId: "weather-app-76e7d",
storageBucket: "weather-app-76e7d.appspot.com",
messagingSenderId: "857963579823",
appId: "1:857963579823:web:5f5ef8c4badca234af475a",
measurementId: "G-X95ZGH6ZZH"
};
// Initialize Firebase
let app;
if(firebase.apps.length === 0){
app = firebase.initializeApp(firebaseConfig);
} else {
app= firebase.app;
}
const auth = firebase.auth();
// const app = initializeApp(firebaseConfig);
// const analytics = getAnalytics(app); //Was not in the video
const db = getFirestore(app);
export { auth, db };