@face-auth/face-auth-wizard
v0.0.5
Published
Browser SDK that renders and orchestrates the Face Auth verification wizard (UI, camera capture flow, and backend verification integration).
Maintainers
Readme
@face-auth/face-auth-wizard
Browser SDK for Face Auth verification flow with built-in modal UI, camera capture orchestration, and result callbacks.
Version and last-update badges are synchronized from the source package.json.
Installation
npm install @face-auth/face-auth-wizardBrowser via jsDelivr
<script src="https://cdn.jsdelivr.net/npm/@face-auth/[email protected]/dist/index.global.js"></script>
<script>
FaceAuth.openVerify({
domain: "your-tenant-domain",
clientToken: "your-client-token",
}).then((result) => {
console.log(result);
});
</script>Public API
openVerify(options: WizardOptions): Promise<WizardResult>Exported types
WizardOptionsWizardResultWizardCallbacksWizardEventWizardDecisionWizardStepIdWizardMode
Quick Start
import { openVerify } from "@face-auth/face-auth-wizard";
const result = await openVerify({
domain: "your-tenant-domain",
clientToken: "your-client-token",
mount: "body",
i18n: { locale: "en" },
callbacks: {
onOpen: () => console.log("opened"),
onClose: () => console.log("closed"),
onStepChange: (step) => console.log(step),
onSuccess: (r) => console.log("match", r),
onNoMatch: (r) => console.log("no match", r),
onError: (err) => console.error(err),
},
});
console.log(result);Options
Required
domain: stringclientToken: string
Optional
mount: string | HTMLElement(default:"body")modal:closeOnEscape?: booleancloseOnBackdropClick?: booleanlockBodyScroll?: booleanariaLabel?: stringzIndex?: number
theme:primaryColor?: stringborderRadiusPx?: numberfontFamily?: string
i18n:locale?: "en" | "es"messages?: objectpartial override map using the built-in locale message keys
debug?: booleancallbacks?: WizardCallbacks
Result
WizardResult fields:
hasDecision: booleanisMatch: booleanmode: "verify" | "enroll"decision?: { status, reason, faceIdentityId? } | nullerror?: string | null
Callback behavior:
onSuccess: only when decision status isSUCCESS.onNoMatch: decision exists but is notSUCCESS.onError: technical/runtime failures.
Browser Requirements
- Browser runtime (camera APIs required).
- HTTPS context recommended/required by browser camera permissions policy.
- npm/bundler entrypoint:
dist/index.mjs - CDN/browser-global entrypoint:
dist/index.global.jsexposed aswindow.FaceAuth
License
Proprietary runtime-only license. See LICENSE.
Support
- Website:
https://www.face-auth.me - Support:
[email protected]
