You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Aside: I had to firebase logout and then firebase login to get firebase init to work.)
then either one of the two following:
1 of 2
Install:
npm install firebase
// Import the functions you need from the SDKs you needimport{initializeApp}from"firebase/app";import{getAnalytics}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 optionalconstfirebaseConfig={apiKey: "...",authDomain: "....firebaseapp.com",databaseURL: "https://....firebaseio.com",projectId: "...",storageBucket: "....firebasestorage.app",messagingSenderId: "...",appId: "...",measurementId: "..."};// Initialize Firebaseconstapp=initializeApp(firebaseConfig);constanalytics=getAnalytics(app);
2 of 2
or use script tags:
<scripttype="module">// Import the functions you need from the SDKs you needimport{initializeApp}from"https://www.gstatic.com/firebasejs/11.0.1/firebase-app.js";import{getAnalytics}from"https://www.gstatic.com/firebasejs/11.0.1/firebase-analytics.js";// 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 optionalconstfirebaseConfig={apiKey: "...",authDomain: "....firebaseapp.com",databaseURL: "https://....firebaseio.com",projectId: "...",storageBucket: "....firebasestorage.app",messagingSenderId: "...",appId: "...",measurementId: "..."};// Initialize Firebaseconstapp=initializeApp(firebaseConfig);constanalytics=getAnalytics(app);</script>