Skip to main content

The ZaigWebFaceRecon.WebFaceRecon() constructor

The .WebFaceRecon() method is responsible for configuring the instance of your facial recognition component. Starting from version 4.0.0, the constructor takes no parameters — rendering is managed internally by the SDK. Use the chained methods below to customize its behavior:

NameDescriptionRequired
.setSandboxEnvironment()Configures the environment to Sandbox mode.No
.setShowInvalidTokenScreen(Boolean)Defines whether the authentication failure screen should be displayed. Default: false.No
.setShowBackButton(Boolean)Defines whether the back button should be displayed (when pressed, ends the flow). Default: true.No
.setSessionId(String)Defines the key that identifies the session started in the SDK — used to track the user's flow through logs. Accepts up to 255 characters.No
.setThemeConfiguration(object)Customizes the visual identity of the SDK.No
.setLogLevel(String)Verbosity level of logs. Options: "info", "debug", "warn", "error". Default: "info".No
.setCameraNotAllowedErrorDescription(String)Custom message displayed when the user denies camera permission.No

The .setThemeConfiguration method must receive an object with the following fields:

NameTypeDescription
primaryColorStringHexadecimal of the SDK's primary color (background, header). Default: #285BB8.
tertiaryColorStringHexadecimal of the action button color. Default: #57D9FF.
fontFamilyStringFont Family to be applied to SDK text. If not provided, the system default font will be used.

Previous Versions

Important Warning!

Starting from version 4.0.0, the hostComponent parameter and web_token in the constructor were removed. The SDK manages its own DOM node internally.

In versions prior to 4.0.0, the constructor received the following positional parameters:

NameDescriptionRequired
hostComponentParent HTML component that housed the SDK HTML.Yes
web_tokenClient key sent by QI Tech.Yes (versions < 3.0.0)