About the Recovery Email API

The Wix Recovery API enables Wix Headless site or app members to reset their passwords. Learn more about handling members with a custom login.

With the Wix Recovery API, you can:

  • Send recovery emails to members who need to reset their passwords.
  • Manage the language and redirect settings for recovery emails.

Before you begin

Use cases

Did this help?

Setup

@wix/identity
Version 1.0.120
Published 1 week ago

To use the Recovery API, install the @wix/identity package using npm or Yarn:

Copy
npm install @wix/identity

or

Copy
yarn add @wix/identity

Then import { recovery } from @wix/identity:

Copy
import { recovery } from "@wix/identity";
Did this help?

Recovery Email: Sample Use Cases and Flows

This article shares some possible use cases your app could support, as well as a sample flow that could support each use case. This can be a helpful jumping-off point as you plan your app's implementation.

Send a recovery email to a member and redirect them back to your site's login page after they've reset their password

In this scenario, a member has forgotten their password, so you send a recovery email to them, allowing them to reset their password. After resetting their password, you redirect the member back to your login page.

  1. Add a form to your site or app that allows members to request to reset their password. This form must provide you with their email address.
  2. Call Query Members to check that a member exists with this email address.
  3. Call Send Recovery Email, specifying the member's email address and your login page as the redirect URL.
Did this help?

sendRecoveryEmail( )


Sends a member an email containing a customized link to a Wix-managed page where the member can reset the password for their account.

Method Declaration
Copy
function sendRecoveryEmail(
  email: string,
  options: SendRecoveryEmailOptions,
): Promise<void>;
Method Parameters
emailstringRequired

Email address associated with the account to recover.


optionsSendRecoveryEmailOptions
JavaScript
import { recovery } from "@wix/identity"; async function sendRecoveryEmail(email, options) { const response = await recovery.sendRecoveryEmail(email, options); }
Did this help?