Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!