Registration
const credential = await navigator.credentials.create({ publicKey: { challenge, rp: { id: 'example.com', name: 'Example App' }, user, pubKeyCredParams: [{ alg: -7, type: 'public-key' }], }, });
challenge comes from your server.rp.id must match your site identity rules.Authentication
const assertion = await navigator.credentials.get({ publicKey: { challenge, rpId: 'example.com', userVerification: 'preferred', }, });