Passkey registration
The registration section of the quickstart guide covers the basics, so we’ll focus on some more advanced aspects of passkey registration here.
Testing for passkey support
Section titled “Testing for passkey support”Dont assume the device support passkeys, test for passkey support.
import { isPasskeySupport } from "@passlock/client";
if (!isPasskeySupport()) { throw new Error("Bad news...")}Biometric verification
Section titled “Biometric verification”Enforce local user verification by passing the userVerification option.
// discouraged, preferred (default) or requiredconst userVerification = "required" as const;const result = await registerPasskey({ tenancyId, userVerification });Testing for an existing passkey
Section titled “Testing for an existing passkey”Use the excludeCredentials property to prevent the user registering duplicate passkeys.
import { registerPasskey } from '@passlock/client';
// from your backend databaseconst excludeCredentials = [existingPasskeyId];const result = await registerPasskey({ excludeCredentials, ... });Attestation
Section titled “Attestation”Attestation is an advanced concept which essentially allows you to obtain information about the authenticator (device) generating the passkey. If you want to restrict users to a list of approved platforms, attestation can be used for this.