ump-plugin-biometrics
v0.0.1
Published
UMP Biometrics Plugin - Fingerprint / Face / Iris auth (single-class API)
Downloads
25
Readme
ump-plugin-biometrics
UMP Biometrics Plugin — Fingerprint / Face / Iris auth (single-class API).
Install
npm install ump-plugin-biometrics --save
Usage
import { Biometrics } from 'ump-plugin-biometrics';
const probe = await Biometrics.isAvailable(); if (probe.available) { const result = await Biometrics.authenticate({ reason: 'Unlock your wallet', fallbackLabel: 'Use passcode', cancelLabel: 'Cancel', }); if (result.success) { // user authenticated } else { // result.error: 'cancelled' | 'lockout' | 'no_hardware' | // 'no_enrollment' | 'unsupported' | string } }
The plugin probes for __ump_biometrics_* host functions on globalThis and
degrades cleanly when they are absent: isAvailable() resolves to
{ available: false } and authenticate() resolves to
{ success: false, error: 'unsupported' }.
See src/index.ts for the full API.
Plugin authoring
This is a UMP plugin. See docs/superpowers/specs/plugin-authoring-guide.md for the plugin model.
