// Import the functions you need from the SDKs you need import { initializeApp } from 'firebase/app'; import { getAnalytics, logEvent, Analytics } from 'firebase/analytics'; // 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: '', authDomain: '', projectId: '', storageBucket: '', messagingSenderId: '', appId: '', measurementId: '', }; // Initialize Firebase const app = initializeApp(firebaseConfig); let analytics: Analytics; // only for csr if (typeof window !== 'undefined') { analytics = getAnalytics(app); } export const setEvent = (eventName: string, params?: object) => { logEvent(analytics, eventName, params); };