Testing for passkey support
Most devices and browsers now support passkeys, albeit with a few quirks. Nevertheless, don’t assume support is universal.
isPasskeySupport
Section titled “isPasskeySupport”Before prompting the user to register or authenticate with a passkey you should call isPasskeySupport().
import { isPasskeySupport } from "@passlock/client";
if (!isPasskeySupport()) { throw new Error("Bad news...")}PasskeyUnsupported error
Section titled “PasskeyUnsupported error”Alternatively test for the PasskeyUnsupported error:
import { registerPasskey, isRegistrationSuccess, isPasskeyUnsupported} from "@passlock/client";
const result = await registerPasskey({ ... })
if (isRegistrationSuccess(result)) { // happy days} else if (isPasskeyUnsupported(result)) { // no passkey support on this device} else { ... }