> ## Documentation Index
> Fetch the complete documentation index at: https://docs-staging-quickstart-revamp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Learn about the ACUL Multi-Factor Authentication Phone screen classes

# Multi-Factor Authentication Phone screen classes

## MFA Phone Challenge screen class

The <Tooltip tip="Multi-factor authentication (MFA): User authentication process that uses a factor in addition to username and password such as a code via SMS." cta="View Glossary" href="/docs/glossary?term=MFA">MFA</Tooltip> Phone Challenge screen class provides methods associated with the mfa-phone-challenge screen. This screen is displayed when the user needs to receive a code to verity their identity.

<Frame>
  <img src="https://mintcdn.com/docs-staging-quickstart-revamp/TU1OUbCB6Vk1Wu6L/images/cdy7uua7fh8z/n4liCJdxEsE43xLVB5oEy/664d4afa0a2ede835f54aa622f893a04/Screenshot_2025-04-23_at_17.07.25.png?fit=max&auto=format&n=TU1OUbCB6Vk1Wu6L&q=85&s=6789c8be5c1c9f2e09a5d74173042a29" alt="" width="363" height="509" data-path="images/cdy7uua7fh8z/n4liCJdxEsE43xLVB5oEy/664d4afa0a2ede835f54aa622f893a04/Screenshot_2025-04-23_at_17.07.25.png" />
</Frame>

Import and instantiate the MFA Phone Challenge screen class:

```js lines
import MfaPhoneChallenge from '@auth0/auth0-acul-js/mfa-phone-challenge';
const mfaPhoneChallenge = new MfaPhoneChallenge();

// You can access screen data like the phone number
const phoneNumber = mfaPhoneChallenge.screen.data?.phoneNumber;
console.log('Phone number for challenge:', phoneNumber);

// Access transaction details like errors
const errors = mfaPhoneChallenge.transaction.errors;
if (errors) {
  console.error('Transaction errors:', errors);
}
```

### Properties

The MFA Phone Challenge screen class properties are:

<Tabs>
  <Tab title="branding">
    ```ts lines expandable
    interface branding {
      settings: null | BrandingSettings;
      themes: null | BrandingThemes;
    }

    interface BrandingSettings {
      colors?: {
        pageBackground?: string | {
          angleDeg: number;
          end: string;
          start: string;
          type: string;
        };
        primary?: string;
      };
      faviconUrl?: string;
      font?: {url: string;};
      logoUrl?: string;
    }

    interface BrandingThemes {
      default: {
        borders: Record<string, string | number | boolean>;
        colors: Record<string, string>;
        displayName: string;
        fonts: Record<string, string | boolean | object>;
        pageBackground: Record<string, string>;
        widget: Record<string, string | number>;
      };
    }
    ```
  </Tab>

  <Tab title="client">
    ```ts lines
    interface client {
      description: null | string;
      id: string;
      logoUrl: null | string;
      name: string;
      metadata: null | {[key: string]: string;};
    }
    ```
  </Tab>

  <Tab title="organization">
    ```ts lines
    interface organization {
      branding: null | {
        colors?: {
          pageBackground?: string;
          primary?: string;
        };
        logoUrl?: string;
      };
      displayName: null | string;
      id: null | string;
      metadata: null | {[key: string]: string;};
      name: null | string;
      usage: null | string;
    }
    ```
  </Tab>

  <Tab title="prompt">
    ```ts lines
    interface prompt{
      name: string;
    }
    ```
  </Tab>

  <Tab title="screen">
    ```ts lines
    interface screen {
      captcha: null | CaptchaContext;
      captchaImage: null | string;
      captchaProvider: null | string;
      captchaSiteKey: null | string;
      data: null | { phoneNumber: string;};
      isCaptchaAvailable: boolean;
      links: null | Record<string, string>;
      name: string;
      texts: null | Record<string, string>;
    }

    interface CaptchaContext {
      image?: string;
      provider: string;
      siteKey?: string;
    }
    ```
  </Tab>

  <Tab title="tenant">
    ```ts lines
    interface tenant {
      enabledFactors: null | string[];
      enabledLocales: null | string[];
      friendlyName: null | string;
      name: null | string;
    }
    ```
  </Tab>

  <Tab title="transaction">
    ```ts lines expandable
    interface transaction {
      alternateConnections: null | (Connection | EnterpriseConnection)[];
      connectionStrategy: null | string;
      countryCode: null | string;
      countryPrefix: null | string;
      currentConnection: null | Connection;
      errors: null | Error[];  
      hasErrors: boolean;
      locale: string;
      state: string;
    }

    interface Connection {
      metadata?: Record<string, string>;
      name: string;
      strategy: string;
    }

    interface EnterpriseConnection {
      metadata?: Record<string, string>;
      name: string;
      options: {
        displayName?: string;
        iconUrl?: string;
        showAsButton: boolean;
      };
      strategy: string;
    }
    ```
  </Tab>

  <Tab title="untrustedData">
    ```ts lines
    interface untrustedData {
      authorizationParams: null | {
        login_hint?: string;
        screen_hint?: string;
        ui_locales?: string;
        [key: `ext-${string}`]: string;
      };
      submittedFormData: null | {
        [key: string]:
            | string
            | number
            | boolean
            | undefined;
      };
    }
    ```
  </Tab>
