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

# LoginId

<Frame>
  <img style={{maxHeight:"400px"}} src="https://mintcdn.com/generaltranslationinc/-mZh6I5893vkj3e3/docs/images/cdy7uua7fh8z/1nvMFmxC5ODCW2q7cByHv8/657d87ba1c2eb11316e6b0ef93737c99/LoginIDACUL.png?fit=max&auto=format&n=-mZh6I5893vkj3e3&q=85&s=ea40614ef7f544b2a4893f8b71534611" alt="" width="409" height="562" data-path="docs/images/cdy7uua7fh8z/1nvMFmxC5ODCW2q7cByHv8/657d87ba1c2eb11316e6b0ef93737c99/LoginIDACUL.png" />
</Frame>

```ts Example theme={null}
import LoginId from "@auth0/auth0-acul-js/login";
const loginIdManager = new LoginId();
loginIdManager.getLoginIdentifiers();
```

## Constructors

<ParamField body="LoginId" type="Constructor">
  Creates an instance of LoginIdManager.
</ParamField>

## Properties

<ParamField body="branding" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/BrandingMembers">BrandingMembers</a></span>} />

<ParamField body="client" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/ClientMembers">ClientMembers</a></span>} />

<ParamField body="organization" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/OrganizationMembers">OrganizationMembers</a></span>} />

<ParamField body="prompt" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/PromptMembers">PromptMembers</a></span>} />

<ParamField body="screen" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/ScreenMembersOnLoginId">ScreenMembersOnLoginId</a></span>} />

<ParamField body="tenant" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/TenantMembers">TenantMembers</a></span>} />

<ParamField body="transaction" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/TransactionMembersOnLoginId">TransactionMembersOnLoginId</a></span>} />

<ParamField body="untrustedData" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/UntrustedDataMembers">UntrustedDataMembers</a></span>} />

<ParamField body="user" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/UserMembers">UserMembers</a></span>} />

<ParamField body="screenIdentifier" type="string" />

## Methods

<ParamField body="federatedLogin" type="Promise<void>">
  ```ts Example theme={null}
  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 federated login using the selected connection
  loginIdManager.federatedLogin({
    connection: selectedConnection.name,
  });
  ```

  <Expandable title="Parameters">
    <ParamField body="payload" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/FederatedLoginOptions">FederatedLoginOptions</a></span>}>
      **Properties**

      <ParamField body="connection" type="string" />
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="getErrors" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/Error">Error</a>[]</span>}>
  Retrieves the array of transaction errors from the context, or an empty array if none exist.
</ParamField>

<ParamField body="getLoginIdentifiers" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/type-aliases/ScreenIdentifierType">ScreenIdentifierType</a>[]</span>}>
  **`Utility Feature`**

  Gets the active identifier types for the login screen

  ```typescript Example theme={null}
  import LoginId from "@auth0/auth0-acul-js/login";
  const loginIdManager = new LoginId();
  loginIdManager.getLoginIdentifiers();
  ```
</ParamField>

<ParamField body="login" type="Promise<void>">
  ```ts Example theme={null}
  import LoginId from "@auth0/auth0-acul-js/login-id";

  const loginIdManager = new LoginId();

  loginIdManager.login({
    username: <usernameFieldValue>
  });
  ```

  <Expandable title="Parameters">
    <ParamField body="payload" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/LoginOptions">LoginOptions</a></span>}>
      **Properties**

      <ParamField body="captcha?" type="string" />

      <ParamField body="username" type="string" />
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="passkeyLogin" type="Promise<void>">
  ```ts Example theme={null}
  import LoginId from "@auth0/auth0-acul-js/login-id";
  const loginIdManager = new LoginId();

  // It internally maps users available passkey config provided from auth0 server
  loginIdManager.passkeyLogin();
  ```

  <Expandable title="Parameters">
    <ParamField body="payload?" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/CustomOptions">CustomOptions</a></span>} />
  </Expandable>
</ParamField>

<ParamField body="pickCountryCode" type="Promise<void>">
  ```ts Example theme={null}
  import LoginId from "@auth0/auth0-acul-js/login-id";
  const loginIdManager = new LoginId();

  loginIdManager.pickCountryCode();
  ```

  <Expandable title="Parameters">
    <ParamField body="payload?" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/CustomOptions">CustomOptions</a></span>} />
  </Expandable>
</ParamField>

### Passkeys

<ParamField body="registerPasskeyAutofill" type="Promise<void>">
  **`Utility Feature`**

  Registers the browser's Conditional UI for passkeys (autocomplete experience).

  This method initializes a passive WebAuthn credential request using
  `navigator.credentials.get()` with `mediation: "conditional"`. When supported,
  this allows the browser to display stored passkeys directly within the username
  field’s autocomplete dropdown.

  Call this **once** when the login screen is initialized (for example, on page load).
  After registration, focusing the username input will automatically display
  matching passkeys as suggestions. Selecting a passkey completes authentication
  without requiring additional user interaction.
</ParamField>

### Input configuration

If an `inputId` is provided, the SDK will:

* Validate that the element exists and is an `<input>`.
* Overwrite its `autocomplete` attribute with `"webauthn username"`.

This ensures full compatibility with the Conditional Mediation API.

If you do **not** provide an `inputId`, you are responsible for configuring
the input element manually with the correct attributes:

```html theme={null}
<input id="username" autocomplete="webauthn username" />
```

***

### Gotchas

* The `autocomplete` attribute **must exactly** contain `"webauthn username"`.
  Including unrelated tokens such as `"email"` or `"text"` will prevent browsers
  from showing the passkey dropdown.
* Overwriting the attribute is intentional and required for consistent behavior
  across browsers. Do not rely on merging or extending existing autocomplete values.
* If Conditional Mediation is not supported by the browser, the SDK will safely no-op.

#### Parameters

<ParamField body="inputId?" type="string">
  `string`

  Optional ID of the username `<input>` element (without `#`). Example: `"username"`.
  If omitted, the developer must manually ensure the correct `autocomplete` attributes.
</ParamField>

```ts Example theme={null}
import LoginId from '@auth0/auth0-acul-js/login-id';

// Example: initializing passkey autocomplete inside an async setup block.
async function initializeLogin() {
  const loginId = new LoginId();
  // Make sure associated HTML input exists:
  // <input id="username" autocomplete="webauthn username" />
  // Conditional UI registration.
  await loginId.registerPasskeyAutofill('username');
}

initializeLogin().catch(console.error);
```

#### Remarks

This method delegates to the internal `registerPasskeyAutofill()` utility,
returning a background `AbortController` to manage request lifetime. It should
only be invoked once per page lifecycle.
