The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/auth > updateEmail

updateEmail() function

Updates the user's email address.

Signature:

export declare function updateEmail(user: User, newEmail: string): Promise<void>;

Parameters

Parameter Type Description
user User The user.
newEmail string The new email address.

Returns:

Promise<void>

Description

An email will be sent to the original email address (if it was set) that allows to revoke the email address change, in order to protect them from account hijacking.

Important: this is a security sensitive operation that requires the user to have recently signed in. If this requirement isn't met, ask the user to authenticate again and then call reauthenticateWithCredential().