Allow users to authenticate with a pre-registered passkey. It can only be used to sign-in, not to sign-up. Passkey is a passwordless way for users to sign in securely. Instead of relying on something you know (like a password), passkeys use cryptographic key pairs stored on the user’s device. Authentication happens with a biometric check (such as Face ID, Touch ID, or a fingerprint scan) or a local device PIN. This makes passkeys both safer—since they can’t be phished or reused—and easier to use, since users don’t need to remember or type credentials.

Prerequisites

  • You need to have the Dynamic Client initialized.
  • You need to have the passkey authentication method enabled in your environment’s settings in the Dynamic dashboard.

Usage

import { signInWithPasskey } from '@dynamic-labs-sdk/client';

// Call signInWithPasskey to prompt the user to authenticate with a passkey.
// Once the user authenticates with the passkey, they will be signed in.

const handlePasskeySignIn = async () => {
  await signInWithPasskey();
};