> ## 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.

# useRegisterPasskey

<Card title="Recommended: JavaScript SDK with React Hooks" icon="react" color="#4779FE">
  For new React apps, we recommend the JavaScript SDK with React Hooks (`@dynamic-labs-sdk/react-hooks`) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the [React quickstart (JavaScript SDK)](/javascript/reference/react-quickstart) to get started.
</Card>

## Overview

A React hook that provides a function to register a new passkey for the authenticated user. The hook returns a memoized function that can be called to initiate the passkey registration flow.

## Returns

A promise resolving to a [`VerifyResponse`](/api-reference/schemas/VerifyResponse) object.

## Type Signature

```typescript theme={"system"}
const useRegisterPasskey: () => (() => Promise<VerifyResponse>)
```

## Parameters

None - the hook takes no parameters.

## Example Usage

```typescript theme={"system"}
import { useRegisterPasskey } from '@dynamic-labs/sdk-react-core';

const MyComponent = () => {
  const registerPasskey = useRegisterPasskey();

  const handleRegisterPasskey = async () => {
    try {
      const verifyResponse = await registerPasskey();
      console.log('Passkey registered successfully:', verifyResponse);
    } catch (error) {
      console.error('Failed to register passkey:', error);
    }
  };

  return (
    <button onClick={handleRegisterPasskey}>
      Register Passkey
    </button>
  );
};
```

## Notes

* The registration process is asynchronous and may require user interaction (biometric authentication, etc.)
* The hook should only be used within a Dynamic context provider
