Socket
Book a DemoInstallSign in
Socket

@auth0/auth0-acul-react

Package Overview
Dependencies
Maintainers
49
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@auth0/auth0-acul-react

The Auth0 ACUL React SDK enables you to build Advanced Customization for Universal Login with React hooks and components.

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
49
Created
Source

Auth0 ACUL React SDK

ACUL React SDK

NPM Version Downloads codecov License

📚 Documentation | 🚀 Getting Started | 💻 API Reference | 🪝 Hooks | Examples | 💬 Feedback

Developers using Auth0's Universal Login can use this React SDK to customize screens like login, signup, or reset password. It provides hooks, context, and utilities to build flexible, type-safe experiences that match your brand and deliver a seamless user experience.

📚 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.

🚀 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

npm install @auth0/auth0-acul-react

Peer dependency:

npm install react

Importing the SDK

The SDK supports partial imports for each screen, allowing you to include only the code you need for your specific use case. This helps keep your bundle size small and improves performance.

Also, you can use a root import to load all screens from a single bundle if your app requires it.

Partial Imports

Each screen has its own set of hooks and methods. You can import only what you need for the screen you're building.

The following example shows how to import and use SDK to build login-id screen.

import { 
  // Context hooks
  useUser,
  useTenant,
  useBranding,
  useClient,
  useOrganization,
  usePrompt,
  useScreen,
  useTenant,
  useTransaction,
  useUser,
  useUntrustedData,
  // Common hooks
  useErrors,
  useTexts,
  // Utility hooks
  useUsernameValidation,
  usePasswordValidation,
  useLoginIdentifiers,
  // Submit methods
  login,
  passkeyLogin,
  federatedLogin,
} from '@auth0/auth0-acul-react/login-id';

Root Imports

The SDK also supports a root import, which lets you load all screens from a single bundle. This is useful if your app dynamically renders different screens at runtime based on the current Auth0 flow, for example, when you want one unified build that can handle all possible screens.

However, root imports aren’t ideal for most projects since they can increase bundle size. If you only need specific screens, use partial imports instead for better performance.

import {
  // Common hooks
  useCurrentScreen,
  useAuth0Themes,
  useErrors,

  // Screen-specific hooks for multiple screens
  useLoginId,
  useSignupId,
  useResetPassword
} from '@auth0/auth0-acul-react';

Types / Interfaces

Typescript types and interfaces can be imported from @auth0/auth0-acul-react/types for type safety and better DX.

import type {
  Connection,
  CustomOptions,
  IdentifierType,
  Organizations,
  EnrolledDevice
  // ...other types
} from '@auth0/auth0-acul-react/types';

Refer to our API Reference for the full list of available types and interfaces.

💻 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

Hooks

Context Hooks (Available in all screens)

  • useUser() - Current user information
  • useTenant() - Tenant configuration
  • useClient() - Application client information
  • useScreen() - Current screen data and configuration
  • useTransaction() - Transaction state and methods
  • useBranding() - Tenant branding and theme
  • useOrganization() - Organization context (if applicable)
  • usePrompt() - Current authentication prompt
  • useUntrustedData() - Untrusted data from the authentication flow

Utility Hooks

Specialized hooks for form validation, polling, and identifier management:

Identifier Management

  • useLoginIdentifiers() - Get available login identifier types (email, phone, username)
  • useSignupIdentifiers() - Get available signup identifier types, each with its required status

Form Validation

  • usePasswordValidation(password, rules) - Real-time password strength validation
  • useUsernameValidation(username) - Username format and availability validation

MFA & Polling

  • useMfaPolling(options) - Manage MFA push notification polling lifecycle
  • useResend(options) - Handle resend operations with cooldown timers

Common Hooks

General-purpose hooks available across all screens:

Screen Management

  • useCurrentScreen() - Get complete current screen context data
  • useAuth0Themes() - Access tenant branding and theme configuration

Error Handling

  • useErrors(options) - Comprehensive error management with categorization
    • Filter by error kind: 'validation', 'auth0', 'configuration'
    • Filter by field name for form-specific errors
    • Dismiss individual or all errors

Screen-Specific Action Methods

Each screen module exports methods for screen actions:

// Login ID Screen
import {
  loginMethod,
  continueWithFederatedLogin
} from '@auth0/auth0-acul-react/login-id';

// Password Screen
import {
  loginMethod,
  forgotPasswordMethod
} from '@auth0/auth0-acul-react/login-password';

// MFA Push Challenge
import {
  continueMethod,
  resendPushNotification,
  useMfaPolling
} from '@auth0/auth0-acul-react/mfa-push-challenge-push';

Examples

💬 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.

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