Verification and storage
type RegistrationVerification = { challenge: string; origin: string; rpId: string; credentialId: Uint8Array; publicKey: Uint8Array; signCount: number; };
challenge matches what you issued.origin matches your allowed origins.rpId matches your configured site identity.What you keep for later
credentialId so you can look up the right passkey laterpublicKey for verifying future assertionssignCount as a cloned-key warning signalIf the signature counter goes backwards or stops behaving as expected, treat it as suspicious and trigger extra review or recovery.
Recommended stack
@simplewebauthn/server@simplewebauthn/browserbetter-auth or lucia-auth if you want passkeys inside a broader auth systemimport { generateRegistrationOptions, verifyRegistrationResponse } from '@simplewebauthn/server';
Why libraries matter