Socket
Book a DemoInstallSign in
Socket

@auth0/auth0-acul-js

Package Overview
Dependencies
Maintainers
49
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@auth0/auth0-acul-js

The Auth0 ACUL JS SDK enables you to work with Advanced Customization for Universal Login.

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
6.1K
-27.47%
Maintainers
49
Weekly downloads
ย 
Created
Source

Auth0 ACUL JS SDK

ACUL JS SDK

NPM Version Downloads codecov License

๐Ÿ“š Documentation - ๐Ÿš€ Getting Started - ๐Ÿ’ป API Reference - Helper Functions - ๐Ÿ’ฌ Feedback

The Auth0 ACUL JS SDK enables you to work with Advanced Customization for Universal Login.

It simplifies integrating authentication screens (login, signup, passwordless, passkey enrollment, etc.) into your web applications, providing the necessary tools for seamless implementation.

๐Ÿ“š Documentation

  • Quickstart - our guide for setting up the SDK on your app.
  • Guides - more guides for common use cases
  • Examples - code snippets for different customization use cases.
  • FAQs - Find answers to frequently asked questions about the Auth0 ACUL JS SDK.

๐Ÿš€ Getting started

Prerequisites

Before starting, ensure that you have the following setup:

  • Custom Domain: Ensure that a custom domain is configured for your Auth0 tenant.
  • Screen Configuration: Set up the required authentication screens within your Auth0 flow.
    For detailed steps, refer to the Configure ACUL Screens.

Installation

You can easily install the SDK via npm:

npm install @auth0/auth0-acul-js

After installing the SDK, you can import the relevant screen module, which you want to configure

Importing Screens

// Default import of any particular screen, eg: login-id screen
import  LoginId  from '@auth0/auth0-acul-js/login-id'; 

// Named import of any screen
import  { LoginId }  from '@auth0/auth0-acul-js'; 

// Default import of all screens
import  * as Screens  from '@auth0/auth0-acul-js'; 

Note: For more details on import paths for all screens, refer to the FAQ's.

๐Ÿ‘จโ€๐Ÿ’ป Usage

Adding Functionality to Your Screens

Letโ€™s look at an example for adding logic to the login-id screen.

Example: Add Logic to Login Button

  import  LoginId  from '@auth0/auth0-acul-js/login-id';

  const loginIdManager = new LoginId();

  // Trigger the login method on button click
  loginIdManager.login({
    username: "testUser"
  });

Get List of Mandatory Fields for Login

const { transaction } = loginIdManager
const requiredFields = transaction.getActiveIdentifiers();

Integrating Social Connections for Login

To allow users to login via social connections (e.g., Google, Facebook), use the following snippet

import  LoginId  from "@auth0/auth0-acul-js/login-id";
const loginIdManager = new LoginId();

// Check if alternateConnections is available and has at least one item
if (!loginIdManager.transaction.alternateConnections) {
  console.error('No alternate connections available.');
}

// Select the first available connection (users can select any available connection)
const selectedConnection = alternateConnections[0];

// Log the chosen connection for debugging or informational purposes
console.log(`Selected connection: ${selectedConnection.name}`);

// Proceed with social login using the selected connection
loginIdManager.socialLogin({
  connection: selectedConnection.name,
})

Error handling for Login

A top-level getter function, getErrors, can be used to retrieve detailed authentication errors when backend validation fails.

import Login from "@auth0/auth0-acul-js/login";

const loginIdManager = new Login();

const errors = loginIdManager.getErrors();
if (errors) {
  console.error("Login failed:", errors);
}

Same can also be achieved using the transaction.errors available directly on the screen context for each screen.

import Login from "@auth0/auth0-acul-js/login";

const loginIdManager = new Login();

const errors = loginIdManager.transaction?.errors ?? [];
if (errors) {
  console.error("Login failed:", errors);
}

For more examples, visit our examples

Quick Start with Boilerplate App

Get up and running quickly with our boilerplate starter template: Link

๐Ÿ’ป API reference

Screens

