@auth0/auth0-acul-react
v1.1.0
Published
The Auth0 ACUL React SDK enables you to build Advanced Customization for Universal Login with React hooks and components.
Downloads
1,603
Maintainers
Keywords
Readme
Auth0 ACUL React SDK

📚 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-reactPeer dependency:
npm install reactImporting 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. | Prompt | Screen Name | Documentation Link | |--------|--------------------|-------------------|--------------------------------------------------------------------------------------------| | 1 | login | login | Link | | 2 | login-id | login-id | Link | | 3 | login-password | login-password | Link | | 4 | signup-id | signup-id | Link | | 5 | signup-password | signup-password | Link |
| No. | Prompt | Screen Name | Documentation Link | |--------|--------------------------------|-------------------------------------------|-------------------------------------------------------------------------------------------------------| | 6 | login-passwordless | login-passwordless-email-code | Link | | 7 | login-passwordless | login-passwordless-sms-otp | Link | | 8 | passkeys | passkey-enrollment | Link | | 9 | passkeys | passkey-enrollment-local | Link | | 10 | phone-identifier-enrollment | phone-identifier-enrollment | Link | | 11 | phone-identifier-challenge | phone-identifier-challenge | Link | | 12 | email-identifier-challenge | email-identifier-challenge | Link | | 13 | captcha | interstitial-captcha | Link | | 14 | reset-password | reset-password-email | Link | | 15 | reset-password | reset-password-request | Link | | 16 | reset-password | reset-password | Link | | 17 | reset-password | reset-password-error | Link | | 18 | reset-password | reset-password-success | Link | | 19 | signup | signup | Link | | 20 | mfa | mfa-detect-browser-capabilities | Link | | 21 | mfa | mfa-enroll-result | Link | | 22 | mfa | mfa-begin-enroll-options | Link | | 23 | mfa | mfa-login-options | Link | | 24 | mfa-push | mfa-push-enrollment-qr | Link | | 25 | mfa-push | mfa-push-welcome | Link | | 26 | mfa-push | mfa-push-challenge-push | Link | | 27 | mfa-push | mfa-push-list | Link | | 28 | mfa-sms | mfa-country-codes | Link | | 29 | mfa-sms | mfa-sms-challenge | Link | | 30 | mfa-sms | mfa-sms-enrollment | Link | | 31 | mfa-sms | mfa-sms-list | Link | | 32 | mfa-email | mfa-email-challenge | Link | | 33 | mfa-email | mfa-email-list | Link | | 34 | invitatino | accept-invitation | Link | | 35 | organizations | organization-picker | Link | | 36 | organizations | organization-selection | Link | | 37 | reset-password | mfa-otp-challenge | Link | | 38 | mfa-otp | mfa-otp-enrollment-code | Link | | 39 | mfa-otp | mfa-otp-enrollment-qr | Link | | 40 | reset-password | reset-password-mfa-email-challenge | Link | | 41 | reset-password | reset-password-mfa-push-challenge-push | Link| | 42 | reset-password | mfa-sms-challenge | Link | | 43 | reset-password | reset-password-mfa-otp-challenge | Link | | 44 | mfa-phone | mfa-phone-enrollment | Link | | 45 | mfa-voice | mfa-voice-enrollment | Link | | 46 | mfa-recovery-code | mfa-recovery-code-challenge | Link | | 47 | device-flow | device-code-activation-allowed | Link | | 48 | device-flow | device-code-activation-denied | Link | | 49 | device-flow | device-code-activation | Link | | 50 | reset-password | reset-password-mfa-recovery-code-challenge | Link | | 51 | reset-password | reset-password-mfa-voice | Link | | 52 | common | redeem-ticket | Link | | 53 | device-flow | device-code-confirmation | Link | | 54 | mfa-phone | mfa-phone-challenge | Link | | 55 | mfa-voice | mfa-voice-challenge | Link | | 56 | mfa-recovery-code | mfa-recovery-code-enrollment | Link | | 57 | reset-password | reset-password-mfa-phone-challenge | Link | | 58 | mfa-recovery-code | mfa-recovery-code-challenge-new-code | Link | | 59 | logout | logout | Link | | 60 | logout | logout-aborted | Link | | 61 | logout | logout-complete | Link | | 62 | email-verification | email-verification-result | Link | | 63 | login-email-verification | login-email-verification | Link | | 64 |mfa-webauthn | mfa-webauthn-platform-enrollment | Link | | 65 |mfa-webauthn | mfa-webauthn-error | Link | | 66 |mfa-webauthn | mfa-webauthn-roaming-enrollment | Link | | 67 |mfa-webauthn | mfa-webauthn-roaming-challenge | Link | | 68 |mfa-webauthn | mfa-webauthn-platform-challenge | Link | | 69 |mfa-webauthn | mfa-webauthn-enrollment-success | Link | | 70 |mfa-webauthn | mfa-webauthn-change-key-nickname | Link | | 71 |mfa-webauthn | mfa-webauthn-not-available-error | Link | | 72 |reset-password | reset-password-mfa-webauthn-platform-challenge | Link | | 73 |reset-password | reset-password-mfa-webauthn-roaming-challenge | Link | | 74 |consent | consent | Link | | 75 |customized-consent | customized-consent | Link | | 76 |email-otp-challenge | email-otp-challenge | Link |
Hooks
Context Hooks (Available in all screens)
useUser()- Current user informationuseTenant()- Tenant configurationuseClient()- Application client informationuseScreen()- Current screen data and configurationuseTransaction()- Transaction state and methodsuseBranding()- Tenant branding and themeuseOrganization()- Organization context (if applicable)usePrompt()- Current authentication promptuseUntrustedData()- 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 itsrequiredstatus
Form Validation
usePasswordValidation(password, rules)- Real-time password strength validationuseUsernameValidation(username)- Username format and availability validation
MFA & Polling
useMfaPolling(options)- Manage MFA push notification polling lifecycleuseResend(options)- Handle resend operations with cooldown timers
Common Hooks
General-purpose hooks available across all screens:
Screen Management
useCurrentScreen()- Get complete current screen context datauseAuth0Themes()- 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
- Filter by error kind:
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
- React Examples - Complete React component examples
- React Boilerplate - Full React application template
💬 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.
