voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
32 lines (18 loc) • 1.04 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/auth](./auth.md) > [updateEmail](./auth.updateemail.md)
## updateEmail() function
Updates the user's email address.
<b>Signature:</b>
```typescript
export declare function updateEmail(user: User, newEmail: string): Promise<void>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| user | [User](./auth.user.md) | The user. |
| newEmail | string | The new email address. |
<b>Returns:</b>
Promise<void>
## Remarks
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()](./auth.reauthenticatewithcredential.md)<!-- -->.