Prerequisites
Before this: create and initialize a Dynamic client (see Creating a Dynamic Client, Initializing the Dynamic Client). Enable Passkey in your Dynamic dashboard. Passkeys use WebAuthn, which requires a secure context (HTTPS, orlocalhost in development).
Register a passkey
CallregisterPasskey while the user is signed in — for example, in an “enable faster sign in” prompt right after sign-up, or from an account-security screen. It triggers the browser’s passkey-creation dialog, then stores the credential against the user.
- TypeScript
- React
Wire the call to your “enable faster sign in” button. Disable it while the browser dialog is open so the user can’t trigger two prompts at once.
Sign in with a passkey
For returning users who already registered a passkey, a single button is enough.signInWithPasskey opens the browser’s passkey picker and, on success, authenticates the user.
- TypeScript
- React
List and remove passkeys
Let users see and manage their registered passkeys from an account-security screen.getPasskeys returns the user’s passkeys; deletePasskey removes one by id. Each passkey has an optional user-assigned alias, plus createdAt and the origin it was registered on.
- TypeScript
- React
Render the user’s passkeys into a list, each with a “Remove” button that calls
deletePasskey and re-renders.Removing a passkey is a sensitive action, so it may require the user to re-authenticate (step-up). See Step-up authentication for how to handle that prompt.
Handling errors
See also
- Email & SMS OTP sign-in — a sign-up method users can pair with a passkey
- Social sign-in & OAuth redirect handling — another sign-up method
- Authenticate with passkey — passkey method reference
- Step-up authentication — re-authenticate for sensitive actions