Anonymous account

Register an account with no personal information from the user.

signInAnonymously(auth)

The generated credentials are stored in the browser: the user cannot access the account from another device, and cannot recover the account if credentials are lost.

The creation of an anonymous account is partially supported by Auth-triggered Cloud Functions:

  • it triggers the v1's user().onCreate() cloud function.
  • it doesn't trigger the blocking beforeUserCreated() cloud function (as of now).

check if the account is anonymous

On the client, we check isAnonymous:

auth.currentUser?.isAnonymous // true for anonymous accounts

In auth-triggered Cloud Functions, we read providerData (from the UserRecord).

export const onRegisterNonBlocking = auth.user().onCreate(async (userRecord) => {
    userRecord.providerData.length === 0 // true for anonymous accounts
})

convert to a non-anonymous account

We link to another provider. Since the user already exists (currentUser), we provide it to the link function.

Link to an email credential, after collecting the email address and password:

const emailCred = EmailAuthProvider.credential(email, password)
await linkWithCredential(auth.currentUser, emailCred)

Link to an identity provider, with a popup:

const gProvider = new GoogleAuthProvider()
const result = await linkWithPopup(auth.currentUser, gProvider)
earlymorning logo

© Antoine Weber 2026 - All rights reserved

Anonymous account

Register an account with no personal information from the user.

signInAnonymously(auth)

The generated credentials are stored in the browser: the user cannot access the account from another device, and cannot recover the account if credentials are lost.

The creation of an anonymous account is partially supported by Auth-triggered Cloud Functions:

  • it triggers the v1's user().onCreate() cloud function.
  • it doesn't trigger the blocking beforeUserCreated() cloud function (as of now).

check if the account is anonymous

On the client, we check isAnonymous:

auth.currentUser?.isAnonymous // true for anonymous accounts

In auth-triggered Cloud Functions, we read providerData (from the UserRecord).

export const onRegisterNonBlocking = auth.user().onCreate(async (userRecord) => {
    userRecord.providerData.length === 0 // true for anonymous accounts
})

convert to a non-anonymous account

We link to another provider. Since the user already exists (currentUser), we provide it to the link function.

Link to an email credential, after collecting the email address and password:

const emailCred = EmailAuthProvider.credential(email, password)
await linkWithCredential(auth.currentUser, emailCred)

Link to an identity provider, with a popup:

const gProvider = new GoogleAuthProvider()
const result = await linkWithPopup(auth.currentUser, gProvider)