|
| 1 | +// Import the functions you need from the SDKs you need |
| 2 | +import { initializeApp } from 'firebase/app'; |
| 3 | +import { getAnalytics } from 'firebase/analytics'; |
| 4 | +import { getAuth } from 'firebase/auth'; |
| 5 | +import { getFirestore } from 'firebase/firestore'; |
| 6 | +// TODO: Add SDKs for Firebase products that you want to use |
| 7 | +// https://firebase.google.com/docs/web/setup#available-libraries |
| 8 | + |
| 9 | +// Your web app's Firebase configuration |
| 10 | +// For Firebase JS SDK v7.20.0 and later, measurementId is optional |
| 11 | +const firebaseConfig = { |
| 12 | + apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY, |
| 13 | + authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN, |
| 14 | + projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID, |
| 15 | + storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET, |
| 16 | + messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID, |
| 17 | + appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID, |
| 18 | + measurementId: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID, |
| 19 | +}; |
| 20 | + |
| 21 | +// Initialize Firebase |
| 22 | +const app = initializeApp(firebaseConfig); |
| 23 | +const analytics = getAnalytics(app); |
| 24 | + |
| 25 | +export const auth = getAuth(app); |
| 26 | +export const db = getFirestore(app); |
0 commit comments