The Email OTP Challenge screen class provides methods associated with the email-otp-challenge screen.
Import and instantiate the Email OTP Challenge screen class:
import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge';
const emailOTPChallenge = new EmailOTPChallenge();

Properties

The Email OTP Challenge screen class properties are:
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>;
  };
}

Methods

The Email OTP Challenge screen class methods are:

getError( options? )

This method retrieves the array of transaction errors from context or an empty array if none exist.
import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge';
    const emailOTPChallengeManager = new EmailOTPChallenge();
    await emailOTPChallengeManager.getError();

resendCode( options ?)

This method requests a new OTP code to be sent to the user’s email.
import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge';

const emailOTPChallenge = new EmailOTPChallenge();
emailOTPChallenge.resendCode();
Parameter                 TypeRequiredDescription
[key: string]string | number | boolean | undefinedNoOptional data collected from user.

submitCode( options ?)

This method submits the OTP code entered by the user.
import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge';

const emailOTPChallenge = new EmailOTPChallenge();
emailOTPChallenge.submitCode({
  code: '123456',
});
Parameter                 TypeRequiredDescription
codestringYesThe code entered by the user.
[key: string]string | number | boolean | undefinedNoOptional data collected from user.