This guide is for users who want to build a custom user interface using the Clerk API. To authenticate users with passkeys using a prebuilt UI, you should use Clerk's <SignIn /> and <UserProfile /> components. See the sign-in and sign-out options docs to learn more.
Clerk supports passwordless authentication via passkeys, enabling users to sign in without having to remember a password. Instead, users select a passkey associated with their device, which they can use to authenticate themselves.
This guide will teach you how to use Clerk's API to build custom flows for creating, signing users in with, and managing passkeys.
To sign a user into your Clerk app with a passkey, you must call SignIn.authenticateWithPasskey(). This method allows users to choose from their discoverable passkeys, such as hardware keys or passkeys in password managers.
Clerk generates a name based on the device associated with the passkey when it's created. Sometimes users may want to rename a passkey to make it easier to identify.
To rename a user's passkey in your Clerk app, you must call the update() method of the passkey object as shown in the following example: