Spaces:
Configuration error
Configuration error
| // src/firebase.js | |
| import { initializeApp } from "firebase/app"; | |
| import { getAuth, GoogleAuthProvider } from "firebase/auth"; | |
| import { getFirestore } from "firebase/firestore"; | |
| import { getStorage } from "firebase/storage"; | |
| import { getAnalytics, isSupported } from "firebase/analytics"; | |
| // πΉ Your Firebase configuration | |
| const firebaseConfig = { | |
| apiKey: "AIzaSyDonQCMhJ5jQ3kiheFvAeWxJ8MtH1cRcXk", | |
| authDomain: "humanizer-x-16baa.firebaseapp.com", | |
| projectId: "humanizer-x-16baa", | |
| storageBucket: "humanizer-x-16baa.appspot.com", | |
| messagingSenderId: "513434319424", | |
| appId: "1:513434319424:web:74912c65b196c62dc87da5", | |
| measurementId: "G-H94EMGYRNF", | |
| }; | |
| // β Initialize Firebase app | |
| const app = initializeApp(firebaseConfig); | |
| // β Firebase services exports | |
| export const auth = getAuth(app); | |
| export const provider = new GoogleAuthProvider(); | |
| export const db = getFirestore(app); // Firestore database | |
| export const storage = getStorage(app); // Storage for profile images | |
| // β Analytics (optional) | |
| export let analytics; | |
| if (typeof window !== "undefined") { | |
| isSupported().then((supported) => { | |
| if (supported) { | |
| analytics = getAnalytics(app); | |
| } | |
| }); | |
| } | |
| // β Optional init function (if needed elsewhere) | |
| export async function initFirebase() { | |
| return { app, auth, db, storage, provider, analytics }; | |
| } | |