Prove a real person is present, then check who they are.
Facededup runs liveness and anti-spoofing on the device and on our servers, then lets you match the live face against NIN, BVN, a document or an enrolled face. Drop in an SDK for capture, verify the signed result on your server, and you're done.
Products
| Product | What it answers | Endpoints |
|---|---|---|
| Liveness | Is a live human physically in front of the camera, right now? | /v1/verify and its setup calls |
| Identity | Does this face match the NIN or BVN record? | /v1/identity/verify, /search |
| Documents | Is the passport or ID valid, and is it this person? | /v1/document/mrz, /verify |
| Face enrollment | Is this the same person who enrolled before, and have we seen this face under another account? | /v1/face/enroll, /authenticate, /dedup |
| Address | Was the person at the address they declared? | /v1/address/verify |
Base URL for every request: https://facededup.ai. All requests and responses are JSON over HTTPS, and images are sent as base64-encoded JPEG or PNG.
Quickstart
Each step is one call and the response you should see. Use your sandbox key throughout.
Get your keys
Your Facededup account team issues a sandbox key (starts with
fdk_test_) and a live key. Store them as a secret on your server, for example in an environment variable calledFACEDEDUP_KEY. Never ship the live key inside a mobile app's source.Say hello
Confirm you can reach the API. This call needs no key.
Check your key
Any call that needs a key returns
401when the key is missing or unknown. Reading your webhook settings is a safe first authenticated call, and the response names your tenant.Run a liveness check
Drop the capture UI into your page. It handles the camera, the head-movement challenges and the API calls, then gives you the result.
checkout.html · web SDKimport { mountLiveness } from "@facededup/liveness-web"; mountLiveness(document.getElementById("kyc"), { baseUrl: "https://facededup.ai", licenseKey: "fdk_test_…", // sandbox key subjectId: "user_8231", // your ID for this person onResult: async (r) => { // r.outcome: "live" | "not_live" | "referred" // Send the signed token to YOUR server; don't trust r.outcome alone. await fetch("/kyc/liveness", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ token: r.signed_result?.token }), }); }, });Using a mobile app? See React Native, Flutter, Android or iOS.
Confirm the result on your server
Redeem the token with your key. It's valid for 120 seconds and can be redeemed once, so a captured token can't be replayed. Only grant access when
payload.outcomeis"live".
Authentication
Send your key in the X-License-Key header on every request. The key decides which tenant the call belongs to, so a tenant_id in the request body is ignored whenever a key is present.
A WebView that can't set headers may pass the key as a query parameter instead: ?license=fdk_…. Prefer the header everywhere else, because query strings end up in logs.
X-License-Key: fdk_test_4f1c…
{ "detail": "a license key is required to configure webhooks" }Sandbox & live
Sandbox and live use the same base URL. The key decides the environment: a key beginning fdk_test_ (or sk_test_) marks the call as sandbox, and any other valid key is live. Sandbox calls run the full liveness engine, so test with real people and real devices, not photos.
| Sandbox | Live | |
|---|---|---|
| Key prefix | fdk_test_ | fdk_ (no test) |
| Base URL | https://facededup.ai | |
| Decisions | Tagged sandbox in your records | Tagged production |
How a liveness check works
The SDKs make these calls for you. Call them yourself only if you build your own capture. They must happen in this order, and all of them share one request_id.
| Step | Caller | Call | Returns |
|---|---|---|---|
| 1 | SDK | POST /v1/consent | consent_id |
| 2 | SDK | POST /v1/request | request_id |
| 3 | SDK | POST /v1/challenge | actions and nonce, valid 20 s |
| 4 | SDK | POST /v1/verify with frames | outcome and signed_result.token |
| 5 | Your server | POST /v1/result/redeem | valid and the outcome |
What we check
On the device, the SDK coaches positioning, confirms each action and looks for screen replays. On our servers, we re-check the actions in the frames you send, look for print, screen and injected-video attacks, and, on supported iPhones, require real 3D depth from the TrueDepth camera. Every decision is written to a tamper-evident, hash-chained audit log.
Trusting results on your server
A result that passes through the browser or app can be edited. Every /v1/verify response therefore carries signed_result.token, an Ed25519-signed statement of the outcome. Confirm it on your server in one of two ways.
Option A · redeem (recommended)
Send the token to POST /v1/result/redeem. We check the signature and expiry, and enforce single use, so a stolen token is useless after its first redemption.
Option B · verify offline
Fetch our public key once from GET /v1/result/public-key and verify the signature yourself. This works without a network call per check, but it can't enforce single use, so record redeemed decision_ids on your side.
The token is base64url-encoded JSON: {"payload": {…}, "sig": "…"}. The signature covers the payload serialised with sorted keys and no spaces.
{
"request_id": "9f0c4c1e-6a1d-4f7e-9d0b-2a5c8e1f3b77",
"decision_id": "d3b7a2e4-1c5f-4a8e-b6d9-7e2f0c1a9b44",
"subject_id": "user_8231",
"outcome": "live",
"score": 0.9132,
"threshold_version": "2026-06-07.1",
"issued_at": "2026-11-25T10:42:07Z",
"expires_at": "2026-11-25T10:44:07Z",
"single_use": true
}payload_json, or as encrypted_payload when your account uses tenant encryption. Only your private key can decrypt it.Webhooks
Register one HTTPS endpoint per tenant with POST /v1/webhook. The response includes a signing secret (whsec_…) that's shown once, so store it straight away.
Webhooks are sent for checks submitted through offline capture, where the verdict arrives after the person has left. For live checks, use the response from /v1/verify directly.
Verify every delivery
Each POST carries X-Facededup-Signature: sha256=<hex>, the HMAC-SHA256 of the raw request body using your secret. Compute it over the exact bytes you received, before parsing the JSON, and compare in constant time. We time out after 8 seconds, so acknowledge quickly and do slow work afterwards.
{
"event": "liveness.decision",
"client_txn_id": "agent-07-000412",
"decision_id": "d3b7a2e4-1c5f-4a8e-b6d9-7e2f0c1a9b44",
"subject_id": "user_8231",
"outcome": "live",
"is_live": true,
"score": 0.9132,
"threshold": 0.6,
"tenant": "acme",
"captured_at": "2026-11-25T09:58:11Z",
"submitted_at": "2026-11-25T10:42:07Z",
"offline": true,
"metadata": { "branch": "Ikeja" }
}import crypto from "node:crypto";
// rawBody: the exact bytes received (Buffer), before JSON.parse
function isFromFacededup(rawBody, header, secret) {
const expected = "sha256=" + crypto
.createHmac("sha256", secret).update(rawBody).digest("hex");
const a = Buffer.from(expected), b = Buffer.from(header || "");
return a.length === b.length && crypto.timingSafeEqual(a, b);
}Outcomes & score bands
Liveness outcome
| outcome | Meaning | What to do |
|---|---|---|
| live | A live person completed the challenge and passed every anti-spoofing check. | Continue, after you've confirmed the token. |
| not_live | Liveness wasn't proven: a likely spoof, a failed challenge, or a borderline score. | Let the person retry with better light and a steadier phone, up to max_attempts. |
| referred | Sent to a human: attempts ran out, or you used the assisted route. | Hold the account and wait for a review decision. |
score is a number from 0 to 1. The threshold is 0.6 at baseline risk and 0.8 at stepup.
Face match bands (identity, documents, enrollment)
match_score runs from 0 to 100.
Send refer results to a person for manual review rather than rejecting them outright.
Web
@facededup/liveness-web 0.2.2. A drop-in capture UI with on-device face tracking, plus a headless client if you want to build your own UI. Requires HTTPS (or localhost), camera permission, and a click before capture starts. The built-in Start button provides that click.
Useful options: brandColor, language (en or pcm), showBranding, onError.
npm i https://swiftend-assets-348761024048.s3.eu-west-2.amazonaws.com/sdk/npm/facededup-liveness-web-0.2.2.tgz
import { FacededupLiveness } from "@facededup/liveness-web/react";
<FacededupLiveness
baseUrl="https://facededup.ai"
licenseKey={KEY}
subjectId={userId}
onResult={(r) => (r.is_live ? next(r) : retry(r))}
/>React Native
@facededup/liveness-react-native 2.0.0-beta.66, wrapping the native SDK 2.0.0-beta.62. Runs the full native capture flow with no WebView, on React Native 0.74 to 0.86+ in both the old and new architecture.
Android setup: set minSdkVersion 24, and add the Facededup Maven repository to allprojects.repositories in your root android/build.gradle: https://swiftend-assets-348761024048.s3.eu-west-2.amazonaws.com/m2
iOS: the framework ships inside the package, so pod install is enough. Add NSCameraUsageDescription to Info.plist.
npm install @facededup/liveness-react-native cd ios && pod install
import { startLiveness } from "@facededup/liveness-react-native";
const r = await startLiveness({
baseUrl: "https://facededup.ai",
subjectId: "user_8231",
licenseCert: "…", // issued by your account team
showBranding: false, // optional: remove the NINAuth mark
});
// r.outcome: "live" | "not_live" | "referred" | "captured" | "cancelled" | "error"Flutter
facededup_liveness 2.0.0-beta.62. The same native capture flow as React Native. Android needs minSdkVersion 24 and the Facededup Maven repository; iOS needs pod install.
dependencies:
facededup_liveness: ^2.0.0-beta.62
final r = await FacededupLiveness.start(LivenessConfig(
baseUrl: 'https://facededup.ai',
subjectId: 'user_8231',
licenseCert: '…',
));
if (r.outcome == 'live') { /* continue */ }Android
ng.facededup:facededup-live 2.0.0-beta.62. Kotlin with Jetpack Compose, CameraX and ML Kit. Minimum SDK 24. Launch it as a ready-made activity, or embed the composable screen in your own UI.
repositories {
maven { url = uri("https://swiftend-assets-348761024048.s3.eu-west-2.amazonaws.com/m2") }
}
dependencies {
implementation("ng.facededup:facededup-live:2.0.0-beta.62")
}LivenessScreen(
config = FacededupConfig(baseUrl = "https://facededup.ai", subjectId = "user_8231"),
onResult = { r -> if (r.isLive) proceed() else retry() },
onCancel = { finish() },
)iOS
FacededupLive 2.0.0-beta.62. Swift and SwiftUI with AVFoundation and Vision; on Face ID iPhones it uses ARKit and the TrueDepth camera. iOS 14.3+. Set requireDepth: true to fail any capture that shows no real 3D depth on TrueDepth devices. Other iPhones fall back to the standard checks.
import FacededupLive
FacededupLiveness(config: FacededupConfig(
baseURL: "https://facededup.ai",
subjectId: "user_8231",
requireDepth: true // optional TrueDepth anti-spoof gate
)) { result in
// result.outcome: "live" | "not_live" | "referred" | "captured" | "error"
} onCancel: { dismiss() }Errors
Errors use standard HTTP status codes and a JSON body with a detail field. detail is usually a string; a few errors return an object with more context, shown below.
| Status | Usually means | What to do |
|---|---|---|
400 | A field has an invalid value, or a token couldn't be redeemed: bad signature, expired, or already used. | Fix the field named in detail. For tokens, run a fresh check instead of retrying the redeem. |
401 | The key is missing or unknown. | Send X-License-Key with a valid key, and check that sandbox and live keys aren't mixed up. |
403 | Consent is missing, refused or withdrawn; the challenge expired, was already used, or the nonce doesn't match; attempts are exhausted; or the risk engine denied the request. | Call /v1/challenge again (it lasts 20 s). If detail.error mentions risk, read detail.reasons. |
404 | The request_id, enrollment or place doesn't exist, or the feature isn't enabled for your account. | Check the ID came from the same environment (sandbox or live) as your key. |
409 | The face is already enrolled under another account. | Read detail.dedup and route the case to review. |
422 | Validation failed: a bad field type, more than 30 frames, no readable face, a NIN or BVN that isn't 11 digits, or poor image quality. | For quality, detail.findings says what to fix (light, blur, framing). Let the person retry. |
423 | The request is locked after too many attempts. | Start a new check with /v1/request, or refer the person to a human. |
503 | A dependency isn't available or isn't configured for your account. | Retry with backoff. If it persists, contact support with the time and request_id. |
{ "detail": "challenge expired" }{ "detail": {
"error": "low_quality",
"findings": ["too_dark", "face_too_small"],
"attempts": 2,
"referred": false
} }Changelog
| Release | Change |
|---|---|
| Native 2.0.0-beta.62 | showBranding option to remove the NINAuth mark. iOS adds requireDepth, a TrueDepth 3D-depth anti-spoof gate. |
| React Native beta.66 | Builds on React Native 0.86. The iOS framework ships inside the npm package, so there's no download step. Removed an unused codegenConfig. |
| Web 0.2.2 | Face-centred frames and deeper motion proofs, fixing false not_live results on desktop webcams. |