Skip to content

Commit

Permalink
Update firebaseConfig.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ArhanAnsari authored Sep 20, 2024
1 parent 5edcb56 commit dd78ff7
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions firebaseConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,27 @@ import { initializeApp } from "firebase/app";
import { getAnalytics } from "firebase/analytics";
import { getFirestore } from "firebase/firestore";
import { getAuth } from "firebase/auth";
// 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: "AIzaSyCeDw9XuqmaMer6B7URujXFNZ5Af2BbA5k",
authDomain: "inspiregem-a6e2e.firebaseapp.com",
projectId: "inspiregem-a6e2e",
storageBucket: "inspiregem-a6e2e.appspot.com",
messagingSenderId: "64551458816",
appId: "1:64551458816:web:fc32fc26d88102c118e0e5",
measurementId: "G-PTJXZLHGMQ"
apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN,
projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID,
appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID,
measurementId: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID,
};

// Initialize Firebase
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);

// Check if running in the browser before initializing analytics
let analytics;
if (typeof window !== 'undefined') {
analytics = getAnalytics(app);
}

const db = getFirestore(app);
const auth = getAuth(app);

Expand Down

0 comments on commit dd78ff7

Please sign in to comment.