Web SDK Overview
FaceAuthen has no standalone web SDK. It reuses the CAKE eKYC Web SDK — the same window.ekyc bundle — calling scanStart(['face']) with FaceAuthen options. This page covers only the face-authentication path.
Platform
| What | Description |
|---|---|
| Browser | Runs in modern browsers and inside WebViews. Requires HTTPS and camera permission. |
| WebView | On iOS WebViews, enable inline media playback — allowsInlineMediaPlayback in Flutter and React Native. |
| Node Engine | >= 20 to build the bundle. |
Current version 1.3.20. Face detection runs on-device via @vladmandic/human and TensorFlow.js, so a blurred or occluded selfie is rejected before any upload.
What the SDK Does For FaceAuthen
scanStart(['face'], opts) → capture → upload → face sanity → livenessThe result gives you image IDs that already passed quality and liveness. Those feed the two FaceAuthen calls your backend makes:
| What | Description |
|---|---|
| Register Faces | First enrolment. |
| Verify Face Authen | Every subsequent authentication. |
The class-based API also exposes verifyFaceAuthentication directly — see Web SDK Integration.
FaceAuthen Scan Options
scanStart takes options that exist specifically for face authentication.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
faceauthClientId | string | No | — | Client ID for face authentication. |
faceauthRefId | string | No | — | Reference ID for face authentication. |
isNTB | boolean | No | — | New-to-Bank customer flag. Distinguishes a first enrolment from a returning user. |
timeoutDuration | number | No | — | Timeout in milliseconds. |
currentZoom | number | No | — | Current zoom level. |
isNTB is what separates the two flows: true routes to enrolment, false to authentication against the existing profile.
Common Configuration
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
baseUrl | string | Yes | — | Base URL for API requests. |
token | string | Yes | — | Authentication token. Fetch it from your backend at runtime. |
resourcePath | string | No | — | Path to SDK resources. |
headers | Record<string, string> | No | — | Additional HTTP headers. |
WARNING
Fetch token from your backend at runtime — never hardcode it in the page. The Access Key must never reach the browser; see Request Signing for how the SDK signs with a per-transaction JWT instead.
SDK Error Codes
Raised by the SDK itself, separate from the FaceAuthen API codes.
| Field | Type | Description |
|---|---|---|
60002 | FACE_SANITY_FAILED | Face sanity check failed. |
60003 | FACE_LIVENESS_FAILED | Face liveness check failed. |
The NID codes 60000 and 60001 exist in the same bundle but never fire in a FaceAuthen flow.
Responses may also carry sdkError:
sdkError?: { code: string; message: string } | {}
// {} -> no SDK-side error
// {code,message} -> the SDK detected a failure you should handleWARNING
A resolved promise is not a pass. Check the error array and sdkError on every response — a successful-looking result can still carry a failed sanity or liveness verdict.
APIs Used
| What | Description |
|---|---|
| Upload Image | Every captured selfie is uploaded before any check runs. |
| Face sanity and liveness | Run through the eKYC endpoints the SDK calls internally. |
| Verify Face Authen | The FaceAuthen verification your backend performs. |
| Verify Transaction Key | Redeems the authentication_key and closes the transaction. |
Next Steps
- Web SDK Integration — setup, scanning and error handling
- Register Faces — enrol the captured image IDs
- Verify Face Authen — authenticate with a fresh capture