Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.chipipay.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

WebAuthn passkeys replace PINs with biometric authentication (Face ID, Touch ID, Windows Hello). No PINs to remember or store.

Prerequisites

  • Modern browser with WebAuthn support (Chrome, Safari, Firefox, Edge)
  • Biometric hardware (fingerprint, face recognition)
  • Chipi React SDK installed

Installation

npm install @chipi-stack/chipi-passkey

Basic Implementation

1

Create wallet with passkey

import { usePasskeySetup } from "@chipi-stack/chipi-passkey/hooks";
2

Authenticate with passkey

import { usePasskeyAuth } from "@chipi-stack/chipi-passkey/hooks";
3

Migrate existing wallet (optional)

If users already have a PIN-based wallet, they can migrate to passkey:
import { useMigrateWalletToPasskey } from "@chipi-stack/chipi-react";

Example

import { useCreateWallet, Chain } from '@chipi-stack/chipi-react';
import { usePasskeySetup } from '@chipi-stack/chipi-passkey/hooks';
import { useState } from 'react';

export function CreateWalletWithPasskey() {
  const { createWalletAsync, isLoading, error } = useCreateWallet();
  const { setupPasskey } = usePasskeySetup();
  const [wallet, setWallet] = useState(null);

  const handleCreate = async () => {
    try {
      // Triggers biometric prompt
      const passkeyResult = await setupPasskey('user-123', 'User Name');
      const encryptKey = passkeyResult.encryptKey;

      const result = await createWalletAsync({
        params: {
          encryptKey,
          usePasskey: true,
          externalUserId: 'user-123',
        },
        bearerToken: 'your-jwt-token',
      });
      
      localStorage.setItem('wallet', JSON.stringify(result));
      setWallet(result);
    } catch (err) {
      console.error(err);
    }
  };

  return (
    <div>
      <button onClick={handleCreate} disabled={isLoading}>
        {isLoading ? 'Creating...' : 'Create Wallet with Passkey'}
      </button>
      {error && <p>Error: {error.message}</p>}
      {wallet && <p>Wallet created: {wallet.publicKey}</p>}
    </div>
  );
}

Hooks Reference

HookPurpose
usePasskeySetupCreate new passkey
usePasskeyAuthAuthenticate with existing passkey
usePasskeyStatusCheck passkey support & status
useMigrateWalletToPasskeyMigrate from PIN to passkey

Browser Support

  • ✅ Chrome 67+ (Desktop & Android)
  • ✅ Safari 14+ (iOS 14+, macOS)
  • ✅ Firefox 60+ (Desktop)
  • ✅ Edge 18+ (Desktop)
Passkeys are stored in the browser and synced via platform (iCloud Keychain, Google Password Manager).

Security Benefits

  • No PINs stored - Keys derived on-demand from biometric
  • Platform-level security - Hardware-backed authentication
  • Phishing resistant - Domain-bound credentials
  • User convenience - One tap authentication

Next Steps