5 min readUpdated Mar 2, 2026

PasskeySettings Documentation

Overview

The PasskeySettings component serves as a user interface for managing passkeys, an advanced authentication method that provides enhanced security over traditional passwords. This component allows users to register and manage their biometric authentication methods (e.g., Face ID, Touch ID) or security keys, streamlining the sign-in process across devices.

Purpose

The purpose of the PasskeySettings component is to facilitate the following functionalities:

  1. Registration of Passkeys: Users can register new passkeys, enabling biometric or security key authentication.
  2. Management of Existing Passkeys: Users can view, rename, or delete existing passkeys.
  3. Display of Status Messages: It provides feedback to users when actions are taken, such as successful registration or errors.

Settings

The PasskeySettings component utilizes several internal states to manage its behavior. Each setting represents a key piece of functionality within the component.

1. passkeys

2. loading

3. registering

4. deviceName

5. showNameInput

6. error

7. success

8. editingId

9. editName

How It Works

Data Flow

  1. The component initializes by fetching existing passkeys from the API endpoint /api/user/passkeys on mount.
  2. Users can register a new passkey by calling the API to get registration options, which triggers the browser's biometric authentication prompt.
  3. Upon successful registration, the device name is sent along with the biometric response to the server for verification.
  4. Users can delete or rename existing passkeys via respective API endpoints, with UI updates reflecting these changes in real-time.

API Interaction

The component leverages three major API endpoints for its operations:

Use Cases & Examples

Use Case 1: Enhanced Security for Enterprise Users

An enterprise organization wishes to improve security by offering biometric logins for employee accounts. By implementing passkey-based authentication through the PasskeySettings component, every employee can enable same-device biometric verification methods, ensuring secure access without traditional passwords.

Use Case 2: Account Recovery and Management

A user frequently changes devices and needs to manage multiple passkeys effectively. The PasskeySettings component allows them to easily add, delete, or rename passkeys across devices, managing their authentication methods in one place.

Example Configuration

Scenario

A user wants to register a new passkey for their iPhone, which is to be used for secure sign-in to their services.

Configuration Steps

  1. The user clicks on the "Add a passkey" button.
  2. The input field for the device name appears; the user types "iPhone".
  3. The user is prompted for biometric authentication (e.g., Face ID).
  4. Upon successful authentication, the passkey is registered and the UI is updated to reflect the addition.

Sample Configuration Data

json
{
    "deviceName": "iPhone",
    "action": "register"
}

The PasskeySettings component effectively integrates user-friendly functionality that enhances security through seamless passkey management, providing necessary feedback to users during the process.