Skip to main content
The DeviceCodeActivation class implements the device-code-activation screen functionality. This screen is displayed when the user needs to enter the code shown on their device to activate it.

Constructors

Create an instance of DeviceCodeActivation screen manager
Example
import DeviceCodeActivation from '@auth0/auth0-acul-js/device-code-activation';
const deviceCodeActivationManager = new DeviceCodeActivation();
async function activateDeviceCode(code) {
  try {
   await deviceCodeActivationManager.continue({ code });
   console.log('Device code activation successful.');
  } catch (error) {
   console.error('Error during device code activation:', error);
  }
}

Properties

Provides branding-related configurations, such as branding theme and settings.
Provides client-related configurations, such as id, name, and logoUrl, for the device-code-activation screen.
Provides information about the user’s organization, such as organization id and name.
Contains data about the current prompt in the authentication flow.
Contains details specific to the device-code-activation screen, including its configuration and context.
Contains data related to the tenant, such as id and associated metadata.
Provides transaction-specific data for the device-code-activation screen, such as active identifiers and flow states.
Handles untrusted data passed to the SDK, such as user input during the device code activation flow.
Details of the active user, including username, email, and roles.

Methods

continue
(options ?)
This method submits the device code entered by the user to complete the activation.
Example
import DeviceCodeActivation from '@auth0/auth0-acul-js/device-code-activation';
const deviceCodeActivationManager = new DeviceCodeActivation();
async function activateDeviceCode(code) {
  try {
   await deviceCodeActivationManager.continue({ code });
   console.log('Device code activation successful.');
  } catch (error) {
   console.error('Error during device code activation:', error);
  }
}
options
OPTIONAL
Optional payload.
getErrors
This method retrieves the array of transaction errors from the context, or an empty array if none exist.