</Tabs>

### Methods

The MFA Phone Challenge screen class methods are:

#### continue( options ?)

This method submits the user's choice of receiving the MFA code via SMS or voice call. It uses the phone number from the class screen property.

```javascript lines
const mfaPhoneChallenge = new MfaPhoneChallenge();

// Request code via SMS
await mfaPhoneChallenge.continue({ type: 'sms' });

// Request code via Voice Call
await mfaPhoneChallenge.continue({ type: 'voice' });
```

<table class="table">
  <thead>
    <tr>
      <th><strong>Parameter</strong>                 </th>
      <th><strong>Type</strong></th>
      <th><strong>Required</strong></th>
      <th><strong>Description</strong></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>type</code></td>
      <td>sms | voice</td>
      <td>Yes</td>
      <td>define the method to receive the verification code.</td>
    </tr>
  </tbody>
</table>

#### pickPhone( options ?)

This method redirects the user to a phone selection screen.

```javascript lines
const mfaPhoneChallenge = new MfaPhoneChallenge();
await mfaPhoneChallenge.pickPhone();
```

#### tryAnotherMethod( options ?)

This method redirects the user to the authenticator selection screen.

```javascript lines
const mfaPhoneChallenge = new MfaPhoneChallenge();
await mfaPhoneChallenge.tryAnotherMethod();
```

## MFA Phone Enrollment screen class

The Device Code Confirmation screen class provides methods associated with the mfa-phone-enrollment screen. This screen is displayed when a user needs to confirm the device code.

<Frame>
  <img src="https://mintcdn.com/docs-staging-quickstart-revamp/d9I4PO9-WombE4fE/images/cdy7uua7fh8z/3o4ohXUXfkVaaZy0992sgL/a84b54fa31fcbf2b0695c9ff08357887/Screenshot_2025-04-23_at_17.36.28.png?fit=max&auto=format&n=d9I4PO9-WombE4fE&q=85&s=903e7adf9875b1fd43e0c90fb68b8833" alt="" width="363" height="577" data-path="images/cdy7uua7fh8z/3o4ohXUXfkVaaZy0992sgL/a84b54fa31fcbf2b0695c9ff08357887/Screenshot_2025-04-23_at_17.36.28.png" />
</Frame>

Import and instantiate the MFA Phone Enrollment screen class:

```js lines
import MfaPhoneEnrollment from '@auth0/auth0-acul-js/mfa-phone-enrollment';
const mfaPhoneEnrollment = new MfaPhoneEnrollment();

// Call the continueEnrollment method with a phone number and type
mfaPhoneEnrollment.continueEnrollment({
    phone: "1234567890",
    type: "sms" // or "voice"
});
```

### Properties

The MFA Phone Enrollment screen class properties are:

