try {
const publicKeyCredential = await navigator.credentials.create({
publicKey: options,
mediation: "conditional",
});
// handle new passkey creation
// let the user know that they have a passkey now
} catch (e) {
// passkey was not created
}Passkeys / notebook
Passkeys
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
<input type="text" name="username" autocomplete="username webauthn" autofocus />const assertion = await navigator.credentials.get({
publicKey: options,
mediation: "conditional",
});