Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

169
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda