> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Authenticate with Passkey

<Note>
  The user must have already signed in via another method (e.g. email/password, social, etc.) and added a passkey to their account before they can use it to sign in with.

  You can prompt a user to add a passkey to their account using your SDK's passkey registration method (see SDK-specific Tabs).
</Note>

## Dashboard Configuration

Simply toggle on "Passkey" in [the Log in & User Profile section of the dashboard](https://app.dynamic.xyz/dashboard/log-in-user-profile).

## Prerequisites

Before this: create and initialize a Dynamic client (see [Creating a Dynamic Client](/javascript/reference/client/create-dynamic-client), [Initializing the Dynamic Client](/javascript/reference/client/initialize-dynamic-client)).

## Usage

<Tabs>
  <Tab title="JavaScript">
    ```javascript theme={"system"}
    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();
    };
    ```
  </Tab>

  <Tab title="React">
    ```tsx theme={"system"}
    import { useSignInWithPasskey } from '@dynamic-labs-sdk/react-hooks';

    function PasskeySignInButton() {
      const { mutate: signInWithPasskey, isPending } = useSignInWithPasskey();

      return (
        <button onClick={() => signInWithPasskey()} disabled={isPending}>
          {isPending ? 'Signing in…' : 'Sign in with passkey'}
        </button>
      );
    }
    ```
  </Tab>
</Tabs>
