React hook that enables browser Conditional UI (passkey autofill)
for the login identifier field on the login-id screen.
Behavior
The hook automatically initializes the browser’s Conditional Mediation
API (navigator.credentials.get({ mediation: "conditional" })),
allowing passkeys stored on the user’s device to appear directly in
the username field’s autocomplete dropdown.
It fails silently on unsupported browsers and never blocks user input.
The registration is performed once per page lifecycle.
Using the returned ref
The returned inputRef is optional.
If you bind it to your <input> element, the SDK will ensure the element’s
autocomplete attribute is correctly set to "username webauthn".
If your input element already hasautocomplete="username webauthn" declared in markup,
you can skip binding the ref entirely, the hook will still register
Conditional Mediation correctly. See UsePasskeyAutofillResult
React hook that enables browser Conditional UI (passkey autofill) for the login identifier field on the
login-idscreen.Behavior
navigator.credentials.get({ mediation: "conditional" })), allowing passkeys stored on the user’s device to appear directly in the username field’s autocomplete dropdown.Using the returned
refThe returned
inputRefis optional.<input>element, the SDK will ensure the element’sautocompleteattribute is correctly set to"username webauthn".autocomplete="username webauthn"declared in markup, you can skip binding therefentirely, the hook will still register Conditional Mediation correctly. See UsePasskeyAutofillResultExample