-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirebase.js
28 lines (23 loc) · 921 Bytes
/
firebase.js
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
import { initializeApp } from "firebase/app";
import { getFirestore } from 'firebase/firestore';
import { getAnalytics } from "firebase/analytics";
import { GoogleAuthProvider, getAuth } from "firebase/auth";
const firebaseConfig = {
apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
authDomain: "ailetter-base.firebaseapp.com",
projectId: "ailetter-base",
storageBucket: "ailetter-base.appspot.com",
messagingSenderId: "451985534229",
appId: "1:451985534229:web:a05ee23d439a0948a60d1c",
measurementId: "G-NTQGDJVB2P"
};
const firebaseApp = initializeApp(firebaseConfig);
let analytics;
if (firebaseApp.name && typeof window !== 'undefined') {
analytics = getAnalytics(firebaseApp);
}
const db = getFirestore(firebaseApp);
const userAuth = getAuth(firebaseApp)
const googleAuthProvider = new GoogleAuthProvider();
export { analytics, userAuth, googleAuthProvider };
export default db;