feat(firebase): Add Firebase SDK and initialize Analytics

This commit integrates the Firebase SDK into the application to enable Firebase services, starting with Google Analytics.

Key changes include:
- Added the `firebase` package as a dependency.
- Included Firebase project configuration variables in the production environment file.
- Created a new `firebase.ts` utility to centralize Firebase app initialization.
- Integrated the `FirebaseAnalytics` component into the root layout to enable analytics tracking across the entire application.
This commit is contained in:
AmirReza Jamali
2025-10-04 09:28:40 +03:30
parent df8deaee9b
commit b58ea368ec
13 changed files with 1147 additions and 23 deletions
+16
View File
@@ -0,0 +1,16 @@
importScripts("https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js");
importScripts(
"https://www.gstatic.com/firebasejs/8.10.0/firebase-messaging.js",
);
firebase.initializeApp({
apiKey: "AIzaSyCTjdsk2jE34IfnvSKP1JMTIf_Abd7tbt0",
authDomain: "opplens-270d1.firebaseapp.com",
projectId: "opplens-270d1",
storageBucket: "opplens-270d1.firebasestorage.app",
messagingSenderId: "6923326255",
appId: "1:6923326255:web:584a017e8e1bd0e4ed87da",
measurementId: "G-VQW40G8VKC",
});
const messaging = firebase.messaging();