<Tabs>
  <Tab title="branding">
    ```ts lines expandable
    interface branding {
      settings: null | BrandingSettings;
      themes: null | BrandingThemes;
    }

    interface BrandingSettings {
      colors?: {
        pageBackground?: string | {
          angleDeg: number;
          end: string;
          start: string;
          type: string;
        };
        primary?: string;
      };
      faviconUrl?: string;
      font?: {url: string;};
      logoUrl?: string;
    }

    interface BrandingThemes {
      default: {
        borders: Record<string, string | number | boolean>;
        colors: Record<string, string>;
        displayName: string;
        fonts: Record<string, string | boolean | object>;
        pageBackground: Record<string, string>;
        widget: Record<string, string | number>;
      };
    }
    ```
  </Tab>

  <Tab title="client">
    ```ts lines
    interface client {
      description: null | string;
      id: string;
      logoUrl: null | string;
      name: string;
      metadata: null | {[key: string]: string;};
    }
    ```
  </Tab>

  <Tab title="organization">
    ```ts lines
    interface organization {
      branding: null | {
        colors?: {
          pageBackground?: string;
          primary?: string;
        };
        logoUrl?: string;
      };
      displayName: null | string;
      id: null | string;
      metadata: null | {[key: string]: string;};
      name: null | string;
      usage: null | string;
    }
    ```
  </Tab>

  <Tab title="prompt">
    ```ts lines
    interface prompt{
      name: string;
    }
    ```
  </Tab>

  <Tab title="screen">
    ```ts lines expandable
    interface screen {
      captcha: null | CaptchaContext;
      captchaImage: null | string;
      captchaProvider: null | string;
      captchaSiteKey: null | string;
      data: null | Record<string,
          | string
          | boolean
          | PasskeyCreate
          | string[]
          | PhonePrefix[]>
          | Record<string, string[]>>;
      isCaptchaAvailable: boolean;
      links: null | Record<string, string>;
      name: string;
      texts: null | Record<string, string>;
    }

    interface CaptchaContext {
      image?: string;
      provider: string;
      siteKey?: string;
    }

    interface PhonePrefix {
      country: string;
      country_code: string;
      phone_prefix: string;
    }

    interface PasskeyCreate {
        public_key: {
            authenticatorSelection: {
                residentKey: string;
                userVerification: string;
            };
            challenge: string;
            pubKeyCredParams: [{ alg: number; type: string }];
            rp: { id: string; name: string };
            user: { displayName: string; id: string; name: string };
        };
    }
    ```
  </Tab>

  <Tab title="tenant">
    ```ts lines
    interface tenant {
      enabledFactors: null | string[];
      enabledLocales: null | string[];
      friendlyName: null | string;
      name: null | string;
    }
    ```
  </Tab>

  <Tab title="transaction">
    ```ts lines expandable
    interface transaction {
      alternateConnections: null | (Connection | EnterpriseConnection)[];
      connectionStrategy: null | string;
      countryCode: null | string;
      countryPrefix: null | string;
      currentConnection: null | Connection;
      errors: null | Error[];  
      hasErrors: boolean;
      locale: string;
      state: string;
    }

    interface Connection {
      metadata?: Record<string, string>;
      name: string;
      strategy: string;
    }

    interface EnterpriseConnection {
      metadata?: Record<string, string>;
      name: string;
      options: {
        displayName?: string;
        iconUrl?: string;
        showAsButton: boolean;
      };
      strategy: string;
    }
    ```
  </Tab>

  <Tab title="untrustedData">
    ```ts lines
    interface untrustedData {
      authorizationParams: null | {
        login_hint?: string;
        screen_hint?: string;
        ui_locales?: string;
        [key: `ext-${string}`]: string;
      };
      submittedFormData: null | {
        [key: string]:
            | string
            | number
            | boolean
            | undefined;
      };
    }
    ```
  </Tab>

  <Tab title="user">
    ```ts lines
    interface user {
      appMetadata: null | {[key: string]: string;};
      email: null | string;
      enrolledDevices: null | ShortEntity<"device">[];
      enrolledEmails: null | ShortEntity<"email">[];
      enrolledFactors: null | string[];
      enrolledPhoneNumbers: null | ShortEntity<"phoneNumber">[];
      id: null | string;
      organizations: null | {
        branding: undefined | {logoUrl: undefined | string;};
        displayName: undefined | string;
        organizationId: undefined | string;
        organizationName: undefined | string;
      }[];
      phoneNumber: null | string;
      picture: null | string;
      userMetadata: null | {[key: string]: string;};
      username: null | string;
    }

    ShortEntity<Key>: {
        id: number;
    } & Record<Key, string>
    ```
  </Tab>
</Tabs>

### Methods

The MFA Phone Enrollment screen class methods are:

#### continueEnrollment( options ?)

This method continues the enrollment process with the provided phone number and selected type SMS or voice.

```javascript lines
const mfaPhoneEnrollment = new MfaPhoneEnrollment();

// Call the continueEnrollment method with a phone number and type
mfaPhoneEnrollment.continueEnrollment({
  phone: "1234567890",
  type: "sms" // or "voice"
});
```

<table class="table">
  <thead>
    <tr>
      <th><strong>Parameter</strong>                 </th>
      <th><strong>Type</strong></th>
      <th><strong>Required</strong></th>
      <th><strong>Description</strong></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>phone</code></td>
      <td>string</td>
      <td>Yes</td>
      <td>The user's phone number.</td>
    </tr>

    <tr>
      <td><code>type</code></td>
      <td>sms | voice</td>
      <td>Yes</td>
      <td>define the method to receive the verification code.</td>
    </tr>
  </tbody>
</table>

#### pickCountryCode( options ?)

This method allows users to pick their country code.

```javascript lines
const mfaPhoneEnrollment = new MfaPhoneEnrollment();

// Call the pickCountryCode method
mfaPhoneEnrollment.pickCountryCode();
```

#### tryAnotherMethod( options ?)

This method asks users to try another MFA method.

```javascript lines
const mfaPhoneEnrollment = new MfaPhoneEnrollment();

// Call the tryAnotherMethod
mfaPhoneEnrollment.tryAnotherMethod();
```
