Skip to main content

API Reference

Complete reference for the Azakaw Liveness Web SDK API.

Component Properties

Inputs

InputTypeDefaultRequiredDescription
session-idstringnullyesA short-lived session identifier minted by your backend. The SDK validates it server-side before starting capture.
host-originstringnulloptionalThe URL on which your web application is hosted.
environmentLivenessEnvironment (Sandbox | Production)ProductionoptionalTarget environment for the liveness session.
regionLivenessRegion (KSA | Qatar | UAE)UAEoptionalRegion in which the liveness session is processed.

Events

Event NameReturnsDescription
livenessChangeActionAzakawLivenessEventFired on liveness Actions
successAzakawLivenessResultFired when the user successfully completes the liveness check
failedAzakawLivenessResultFired when the liveness check fails

AzakawLivenessResult

The payload returned by the success and failed events. On a failed check, image and estimatedAge are null.

PropertiesTypeDescription
statusconfirmed | not_confirmed | unknownOutcome of the liveness check.
sessionIdstringThe session identifier associated with the liveness check.
transactionIdstringThe unique transaction identifier for this liveness attempt.
estimatedAgestring | nullThe estimated age of the user. null when the liveness check fails.
imagestring | nullThe captured selfie image (base64). null when the liveness check fails.

Actions

Event NameDescription
ELEMENT_VISIBLEThe component is appended to the DOM.
PRESS_START_BUTTONThe "Get started" button is pressed.
PRESS_RETRY_BUTTONThe "Retry" button is pressed.
CLOSEThe "Close" button is pressed.
PROCESS_FINISHEDThe component has finished its work.
SERVICE_INITIALIZEDThe component has started its work.
RETRY_COUNTER_EXCEEDEDThe component has finished its work because the number of transaction attempts was exceeded.

Translation

The list of labels used in the component:

LabelDefault message in en locale
showOnlyOneFaceMake sure there is only one face on the screen.
preparingCameraPreparing the camera...
allowAccessCameraAllow access to the camera
somethingWentWrongSomething went wrong
incorrectCameraIdNo camera with the specified ID found.
checkCameraIdCheck if the specified camera ID is correct.
preparingServicePreparing the service...
allowAccessToCameraAllow access to the camera and reload this page to continue.
errorError!
versionNotSupportedYour browser version is not supported.
updateBrowserUpdate your browser version
licenseErrorA license error has occurred
licenseExpiredThe license cannot be found or has expired
onlyPortraitOrientationPortrait orientation only
turnDeviceIntoPortraitPlease turn your device into portrait mode
tryAgainTry again
noCameraAvailableNo camera available
checkCameraConnectionCheck the camera connection and try again.
lookStraightLook straight
fitYourFaceCenter your face
moveCloserMove closer
moveAwayMove away
holdSteadyHold steady
takeAPhotoTake a selfie
processingProcessing...
retryButtonTextRetry
followGuidelinesTextBut please follow these guidelines:
letsTryAgainTitleLet's try that again
noCameraPermissionCamera unavailable!
goButtonGo
selfieTimeSelfie time!
ambientLightingAmbient lighting is not too bright or too dark and there are no shadows or glare on your face
noMaskSunglassesHeaddressNeutral facial expression (no smiling, eyes open and mouth closed), no mask, sunglasses or headwear
turnHeadTurn your head a bit
centerFaceTurnHeadCenter your face, turn your head
centerFaceCenter your face
errorCodeError code:
illuminationGood illumination.
cameraLevelCamera at eye level.
noAccessoriesNo accessories: glasses, mask, hat, etc.
getReadyGet ready
removeOcclusionRemove items covering your face
tooMuchTurnAvoid turning your head too much. A small turn is enough.
turnHeadUpTurn head up a bit to look straight
turnHeadDownTurn head down a bit to look straight
turnHeadLeftTurn head left a bit to look straight
turnHeadRightTurn head right a bit to look straight
configurationErrorTitleConfiguration error
configurationErrorMessagePlease provide a session-id on the <azakaw-liveness> element.
sessionExpiredTitleSession expired
sessionExpiredMessageThe authenticated session is no longer valid.
connectionErrorTitleConnection error
connectionErrorMessageWe could not reach the Azakaw service. Please check your connection and try again.
initializingSessionInitializing secure session…
retryActionRetry
startNewSessionActionStart a new session

Settings

Here are all the available settings:

SettingInfoData typeDefault valueValuesUsed in
localeLanguage of the component. The value is determined based on the following priority:

1. locale component attribute takes the highest priority if explicitly set.
2. If locale is not set, the system checks the html.lang attribute.
3. If no html.lang attribute is available, the system attempts to determine the language from window.navigator.
4. If none of the above are available, the default value en is used.
stringenru, en, de, pl, it, hu, zh, sk, uk, fr, es, pt, ar, nl, id, vi, ko, ms, ro, el, tr, ja, cs, th, hi, bn, he, fi, sv, da, hr, no, uzazakaw-liveness, face-capture
cameraIdAbility to select a camera by defining the camera ID.stringundefinedcamera id string valueazakaw-liveness, face-capture
changeCameraWhether to show the "Camera Switch" button. Note that if livenessType = 0 (active liveness), the button will not be displayed on mobile devices regardless of the changeCamera setting.booleantruetrue, falseazakaw-liveness, face-capture
startScreenWhether to show the Start screen with video instructions. If true, the start screen is shown. If false, no start screen is shown and instead the camera of the device is turned on automatically to capture a face.booleantruetrue, falseazakaw-liveness, face-capture
finishScreenWhether to show the Result screen (success screen, retry-screen). If true, the Result screen is shown to the user. If false, no Result screen is displayed, and, during a single session, the user has only one attempt to pass the liveness assessment.