No.PromptScreen NameDocumentation Link
1loginloginLink
2login-idlogin-idLink
3login-passwordlogin-passwordLink
4signup-idsignup-idLink
5signup-passwordsignup-passwordLink
Explore more Screens...
No.PromptScreen NameDocumentation Link
6login-passwordlesslogin-passwordless-email-codeLink
7login-passwordlesslogin-passwordless-sms-otpLink
8passkeyspasskey-enrollmentLink
9passkeyspasskey-enrollment-localLink
10phone-identifier-enrollmentphone-identifier-enrollmentLink
11phone-identifier-challengephone-identifier-challengeLink
12email-identifier-challengeemail-identifier-challengeLink
13captchainterstitial-captchaLink
14reset-passwordreset-password-emailLink
15reset-passwordreset-password-requestLink
16reset-passwordreset-passwordLink
17reset-passwordreset-password-errorLink
18reset-passwordreset-password-successLink
19signupsignupLink
20mfamfa-detect-browser-capabilitiesLink
21mfamfa-enroll-resultLink
22mfamfa-begin-enroll-optionsLink
23mfamfa-login-optionsLink
24mfa-pushmfa-push-enrollment-qrLink
25mfa-pushmfa-push-welcomeLink
26mfa-pushmfa-push-challenge-pushLink
27mfa-pushmfa-push-listLink
28mfa-smsmfa-country-codesLink
29mfa-smsmfa-sms-challengeLink
30mfa-smsmfa-sms-enrollmentLink
31mfa-smsmfa-sms-listLink
32mfa-emailmfa-email-challengeLink
33mfa-emailmfa-email-listLink
34invitatinoaccept-invitationLink
35organizationsorganization-pickerLink
36organizationsorganization-selectionLink
37reset-passwordmfa-otp-challengeLink
38mfa-otpmfa-otp-enrollment-codeLink
39mfa-otpmfa-otp-enrollment-qrLink
40reset-passwordreset-password-mfa-email-challengeLink
41reset-passwordreset-password-mfa-push-challenge-pushLink
42reset-passwordmfa-sms-challengeLink
43reset-passwordreset-password-mfa-otp-challengeLink
44mfa-phonemfa-phone-enrollmentLink
45mfa-voicemfa-voice-enrollmentLink
46mfa-recovery-codemfa-recovery-code-challengeLink
47device-flowdevice-code-activation-allowedLink
48device-flowdevice-code-activation-deniedLink
49device-flowdevice-code-activationLink
50reset-passwordreset-password-mfa-recovery-code-challengeLink
51reset-passwordreset-password-mfa-voiceLink
52commonredeem-ticketLink
53device-flowdevice-code-confirmationLink
54mfa-phonemfa-phone-challengeLink
55mfa-voicemfa-voice-challengeLink
56mfa-recovery-codemfa-recovery-code-enrollmentLink
57reset-passwordreset-password-mfa-phone-challengeLink
58mfa-recovery-codemfa-recovery-code-challenge-new-codeLink
59logoutlogoutLink
60logoutlogout-abortedLink
61logoutlogout-completeLink
62email-verificationemail-verification-resultLink
63login-email-verificationlogin-email-verificationLink
64mfa-webauthnmfa-webauthn-platform-enrollmentLink
65mfa-webauthnmfa-webauthn-errorLink
66mfa-webauthnmfa-webauthn-roaming-enrollmentLink
67mfa-webauthnmfa-webauthn-roaming-challengeLink
68mfa-webauthnmfa-webauthn-platform-challengeLink
69mfa-webauthnmfa-webauthn-enrollment-successLink
70mfa-webauthnmfa-webauthn-change-key-nicknameLink
71mfa-webauthnmfa-webauthn-not-available-errorLink
72reset-passwordreset-password-mfa-webauthn-platform-challengeLink
73reset-passwordreset-password-mfa-webauthn-roaming-challengeLink
74consentconsentLink
75customized-consentcustomized-consentLink
76email-otp-challengeemail-otp-challengeLink

Helper Functions

This section documents the helper methods and properties exposed by the screen instance in auth0-acul-js.

Context properties

  • user- Current user/profile data for the active transaction.

  • tenant- Tenant configuration and metadata (domain, region, settings).

  • branding- Branding/theme config (colors, logos, fonts, visual tokens).

  • client- Application client metadata and settings.

  • organization- Organization context when applicable.

  • prompt- Current prompt / flow configuration.

  • untrustedData- Untrusted inputs (URL params, prefilled form values).

  • screen- Current screen metadata and configuration.

  • transaction- Transaction / flow state, session identifiers and related data.

Identifier management

  • getLoginIdentifiers(): Get available login identifier types (email, phone, username)

  • getSignupIdentifiers(): Get available signup identifier types, each with its required status

Form validation

  • validatePassword(password: string): Real-time password strength validation
  • validateUsername(username: string): Username format and availability validation

MFA / Push polling & resend

  • pollingManager(): Starts and manages polling for an MFA push challenge.

  • resendManager() Gets resend functionality with timeout management for this screen.

Common helpers

  • getCurrentScreen()
    Return the current screen context data.

  • getCurrentThemeOptions() Gets the current theme options with flattened configuration from branding context.

  • getErrors() Gets the current errors from the transaction context

๐Ÿ’ฌ Feedback

Contributing

We appreciate feedback and contribution to this repo! Before you get started, please see the following:

Raise an issue

To provide feedback or report a bug, please raise an issue on our issue tracker.

Vulnerability Reporting

Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.

Auth0 Logo

Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout Why Auth0?

This project is licensed under the MIT license. See the LICENSE file for more info.

Keywords

auth0

FAQs

Package last updated on 09 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts