Firebase auth in background script

I have followed the with-firebase-auth example correctly. Once I sign in in the popup, it seems like auth is persisted to the options page as well, which is great.

However, in the background script I just can't seem to get the auth working. It works for making unauthed Firestore requests though.
This is how I initialize the background script:

const app = initializeApp(FIREBASE_CONFIG); const db = getFirestore(app); const auth = getAuth(app); setPersistence(auth, browserLocalPersistence);

Do you guys have a clue on how to do this?
Was this page helpful?