In cases where finishScreen is set to false, we recommend monitoring the Events associated with the liveness assessment and then displaying relevant information to the user based on those events. This approach ensures that the user receives necessary feedback even though the Result screen is not displayed by the component itself.
booleantruetrue, falseazakaw-liveness, face-capture
closeDisabledWhether to disable the "Close" button of the component. If set to true, the "Close" button is hidden from the user.booleanfalsetrue, falseazakaw-liveness, face-capture
recordingProcessWhether to enable a video recording of the process. If set to 0, the video is sent to the server with an additional request. If set to 1, the video is sent to the server with the liveness package. If set to 2, the video isn't sent. The video format depends on the browser: MP4 for Safari, WEB for other browsers.number00, 1, 2azakaw-liveness
tagThe server generates a unique identifier for each session before starting a verification process. Using tag, you can set a custom value. Make sure that tag is unique for each session.stringundefinedany unique for each sessionazakaw-liveness
retryCountUsing the retryCount setter, you can set the number of liveness transaction attempts for the user. Once the attempts are exhausted, the component will display a white screen and throw the "RETRY_COUNTER_EXCEEDED" event. By default, the number of attempts is unlimited. Setting the value to 0 removes the limit on the number of attempts, while any positive number limits the attempts.numberundefinednumber of the attempts countazakaw-liveness
headersBefore starting the camera capture, the component sends a start request to the server and receives the initialization data in response. Once the component successfully completes two stages of verification, it sends the received data to the API for processing. You can use the headers setter to set the headers for the HTTP POST method. Additionally, the video recording is transmitted to the server along with these headers.objectundefinedobject with headers (key, value).azakaw-liveness
customizationYou can customize the element's color, font, and image by using this object. See the Customization section below.objectundefinedobject with customization settingsazakaw-liveness, face-capture
nonceYou can set a unique nonce value to maintain the CSP policy.stringundefinedunique nonce valueazakaw-liveness, face-capture
rotationAngleDesktop only. By using the rotationAngle setter, you can specify an angle to compensate for the rotation of your physical camera. When set to values of 90 and -90, the component's design will switch to a mobile (vertical) orientation.numberundefined0,180,90,-90azakaw-liveness, face-capture
holdStillDurationFor the Capture screen, sets the duration that the user needs to stand straight and look at the camera.numberundefinedsecondsface-capture
timeoutIntervalTimeout for the Capture screen.numberundefinedsecondsface-capture
livenessTypeYou can choose a scenario for the liveness assessment. 0 - active liveness, full process that requires head rotation; 1 - passive liveness, a person is asked to only take a selfie, no head rotation required.number00, 1azakaw-liveness
detectOcclusionWhether to disable the face occlusion hint.booleantruetrue, falseface-capture
tenantA label used to group transactions by specific customers, applications, or other criteria.stringundefinedtenantazakaw-liveness
envA label used to differentiate transactions by development stages.stringundefinedenvazakaw-liveness
captureButtonWhether to enable user-triggered capture. Shows the Capture button; desktop layout height increases accordingly. When enabled, the shot is taken only on user action.booleanfalsetrue, falseazakaw-liveness, face-capture

Customization

You can customize the color of some elements, fonts, and images with the help of the customization field in the settings object. The customization settings are the following:

SettingInfoMigrate fromData typeDefault value
fontFamilyFont.--font-familystringNoto Sans, sans-serif
fontSizeBase font size.--font-sizestring16px
onboardingScreenStartButtonBackgroundInstruction screen button background color.--main-colorstring#7E57C5
onboardingScreenStartButtonBackgroundHoverInstruction screen button background hover color.--hover-colorstring#7C45B4
onboardingScreenStartButtonTitleInstruction screen button text color.string#FFFFFF
onboardingScreenStartButtonTitleHoverInstruction screen button text hover color.string#FFFFFF
onboardingScreenIlluminationInstruction screen "Illumination" icon image.base64 or url or imported image``
onboardingScreenAccessoriesInstruction screen "No accessories" icon image.base64 or url or imported image``
onboardingScreenCameraLevelInstruction screen "Camera level" icon image.base64 or url or imported image``
cameraScreenFrontHintLabelBackgroundCamera screen plate with info message background color.--plate-colorstring#E8E8E8
cameraScreenFrontHintLabelTextCamera screen plate with info message text color.string#000000
cameraScreenSectorActiveUser progress sector color (available only in the azakaw-liveness component).string#7E57C5
cameraScreenSectorTargetTarget sector color (available only in the azakaw-liveness component).--target-sector-colorstring#BEABE2
cameraScreenStrokeNormalStroke color of the camera circle.string#7E57C5
cameraScreenStrokeWidthStroke width of the camera circle.number3
processingScreenProgressProcessing screen spinner color.string#7E57C5
retryScreenEnvironmentImageRetry screen environment image.base64 or url or imported image``
retryScreenPersonImageRetry screen person image.base64 or url or imported image``
retryScreenRetryButtonBackgroundRetry screen button background color.--main-colorstring#7E57C5
retryScreenRetryButtonBackgroundHoverRetry screen button background hover color.--hover-colorstring#7C45B4
retryScreenRetryButtonTitleRetry screen button text color.string#FFFFFF
retryScreenRetryButtonTitleHoverRetry screen button text hover color.string#FFFFFF
successScreenImageSuccess screen image.base64 or url or imported image``