Skip to content

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 ​

WhatDescription
BrowserRuns in modern browsers and inside WebViews. Requires HTTPS and camera permission.
WebViewOn 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 ​

text
scanStart(['face'], opts)  →  capture → upload → face sanity → liveness

The result gives you image IDs that already passed quality and liveness. Those feed the two FaceAuthen calls your backend makes:

WhatDescription
Register FacesFirst enrolment.
Verify Face AuthenEvery 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.

ParamTypeRequiredDefaultDescription
faceauthClientIdstringNo—Client ID for face authentication.
faceauthRefIdstringNo—Reference ID for face authentication.
isNTBbooleanNo—New-to-Bank customer flag. Distinguishes a first enrolment from a returning user.
timeoutDurationnumberNo—Timeout in milliseconds.
currentZoomnumberNo—Current zoom level.

isNTB is what separates the two flows: true routes to enrolment, false to authentication against the existing profile.

Common Configuration ​

ParamTypeRequiredDefaultDescription
baseUrlstringYes—Base URL for API requests.
tokenstringYes—Authentication token. Fetch it from your backend at runtime.
resourcePathstringNo—Path to SDK resources.
headersRecord<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.

FieldTypeDescription
60002FACE_SANITY_FAILEDFace sanity check failed.
60003FACE_LIVENESS_FAILEDFace 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:

typescript
sdkError?: { code: string; message: string } | {}
// {}             -> no SDK-side error
// {code,message} -> the SDK detected a failure you should handle

WARNING

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 ​

WhatDescription
Upload ImageEvery captured selfie is uploaded before any check runs.
Face sanity and livenessRun through the eKYC endpoints the SDK calls internally.
Verify Face AuthenThe FaceAuthen verification your backend performs.
Verify Transaction KeyRedeems the authentication_key and closes the transaction.

Next Steps ​

Developers