> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magic.link/llms.txt
> Use this file to discover all available pages before exploring further.

# Account Recovery

export const StartupPlanCallout = () => {
  return <Card title="Paid Feature" icon="circle-exclamation">
      <div className="flex flex-1 justify-between items-center">
        <span>
          This feature requires a subscription to Startup or Growth plan.
        </span>
        <div className="not-prose group">
          <a href="https://magic.link/pricing#features">
            <button className="rounded-[10px] flex items-center space-x-2.5 py-1 px-4 bg-primary-dark dark:bg-white text-white dark:text-gray-950 group-hover:opacity-[0.9] font-medium">
              <span>View pricing</span>
            </button>
          </a>
        </div>
      </div>
    </Card>;
};

<StartupPlanCallout />

## Overview

This feature requires two prerequisites:

1. The primary login factor is an email (this includes `loginWithMagicLink` and `loginWithEmailOTP` implementations)

2. The user can prove ownership of a phone number, which will be used as the recovery factor

### Compatibility

Account recovery methods are available on the following client-side SDKs:

* [Web](/embedded-wallets/sdk/client-side/javascript)
* [React Native](/embedded-wallets/sdk/client-side/react-native)
* [iOS](/embedded-wallets/sdk/client-side/ios)
* [Android](/embedded-wallets/sdk/client-side/android)

## Usage

## Enabling Account Recovery

<Frame>
  <img src="https://mintcdn.com/magic-newton/1GYf0YW8BthDpWqo/images/01_enable-recovery-method.webp?fit=max&auto=format&n=1GYf0YW8BthDpWqo&q=85&s=03eae5ba3a077ef45714dffef76cd291" alt="enable-recovery-method" width="1200" height="414" data-path="images/01_enable-recovery-method.webp" />
</Frame>

To enable SMS recovery for your users:

```javascript JavaScript icon="square-js" theme={null}
⁠magic.user.showSettings();
```

This will display a settings modal where users will be able to add a recovery factor.

Additionally, Magic supports a deep linking flow where you can send users straight to adding a recovery factor. [The flow can also be whitelabeled](/embedded-wallets/sdk/client-side/javascript#show-settings-show-ui-false-page-recovery):

```javascript JavaScript icon="square-js" theme={null}
magic.user.showSettings({ page: 'recovery'  });
```

## Recover Account

<Frame>
  <img src="https://mintcdn.com/magic-newton/X-Lz5AClFE2F1XC6/images/00_use-recovery-method.webp?fit=max&auto=format&n=X-Lz5AClFE2F1XC6&q=85&s=9c2c99713b4a6efe389fe04c203e5338" alt="use-recovery-method" width="2400" height="828" data-path="images/00_use-recovery-method.webp" />
</Frame>

Once a recovery factor is a set up, a user can recover their account. To enable this, the developer should call the following:

```javascript JavaScript icon="square-js" theme={null}
magic.user.recoverAccount({ email: email })
```

<Note>
  It’s important to note that updating the recovery factor is a security sensitive operation so users will first be prompted to demonstrate account ownership by authenticating their email via a one-time-passcode before they are able to add a recovery phone number.
</Note>
