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

253
Views
How to use setPersistence in Firebase Modular SDK V9?

i try firebase 9 version persistence for login:

setPersistence(auth, firebaseApp.auth.Persistence.LOCAL).then( async() => {
  // login
}).catch((e) => {
  this.error = e.message
})

show error:

Uncaught TypeError: Cannot read property 'Persistence' of undefined

any clue?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You need to import persistence states this way:

import {
  getAuth,
  setPersistence,
  browserLocalPersistence,
  browserSessionPersistence,
  inMemoryPersistence
} from "firebase/auth";

const auth = getAuth()

await setPersistence(auth, browserLocalPersistence);
Namespaced Version V8 Modular Version V9
firebase.auth.Auth.Persistence.LOCAL browserLocalPersistence
firebase.auth.Auth.Persistence.SESSION browserSessionPersistence
firebase.auth.Auth.Persistence.NONE inMemoryPersistence
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!