@facegate/sdk
v0.2.7
Published
Stop credential sharing with privacy-preserving face authentication
Maintainers
Readme
@facegate/sdk
Stop credential sharing with privacy-preserving face authentication.
Zero biometric data stored. One API key. Four functions.
Install
npm install @facegate/sdk @worldcoin/idkit
@worldcoin/idkitmust be installed directly in your app alongside this SDK. Due to a WebAssembly bundler constraint, the IDKit QR widget cannot be resolved from a nested dependency — it must be a direct dependency of your app.
Quick Start
Get your API key at face-gate-ecru.vercel.app
import { FaceGate } from '@facegate/sdk'
const gate = new FaceGate({ apiKey: 'fg_live_xxx' })
// Check if user is enrolled
const { enrolled } = await gate.check(userId)
// New user — get enrollment data for IDKit widget
const enrollData = await gate.enroll(userId)
// After user completes Selfie Check — confirm enrollment
await gate.confirm(userId, idkitProof)
// Returning user — verify same face
const { authorized } = await gate.verify(userId, idkitProof)How it works
- User visits your app → call
check()→ not enrolled - Call
enroll()→ get QR data → show IDKit widget - User scans with World App → Selfie Check runs
- Call
confirm()→ face enrolled, nullifier stored - User returns → call
verify()→ same face → authorized - Different face → different nullifier → blocked
Privacy
- Zero biometric data stored anywhere
- Only cryptographic nullifiers stored
- Built on World ID Selfie Check
