Universal Login SDK Documentation

Comprehensive documentation for all packages

πŸ“š Package Documentation

Browse individual package documentation

ACUL SDK

NPM Version - JS SDK NPM Version - React SDK Downloads - JS SDK Downloads - React SDK codecov License Ask DeepWiki

πŸ“š Documentation - πŸš€ Getting Started - πŸ’» API Reference - πŸ’¬ Feedback

The Auth0 ACUL SDKs enable you to work with Advanced Customization for Universal Login.

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

[!CAUTION]

This feature is still in Early Access.

SDKs

Documentation

ACUL Overview

ACUL Overview

Getting started

Prerequisites

Before starting, ensure that you have the following setup:

  1. Custom Domain: Ensure that a custom domain is configured for your Auth0 tenant.
  2. 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 SDKs via npm:

For vanilla JavaScript/TypeScript projects:

npm install @auth0/auth0-acul-js

For React projects:

npm install @auth0/auth0-acul-react

Note: The React SDK requires React 18.3.1 or higher as a peer dependency.

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

Importing Screens

For JavaScript/TypeScript:

// 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'; 

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: <USERNAME_FIELD_VALUE>
  });

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.continueWithFederatedLogin({
  connection: selectedConnection.name,
})

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

Refer @auth0-acul-js API reference

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.

Legal

Early Access. This SDK and its associated product are made available only in Early Access (β€œEA”) format and are governed by the Free Trial terms of the Okta Master Subscription Agreement. If Okta elects to make a version of this SDK and its associated product Generally Available (β€œGA”), such GA version may have different pricing, product and feature configurations, and use of the GA product and SDK will be subject to the standard terms of the Agreement (or other such titled written or electronic agreement addressing the same subject matter) between Okta and Customer."


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.