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 > sendPasswordResetEmail

sendPasswordResetEmail() function

Sends a password reset email to the given email address.

Signature:

export declare function sendPasswordResetEmail(auth: Auth, email: string, actionCodeSettings?: ActionCodeSettings): Promise<void>;

Parameters

Parameter Type Description
auth Auth The Auth instance.
email string The user's email address.
actionCodeSettings ActionCodeSettings The ActionCodeSettings.

Returns:

Promise<void>

Description

To complete the password reset, call confirmPasswordReset() with the code supplied in the email sent to the user, along with the new password specified by the user.

Example

const actionCodeSettings = {
  url: 'https://www.example.com/?email=user@example.com',
  iOS: {
     bundleId: 'com.example.ios'
  },
  android: {
    packageName: 'com.example.android',
    installApp: true,
    minimumVersion: '12'
  },
  handleCodeInApp: true
};
await sendPasswordResetEmail(auth, 'user@example.com', actionCodeSettings);
// Obtain code from user.
await confirmPasswordReset('user@example.com', code);