nostr-biometric-auth-utils
Version:
A utility library for biometric authentication in Nostr applications using WebAuthn.
31 lines (30 loc) • 1.33 kB
TypeScript
/**
* @module webauthn
* @description WebAuthn-based biometric authentication implementation
*/
import type { AuthChallenge, AuthResult, DeviceInfo, BiometricSettings } from '../../types/index.js';
import type { PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialRequestOptionsJSON, RegistrationResponseJSON } from '@simplewebauthn/types';
/**
* Initialize WebAuthn for a new device
* @param settings Biometric settings for the device
* @returns Device registration options
*/
export declare function initializeWebAuthn(settings: BiometricSettings): Promise<PublicKeyCredentialCreationOptionsJSON>;
/**
* Register a new device with WebAuthn
* @param options WebAuthn registration options
* @returns Device registration response
*/
export declare function registerDevice(options: PublicKeyCredentialCreationOptionsJSON): Promise<RegistrationResponseJSON>;
/**
* Generate an authentication challenge
* @param deviceInfo Device to authenticate with
* @returns Authentication challenge
*/
export declare function generateChallenge(deviceInfo: DeviceInfo): Promise<AuthChallenge>;
/**
* Authenticate using WebAuthn
* @param challenge Authentication challenge
* @returns Authentication result
*/
export declare function authenticate(challenge: PublicKeyCredentialRequestOptionsJSON): Promise<AuthResult>;