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

# LoginPasswordlessSmsOtp

> Describes all the properties and methods available to customize the Universal Login `login-passwordless-sms-otp` screen.

The LoginPasswordlessSmsOtp class implements the `login-passwordless-sms-otp` screen functionality. This screen collects the user's phone number and code.

![](https://mintlify.s3.us-west-1.amazonaws.com/docs-dev/images/cdy7uua7fh8z/7CNCkaU1uPRbEUsAyqlj8u/8461823cf224471d19656e4dd9027a87/Screenshot_2025-04-24_at_11.31.00.png)

## Constructors

Create an instance of LoginPasswordlessSmsOtp screen manager:

```typescript Example theme={null}
import LoginPasswordlessSmsOtp from '@auth0/auth0-acul-js/login-passwordless-sms-otp';
const loginPasswordlessSmsOtpManager = new LoginPasswordlessSmsOtp();
loginPasswordlessSmsOtpManager.submitOTP({
  code: '123456',
});
```

## Properties

**branding** `[BrandingMembers](/docs/libraries/acul/js-sdk/Screens/interfaces/BrandingMembers)`

Provides branding-related configurations, such as branding theme and settings.

**client** `[ClientMembers](/docs/libraries/acul/js-sdk/Screens/interfaces/ClientMembers)`

Provides client-related configurations, such as `id`, `name`, and `logoUrl`, for the `login-passwordless-sms-otp` screen.

**countryCodes** `[CountryCodesMembers](/docs/libraries/acul/js-sdk/Screens/interfaces/CountryCodesMembers)`

Provides country code data for phone number entry, such as `available` and `recommended`, for the `login-passwordless-sms-otp` screen.

**experiment** `[ExperimentMembers](/docs/libraries/acul/js-sdk/Screens/interfaces/ExperimentMembers)`

The active [Experiment Center](/docs/docs/customize/experiment-center) experiment for this screen, or `null` when no experiment is active (or the screen has not opted in via `context_configuration`).

**organization** `[OrganizationMembers](/docs/libraries/acul/js-sdk/Screens/interfaces/OrganizationMembers)`

Provides information about the user's Organization, such as `id` and `name`.

**prompt** `[PromptMembers](/docs/libraries/acul/js-sdk/Screens/interfaces/PromptMembers)`

Contains data about the current prompt in the authentication flow.

**screen** `[ScreenMembersOnLoginPasswordlessSmsOtp](/docs/libraries/acul/js-sdk/Screens/interfaces/ScreenMembersOnLoginPasswordlessSmsOtp)`

Contains details specific to the `login-passwordless-sms-otp` screen, including its configuration and context.

**tenant** `[TenantMembers](/docs/libraries/acul/js-sdk/Screens/interfaces/TenantMembers)`

Contains data related to the tenant, such as `id` and associated metadata.

**transaction** `[TransactionMembersOnLoginPasswordlessSmsOtp](/docs/libraries/acul/js-sdk/Screens/interfaces/TransactionMembersOnLoginPasswordlessSmsOtp)`

Provides transaction-specific data for the `login-passwordless-sms-otp` screen, such as active identifiers and flow states.

**untrustedData** `[UntrustedDataMembers](/docs/libraries/acul/js-sdk/Screens/interfaces/UntrustedDataMembers)`

Handles untrusted data passed to the SDK, such as user input during login.

**user** `[UserMembers](/docs/libraries/acul/js-sdk/Screens/interfaces/UserMembers)`

Details of the active user, including `username`, `email`, and `roles`.

## Methods

**changeLanguage** `Promise\<void\>`

This method changes the display language of the Universal Login page.

```typescript Example theme={null}
import LoginPasswordlessSmsOtp from '@auth0/auth0-acul-js/login-passwordless-sms-otp';
const loginPasswordlessSmsOtpManager = new LoginPasswordlessSmsOtp();
loginPasswordlessSmsOtpManager.changeLanguage({
  language: 'fr',
});
```

**Method Parameters**

**Parameters**

**options**

[LanguageChangeOptions](/docs/docs/libraries/acul/js-sdk/Screens/interfaces/LanguageChangeOptions).

**language** `string` *required*

The locale code for the desired language (for example, `'en'`, `'fr'`, `'es'`).

**persist?** `"session"`

When set to `'session'`, the selected language persists for the duration of the session.

**getErrors** `[Error](/docs/libraries/acul/js-sdk/Screens/interfaces/Error)[]`

This method retrieves the array of transaction errors from the context, or an empty array if none exist. An array of error objects from the transaction context.

**resendManager** `[ResendControl](/docs/libraries/acul/js-sdk/Screens/interfaces/ResendControl)`

Returns a [`ResendControl`](/docs/docs/libraries/acul/js-sdk/Screens/interfaces/ResendControl) object that manages resending with a cooldown. The `startResend()` method of the object triggers the resend and starts a cooldown period before the user can resend again. The countdown persists across the page reload that a resend causes.

```typescript Example theme={null}
import LoginPasswordlessSmsOtp from '@auth0/auth0-acul-js/login-passwordless-sms-otp';

const loginPasswordlessSmsOtpManager = new LoginPasswordlessSmsOtp();
const { startResend } = loginPasswordlessSmsOtpManager.resendManager({
  timeoutSeconds: 15,
  onStatusChange: (remainingSeconds, isDisabled) => {
    console.log(`Resend available in ${remainingSeconds}s, disabled: ${isDisabled}`);
  },
  onTimeout: () => {
    console.log('Resend is now available');
  }
});

// Call startResend when user clicks resend button
startResend();
```

**Method Parameters**

**Parameters**

**options**

[StartResendOptions](/docs/docs/libraries/acul/js-sdk/Screens/interfaces/StartResendOptions).

**timeoutSeconds?** `number`

The cooldown duration in seconds before the user can resend the code again.

**onStatusChange?** `[OnStatusChangeCallback](/docs/libraries/acul/js-sdk/Screens/type-aliases/OnStatusChangeCallback)`

Callback invoked whenever the resend status changes, it returns the remaining seconds and if the resend functionality is currently disabled.

**onTimeout?** `() =\> void`

Callback invoked when the cooldown expires and resend becomes available again.

**resendOTP** `Promise\<void\>`

Resends the one-time password (OTP) to the user's phone number.

This method submits a form to Auth0. Auth0 renders this screen again. If a captcha is required, Auth0 sends the user back to the `login-id` screen instead, or to the `signup-id` screen if the user started from signup. In both cases, the browser loads a new page and the JavaScript context, including component state and timers, is lost.

When you call `resendOTP()`, keep the following in mind:

* Code that runs after `await resendOTP()` can't rely on state that the code sets, such as a "code sent" message or a countdown.
* If Auth0 can't send the SMS, for example because of a rate limit, Auth0 renders this screen again without an error. Only extensibility errors, such as an error from an Action, and unexpected failures appear in `transaction.errors` after the page reloads. The returned promise doesn't reject.
* The returned promise resolves when the form is submitted, before the new page loads. The promise doesn't confirm that Auth0 sent a new code.

To add a cooldown between resends, use `resendManager()`. The `resendManager()` method stores the countdown in `localStorage`, so the countdown persists across the page reload.

```typescript Example theme={null}
import LoginPasswordlessSmsOtp from '@auth0/auth0-acul-js/login-passwordless-sms-otp';
const loginPasswordlessSmsOtpManager = new LoginPasswordlessSmsOtp();
loginPasswordlessSmsOtpManager.resendOTP();
```

**submitOTP** `Promise\<void\>`

This method continues the login process using the OTP code.

```typescript Example theme={null}
import LoginPasswordlessSmsOtp from '@auth0/auth0-acul-js/login-passwordless-sms-otp';
const loginPasswordlessSmsOtpManager = new LoginPasswordlessSmsOtp();
loginPasswordlessSmsOtpManager.submitOTP({
  code: '123456',
});
```

**Method Parameters**

**Parameters**

**options**

[SubmitOTPOptions](/docs/docs/libraries/acul/js-sdk/Screens/interfaces/SubmitOTPOptions).

**code** `string` *required*

The code entered by the user.

**captcha?** `string`

The captcha code or response from the captcha provider. This property is required if your Auth0 tenant has [Bot Detection](/docs/docs/secure/attack-protection/bot-detection) enabled.

**username?** `string`

The user's identifier.

**switchConnection** `Promise\<void\>`

This method switches between a database connection (password) and a passwordless connection (Email/SMS OTP).

```typescript Example theme={null}
import LoginPasswordlessSmsOtp from '@auth0/auth0-acul-js/login-passwordless-sms-otp';
const loginPasswordlessSmsOtpManager = new LoginPasswordlessSmsOtp();
loginPasswordlessSmsOtpManager.switchConnection({
  connection: 'sms',
});
```

**Method Parameters**

**Parameters**

**options**

[SwitchConnectionOptionsSmsOtp](/docs/docs/libraries/acul/js-sdk/Screens/interfaces/SwitchConnectionOptionsSmsOtp).

**connection** `string` *required*

The connection name to switch to. Use `'email'` or `'sms'` for passwordless, or a DB connection name for password-based authentication.
