Published: May 12, 2026
Immediate UI mode for logins is a web capability designed to streamline sign-in flows. This feature lets you proactively offer passkeys and managed passwords directly to your users when they reach a sign-in moment, such as clicking a Sign In or Checkout button.
Abstract
Immediate UI mode provides a mode that fails promptly if no credentials are
locally available. This behavior mirrors preferImmediatelyAvailableCredentials
APIs found on mobile platforms like Android and iOS. When credentials exist, the
browser presents an immediate login dialog to the user. Otherwise, it rejects
the promise silently, letting you provide alternative sign-in methods, for
example, a sign-in form, without disrupting the user experience.
As of May 2026, Chrome is the only browser that supports immediate UI mode.
Check prerequisites
To use immediate UI mode, the user must already have eligible credentials available locally on their device. On Chrome, these credentials include:
- Passkeys saved in a passkey provider such as Google Password Manager, Windows Hello, or iCloud Keychain.
- Passwords saved in Google Password Manager.
If no local credentials exist, the API rejects the request without showing the immediate login dialog.
Detect feature support
Before you call immediate UI mode, verify whether the browser supports the
immediateGet capability using the
PublicKeyCredential.getClientCapabilities() method. If it is not supported,
fall back to existing sign-in methods, such as email and password forms, phone
number verification, or social logins.
async function checkImmediateAvailability() {
try {
const capabilities = await PublicKeyCredential.getClientCapabilities();
if (capabilities.immediateGet) {
console.log("Immediate UI mode is supported.");
} else {
console.log("Immediate UI mode is NOT supported.");
}
} catch (error) {
console.error("Error checking client capabilities:", error);
}
}
For broader browser support, use the polyfill available in the WebAuthn Polyfills GitHub repository.
Request credentials
To trigger the immediate login flow, call navigator.credentials.get() with the
uiMode field set to 'immediate'.
By including password: true in your request, users can benefit from this
experience if the browser supports password
credentials.
// This call must follow a user gesture, like a button click
button.addEventListener('click', async (event) => {
event.preventDefault();
try {
const cred = await navigator.credentials.get({
password: true,
publicKey: {
challenge: serverGeneratedChallenge,
rpId: 'example.com'
},
uiMode: 'immediate',
});
// Handle successful sign-in
} catch (error) {
if (error.name === 'NotAllowedError') {
// Provide a fallback sign-in experience
showFallbackUI();
}
}
});
You must handle the NotAllowedError in a catch block to provide a fallback
sign-in experience.
Handle sign-in flows
You can implement immediate UI mode for two primary scenarios.
Sign in with a button
Provide a dedicated sign-in button that offers a clean experience without unexpected prompts.
- The user clicks a Sign in button.
- Your site calls
navigator.credentials.get()withuiMode: "immediate". - The browser checks for local credentials.
- If the browser finds credentials, it presents an immediate login dialog for the user to select an account.
- If the browser finds no credentials or the user dismisses the immediate
login dialog, it throws a
NotAllowedError. - If a
NotAllowedErroris thrown, your site then proceeds with its standard sign-in page.
Sign in before a checkout
Offer credentials proactively before a user performs an action that would benefit from authentication, such as starting a checkout flow at an online storefront.
In ecommerce, guest users often select between signing in to an existing account or checking out as a guest. Providing an immediate login dialog can streamline the checkout process for returning customers.
- The user initiates an action, such as clicking a Checkout button during a shopping flow.
- Your site calls
navigator.credentials.get()withuiMode: "immediate". - If credentials exist, the user selects one to complete the sign-in.
- If credentials don't exist, the browser throws an error and shows no immediate login dialog. The user experience remains unchanged, and you can take the user to the existing checkout screen, which might provide other sign-in options or a guest checkout form.
Review privacy and security measures
The browser implements critical measures to protect user privacy:
- User gesture requirement: You must initiate the API call with a user gesture, such as a click, to prevent silent probing. The call does not consume the activation.
- Incognito mode restrictions: Requests in incognito or private sessions
always throw a
NotAllowedError. - No allowlists: Requests with a non-empty
allowCredentialslist throw aNotAllowedErrorto prevent cross-session tracking. - No programmatic cancellation: You cannot use the
signalparameter to programmatically dismiss the immediate login dialog.