Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

168
Vistas
Where are you supposed to initialize your firebase web app?

So I am brand new to web applications and I don't understand where I am supposed to initialize the my firebase app using this code:

        // Import the functions you need from the SDKs you need
    import { initializeApp } from "https://www.gstatic.com/firebasejs/9.6.6/firebase-app.js";
    import { getAnalytics } from "https://www.gstatic.com/firebasejs/9.6.6/firebase-analytics.js";
  
    // Your web app's Firebase configuration
    const firebaseConfig = {
    // my firebase configuration would go here...
    };
  
    // Initialize Firebase
    const app = initializeApp(firebaseConfig);
    const analytics = getAnalytics(app);

Example:

I will have 2 different pages for my web app (a login page and a home page). I could initialize firebase in the login page and it would work fine for the first time the user logs into the website, but then what happens if the user returns to the website and they skip the login page and go straight to the home page because they are already logged in? Does firebase not get initialized in this case because it never ran the login page code? If so what am I supposed to do?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Once it loads a new page, the browser clears its memory of anything that happened on the previous page. This means that you have to initialize Firebase every page that uses it.

So if you use Firebase both on your login page and on your home page, you will have to initialize it on both of those pages.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda