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:
To use the Recovery API, install the @wix/identity
package using npm or Yarn:
npm install @wix/identity
or
yarn add @wix/identity
Then import { recovery }
from @wix/identity
:
import { recovery } from "@wix/identity";
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.
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.
Sends a member an email containing a customized link to a Wix-managed page where the member can reset the password for their account.
function sendRecoveryEmail(
email: string,
options: SendRecoveryEmailOptions,
): Promise<void>;
Email address associated with the account to recover.
import { recovery } from "@wix/identity";
async function sendRecoveryEmail(email, options) {
const response = await recovery.sendRecoveryEmail(email, options);
}