> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# LoginId

> Describes all the hooks and methods available to customize the Universal Login `login-id` screen.

The `login-id` screen collects the user's identifier as the first step of an identifier-first authentication flow. Depending on your tenant, this identifier can be an email, phone number, or username. It also supports passkey login, federated identity providers, and Google One Tap.

![](https://mintlify.s3.us-west-1.amazonaws.com/docs-dev/images/cdy7uua7fh8z/1nvMFmxC5ODCW2q7cByHv8/657d87ba1c2eb11316e6b0ef93737c99/LoginIDACUL.png)

## Import

Each screen has its own set of hooks and methods. The SDK supports **partial import** and **root import** for each screen.

* Using partial import allows you to include only the code you need for your specific use case.
* Using root import allows you to load all screens from a single bundle, which is useful when you want a unified build to handle all possible screens.

```jsx Import Example theme={null}
// root import
import { useLoginId } from '@auth0/auth0-acul-react';

// partial import
import {
  useLoginId,
  // Context hooks
  useUser,
  useTenant,
  useBranding,
  useClient,
  useCountryCodes,
  useOrganization,
  usePrompt,
  useScreen,
  useTransaction,
  useUntrustedData,
  useExperiment,
  // Common hooks
  useCurrentScreen,
  useAuth0Themes,
  useErrors,
  // Utility hooks
  useLoginIdentifiers,
  useChangeLanguage,
  usePasskeyAutofill,
  // Methods
  login,
  federatedLogin,
  googleOneTap,
  passkeyLogin,
  pickCountryCode,
} from '@auth0/auth0-acul-react/login-id';

function LoginIdForm() {
  const { login } = useLoginId();
  return (
    <button onClick={() => login({ username: 'user@example.com' })}>
      Continue
    </button>
  );
}
```

## Context Hooks

Screen-scoped hooks that provide read-only access to Auth0 context data on the `login-id` screen. Import them from `@auth0/auth0-acul-react/login-id`.

**useBranding** `() => [BrandingMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/BrandingMembers)`

This hook provides branding configurations, such as logo, colors, and theme settings displayed on the `login-id` screen.

```jsx Example theme={null}
import { useBranding } from '@auth0/auth0-acul-react/login-id';
function CustomTheme() {
  const branding = useBranding();
}
```

**useClient** `() => [ClientMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/ClientMembers)`

This hook provides client-related configurations, such as `id`, `name`, and `logoUrl`, for the `login-id` screen.

```jsx Example theme={null}
import { useClient } from '@auth0/auth0-acul-react/login-id';
function AppInfo() {
  const client = useClient();
}
```

**useCountryCodes** `() => [CountryCodesMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/CountryCodesMembers)`

This hook provides the available phone country codes and recommended default for the `login-id` screen.

```jsx Example theme={null}
import { useCountryCodes } from '@auth0/auth0-acul-react/login-id';
function CountryPicker() {
  const countryCodes = useCountryCodes();
  const available = countryCodes?.available;
}
```

**useExperiment** `() => [ExperimentMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/ExperimentMembers)`

This hook provides the active [Experiment Center](/docs/docs/customize/experiment-center) experiment for the `login-id` screen, or `null` when no experiment is active (or the screen has not opted in via `context_configuration`).

```jsx Example theme={null}
import { useExperiment } from '@auth0/auth0-acul-react/login-id';
function ExperimentBranch() {
  const experiment = useExperiment();
  if (!experiment) return null;
  return experiment.isControl ? <ControlUI /> : <TreatmentUI />;
}
```

**useOrganization** `() => [OrganizationMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/OrganizationMembers)`

This hook provides information about the user's Organization if the login is Organization scoped. Returns `null` when no Organization context is present.

```jsx Example theme={null}
import { useOrganization } from '@auth0/auth0-acul-react/login-id';
function OrgSelector() {
  const organization = useOrganization();
  if (!organization) {
    return <p>No organization context</p>;
  }
}
```

**usePrompt** `() => [PromptMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/PromptMembers)`

This hook contains data about the current prompt in the authentication flow.

```jsx Example theme={null}
import { usePrompt } from '@auth0/auth0-acul-react/login-id';
function FlowInfo() {
  const prompt = usePrompt();
}
```

**useScreen** `() => [ScreenMembersOnLoginId](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/ScreenMembersOnLoginId)`

This hook contains details specific to the `login-id` screen, including its configuration and context.

```jsx Example theme={null}
import { useScreen } from '@auth0/auth0-acul-react/login-id';
function ScreenDebug() {
  const screen = useScreen();
}
```

**useTenant** `() => [TenantMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/TenantMembers)`

This hook contains data related to the tenant, such as `id` and associated metadata.

```jsx Example theme={null}
import { useTenant } from '@auth0/auth0-acul-react/login-id';
function TenantInfo() {
  const tenant = useTenant();
}
```

**useTransaction** `() => [TransactionMembersOnLoginId](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/TransactionMembersOnLoginId)`

This hook provides transaction-specific data for the `login-id` screen, such as active connections, available login methods, and current flow state.

```jsx Example theme={null}
import { useTransaction } from '@auth0/auth0-acul-react/login-id';
function TransactionInfo() {
  const transaction = useTransaction();
}
```

**useUntrustedData** `() => [UntrustedDataMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/UntrustedDataMembers)`

This hook handles untrusted data passed to the screen, such as a prefilled identifier from URL parameters.

```jsx Example theme={null}
import { useUntrustedData } from '@auth0/auth0-acul-react/login-id';
function PrefilledForm() {
  const untrustedData = useUntrustedData();
}
```

**useUser** `() => [UserMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/UserMembers)`

This hook provides details of the active user, including `username`, `email`, and available authentication methods.

```jsx Example theme={null}
import { useUser } from '@auth0/auth0-acul-react/login-id';
function UserProfile() {
  const user = useUser();
}
```

**useLoginId** `[LoginIdMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/LoginIdMembers)`

This hook returns all methods and context available on the `login-id` screen.

## Methods

**googleOneTap** `Promise\<void\>`

This method authenticates the user using a Google One Tap credential, enabling one-click sign-in without redirecting to a separate login page.

```jsx Example theme={null}
import { useLoginId } from '@auth0/auth0-acul-react/login-id';

function GoogleOneTapHandler({ credential }) {
  const { googleOneTap } = useLoginId();
  return googleOneTap({ one_tap_credential: credential });
}
```

**Method Parameters**

**Parameters**

**one\_tap\_credential** `string` *required*

The Google One Tap credential token returned by the Google Identity Services prompt.

**federatedLogin** `Promise\<void\>`

This method redirects the user to the [Social](/docs/docs/authenticate/identity-providers/social-identity-providers) or [Enterprise Identity Provider](/docs/docs/authenticate/identity-providers/enterprise-identity-providers) (IdP) for authentication.

```jsx Example theme={null}
import { useLoginId } from '@auth0/auth0-acul-react/login-id';

function SocialButton() {
  const { federatedLogin } = useLoginId();
  return (
    <button onClick={() => federatedLogin({ connection: 'google-oauth2' })}>
      Sign in with Google
    </button>
  );
}
```

**Method Parameters**

**Parameters**

**connection** `string` *required*

The Social or Enterprise Identity Provider connection name.

**\[`key`: `string`]** `"string" | "number" | "boolean" | "undefined"`

Additional custom fields prefixed with `ulp-` (for example, `'ulp-custom-field'`).

**login** `Promise\<void\>`

This method submits the user's identifier to proceed to the next step in the authentication flow.

```jsx Example theme={null}
import { useLoginId } from '@auth0/auth0-acul-react/login-id';

function LoginIdForm() {
  const { login } = useLoginId();
  return (
    <button onClick={() => login({ username: 'user@example.com' })}>
      Continue
    </button>
  );
}
```

**Method Parameters**

**Parameters**

**options**

[LoginOptions](/docs/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/LoginOptions).

**identifier?** `string`

The user's identifier — email, username, or phone, depending on `identifierType`. Provide this or `username`; if both are given, `identifier` wins.

**username?** `string`

The user's identifier, under its original spelling. Provide this or `identifier`.

**identifierType?** `[IdentifierType](/docs/libraries/acul/react-sdk/API-Reference/Types/type-aliases/IdentifierType)`

What `identifier` (or `username`) holds. Typically read from `screen.data.activeIdentifierType`. Omit to submit the identifier untyped.

**phoneCountryCode?** `string`

The ISO 3166-1 alpha-2 country for a phone identifier, from a `code` in `countryCodes.available`. Required when `identifierType` is `phone`. Pass the national number — the dial code is prefixed server-side.

**captcha?** `string`

Captcha value required when bot detection is enabled on the tenant.

**\[`key`: `string`]** `"string" | "number" | "boolean" | "undefined"`

Additional custom fields prefixed with `ulp-` (for example, `'ulp-custom-field'`).

**passkeyLogin** `Promise\<void\>`

This method initiates passwordless authentication using a passkey.

```jsx Example theme={null}
import { useLoginId } from '@auth0/auth0-acul-react/login-id';

function PasskeyButton() {
  const { passkeyLogin } = useLoginId();
  return (
    <button onClick={() => passkeyLogin()}>
      Sign in with Passkey
    </button>
  );
}
```

**Method Parameters**

**Parameters**

**options**

[CustomOptions](/docs/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/CustomOptions).

**\[`key`: `string`]** `"string" | "number" | "boolean" | "undefined"`

Additional custom fields prefixed with `ulp-` (for example, `'ulp-custom-field'`).

**pickCountryCode** `Promise\<void\>`

This method navigates to the country code picker for phone-based login flows.

```jsx Example theme={null}
import { useLoginId } from '@auth0/auth0-acul-react/login-id';

function PhoneLogin() {
  const { pickCountryCode } = useLoginId();
  return (
    <button onClick={() => pickCountryCode()}>
      Select Country Code
    </button>
  );
}
```

## Common/Utility Hooks

**[useAuth0Themes](/docs/docs/libraries/acul/react-sdk/API-Reference/Hooks/useAuth0Themes)** `Hooks`

This hook gets the current theme options with flattened configuration from branding context.

**[useChangeLanguage](/docs/docs/libraries/acul/react-sdk/API-Reference/Hooks/useChangeLanguage)** `Hooks`

This hook returns a function for changing the display language on the current ACUL screen.

**[useCurrentScreen](/docs/docs/libraries/acul/react-sdk/API-Reference/Hooks/useCurrentScreen)** `Hooks`

This hook gets the current screen context and state.

**[useErrors](/docs/docs/libraries/acul/react-sdk/API-Reference/Hooks/useErrors)** `Hooks`

This hook reads and manages server, client, and developer errors on the screen.

**[useLoginIdentifiers](/docs/docs/libraries/acul/react-sdk/API-Reference/Hooks/useLoginIdentifiers)** `Hooks`

This hook returns a list of active identifier types (`email`, `phone`, `username`) in the current flow.

**[usePasskeyAutofill](/docs/docs/libraries/acul/react-sdk/API-Reference/Hooks/usePasskeyAutofill)** `Hooks`

This hook enables passkey autofill on an input field for a seamless passwordless login experience.
