Skip to content

@haut.ai/liqa

Component

LiqaEventMap

ts
type LiqaEventMap = object;

LIQA DOM event names and corresponding event details.

Properties

PropertyTypeDescription

init

void

Fired when LIQA has finished initializing

ready

void

Fired when LIQA has finished loading preset's resources for image processing and is ready to operate.

loaded

void

Fired when LIQA has finished loading its resources and is ready to operate.

Alias

ready

Deprecated

Use the ready event instead.

capture

ImageCapture

Fired once for each image after all AI quality criteria pass and the user submits the image. The image can be obtained via the event.detail ImageCapture interface.

Note: For face-180 preset this event is dispatched once per side capture (front, left and right). The captured side is written to image metadata. An example how to handle it is on Collection of Images page.

Deprecated

Use the captures event instead.

captures

ImageCapture[]

Fired when all AI quality criteria pass and the user submits the image collection. The images can be obtained via the event.detail array of ImageCapture objects.

Note: For face-180 preset this array contains the side captures (front, left and right). The captured side is written to image metadata.

analytics

AnalyticsDetails

Fired when a customer-trackable analytics event occurs.

The detail shape is { name, payload }. Trackable analytics events such as photo_capture and photo_upload are exposed through this single DOM event as event.detail.name; they are not dispatched as standalone DOM events.

error

LiqaError

Fired when a LiqaError occurs.

close

void

Fired when the user requests to close LIQA.


DEVICE_CAPABILITY_REASON

ts
const DEVICE_CAPABILITY_REASON: object;

Type Declaration

NameTypeDefault valueDescription
UNSUPPORTED_DEVICE"unsupported-device""unsupported-device"Not a phone — desktops, tablets (including iPads), and unrecognized devices.
UNSUPPORTED_OS"unsupported-os""unsupported-os"A phone, but not running iOS or Android.
OUTDATED_OS"outdated-os""outdated-os"The OS is below the supported floor, or (on iOS) its version could not be determined.
MISSING_BROWSER_FEATURES"missing-browser-features""missing-browser-features"The browser lacks WebAssembly, WebAssembly SIMD, or WebGL2.
INSUFFICIENT_MEMORY"insufficient-memory""insufficient-memory"The device reports too little memory for the analysis pipeline.
INSUFFICIENT_CAMERA"insufficient-camera""insufficient-camera"The front camera is missing or its resolution is below the minimum (camera probe only).
CAMERA_UNAVAILABLE"camera-unavailable""camera-unavailable"The camera could not be verified — permission denied, camera busy, or a blocked context (camera probe only). Unlike the other reasons this one is retryable: ask the participant to allow camera access or close other camera apps, then run the check again.

DeviceCapabilityReason

ts
type DeviceCapabilityReason = typeof DEVICE_CAPABILITY_REASON[keyof typeof DEVICE_CAPABILITY_REASON];

DeviceCapabilityResult

ts
type DeviceCapabilityResult = object;

Properties

PropertyTypeDescription

capable

boolean

true when every applicable check passed.

reasons

DeviceCapabilityReason[]

Every check that failed — empty when capable. Camera reasons (insufficient-camera, camera-unavailable) can appear only for { camera: true } calls on Android, and only when all static checks passed (a rejected device is never prompted for its camera).


DeviceCapabilityOptions

ts
type DeviceCapabilityOptions = object;

Properties

PropertyTypeDescription

camera?

boolean

Also verify the front (selfie) camera on Android — the camera LIQA captures with — by checking its resolution. This opens the camera once, so it triggers a permission prompt. Ignored on iOS, where every phone passing the OS floor has a sufficient front camera.


checkDeviceCapability()

ts
function checkDeviceCapability(options?): Promise<DeviceCapabilityResult>;

Checks whether the current device is good enough for LIQA to capture a good-quality photo and reports every failed check, so the caller can tell the participant what to do next (switch to a phone, update the OS, allow camera access, …).

The static checks — phone-class device, iOS/Android with a supported version, WebAssembly, SIMD, WebGL2, device memory where measurable — run without opening the camera. Pass { camera: true } to additionally verify the front (selfie) camera on Android; this opens the camera once and prompts for permission. On iOS the camera is implied by the OS floor and is never probed.

Browser-only: throws when called outside a browser (e.g. during server-side rendering) instead of returning a false "not capable" verdict for a device that was never inspected.

Parameters

options?

DeviceCapabilityOptions

Returns

Promise<DeviceCapabilityResult>


FEATURE

ts
const FEATURE: object;

Type Declaration

NameTypeDefault value
TUTORIAL"tutorial""tutorial"

Feature

ts
type Feature = typeof FEATURE[keyof typeof FEATURE];

LiqaAttributes

ts
type LiqaAttributes = object;

LIQA Web component HTML attributes to configure the component look and behavior.

Example

html
<hautai-liqa
  license="xxx-xxx-xxx"
  styles="@import url('/path/to/custom-liqa-styles.css')"
>
</hautai-liqa>

Properties

PropertyTypeDescription

license

string

The license key obtained from Haut.ai.

styles?

string

A string containing valid CSS rules. For more information, see Styles page.

Example

ts
"@import url('/path/to/custom-liqa-styles.css')"

use-iframe?

boolean | "true" | "false"

Render LIQA inside an iframe instead of Shadow DOM.

Default

ts
false

lang?

string

Language or locale code to use for the UI texts. Falls back to the base language and then to English if an exact locale is unavailable.

Default

ts
"en"

i18n?

string

A string containing a valid JSON object with text overrides. Supports global overrides and/or per-language overrides. For more information, see Text Messages page.

Example

ts
"{ \"fr\": {\"preview\": { \"submit\": \"Confirmer\" } }, \"preview\": { \"submit\": \"Confirm\" } }"

preset?

"face" | "face-180" | "hair"

A preset used to customize AI quality criteria and user flow. For more information, see Presets page.

Default

ts
"face"

mode?

"normal" | "max-quality"

Capture quality mode.

  • "normal": the camera runs at the standard resolution (up to 2K).
  • "max-quality": LIQA requests the camera‘s maximum resolution (up to 4K). The higher resolution may reduce the live-guidance frame rate on some devices.

Default

ts
"normal"

audio?

"off" | "on" | "auto"

Voice guidance for the live-video camera session, spoken via the browser Web Speech API.

  • "off" (default): no voice guidance. Identical to omitting the attribute.
  • "on": speaks real-time live-video guidance. The spoken language follows the lang attribute; if lang is unset it falls back to the device's default language. If the device has no voice for the resolved language, voice is silently suppressed (text guidance is unaffected). When the browser has no Web Speech API support, behaves exactly like "off" (no errors).
  • "auto": shows an opt-in speaker control on the live-video screen; off until the user enables it. No voice control is shown on the source-selection screen.

WebView support varies: Android System WebView and some React Native / Flutter WebViews report the API as present but emit no audio; iOS WKWebView support depends on the host app's audio session and the device silent switch. Voice guidance is strictly additive — visual text guidance is always shown.

Default

ts
"off"

sources?

Sources

A list of sources to capture the image from: different device cameras or file upload. They can be combined using , separator. Visit the corresponding user flow customization section to learn about their logic and limitations.

Default

ts
"front_camera"

Alias

"camera" Starting from 6.7.0 version "camera" acts as an alias for "front_camera".

Note: For face-180 preset only "front_camera" and "companion" sources are available. The rest will be ignored.

capture?

"auto" | "manual"

Image capture mode for "camera" source.

  • "auto": LIQA will automatically take a photo when all AI quality criteria are met.
  • "manual": LIQA will allow the user to take a photo on their own via a button.

Note: The option is configurable only for "hair" preset. Other presets are always "auto".

required-lighting?

"none" | "adaptive" | "default"

Lighting requirements for the image capture.

  • "none": no requirements are set and lighting will not be validated. (WARNING: the quality of the processing results may be affected)
  • "adaptive": the requirements will be softened if the lighting conditions are poor.
  • "default": the requirements will be set to optimal which will provide more details on the photo.

Note: The option is only applicable to "face" preset. For other presets it is always "default".

Default

ts
"default"

postprocessing?

string

Image post-processing settings.

Accepts a comma-separated list of flags:

  • "original": the image from "capture" will not be processed.
  • "anonymized": the image from "capture" will be anonymized (only skin mask will be returned).
  • "color-correction-coefficients": the image from "capture" will include color correction coefficients.

Default

ts
"original"

effects?

boolean | "true" | "false"

A flag to enable or disable the effects during the image capture process.

Default

ts
true

tutorial?

string | "off" | "image" | "video"

A flag to enable or disable tutorial option on the Source Selection screen.

Regular tutorial/banner flows require the sources option to contain a camera source ("front_camera" or "back_camera") and "upload". With entry-point="tutorial-alt", tutorial can also be shown for camera-only configs.

  • "off": no tutorial will be shown.
  • "video": a video tutorial will be shown.
  • "image": an image tutorial will be shown. Can be used as a fallback for reducing the loading time.
  • "[{\"src\":\"https://...\",\"hint\":\"...\"}]": a JSON-serialized custom tutorial with ordered steps.

Default

ts
"off"

step-order?

string

A comma-separated order for built-in tutorial steps.

Face and face-180 presets accept: glasses-off,hair-away-from-face,makeup-off,good-lighting

Hair preset accepts: hair-well-lit,hair-forward,hair-dry

The value must include every step for the selected preset exactly once. Invalid values fall back to the default order and emit a console warning. Custom tutorial arrays keep the order from the JSON array and ignore this attribute.

Example

ts
`"good-lighting,glasses-off,hair-away-from-face,makeup-off"`

Default

ts
preset-specific default tutorial order

entry-point?

"capture" | "tutorial" | "tutorial-alt"

A flag to set the entry point of the LIQA.

  • "capture": the entry point will be set to the capture screen.
  • "tutorial": the entry point will be set to the tutorial screen.
  • "tutorial-alt": the entry point will be set to the source selection screen with the tutorial shown immediately (with a framed tutorial layout on desktop). Requires tutorial to be enabled and a camera source to be available.

Default

ts
"capture"

quality-check?

"off" | "normal" | "strict"

A flag to set the quality check behavior.

  • off: disables the configurable quality-check policy.
  • normal: shows detected issues to the user but still allows submission.
  • strict: shows detected issues and blocks submission until the required checks pass.

Live guidance is available for the "face" and "face-180" presets. Post-capture preview validation is available for "face" and for front, left, and right captures in "face-180". For supported presets, this already includes glasses and forehead checks in live validation and in post-capture validation where available.

Default

ts
"off"

occlusion-detection?

"off" | "normal" | "strict" | "live"

A flag to set the occlusion detection behavior.

  • off: skips occlusion detection completely.
  • strict: runs occlusion detection after capture; occlusion issues block submission.
  • normal: runs occlusion detection after capture; occlusion issues are shown as a warning but do not block submission.
  • live: runs lightweight occlusion checks during live camera capture; for non-camera sources (upload, companion) occlusion checks still run after capture.

Available for the "face" and "face-180" presets. Use this when you want glasses / forehead validation without enabling the full quality-check flow. If quality-check is already enabled, glasses and forehead checks are already included for supported presets.

Detection signals:

  • Flags >35% forehead coverage (bangs/hat/brim).
  • Flags glasses; detection aims for sensitivity and may not be perfect in all cases.

Default

ts
"off"

quality-check-sources?

Sources

An array specifying which capture sources should enforce quality checks.

The quality-check behavior (set via the quality-check property) will only be applied for the sources included in this array. This option does not scope explicit occlusion-detection.

Available values are:

  • front_camera: Enforces quality check on images captured from the front camera.
  • back_camera: Enforces quality check on images captured from the back camera.
  • upload: Enforces quality check on images provided via file upload.
  • companion: Enforces quality check on images captured via a companion source.

If not provided, quality checks will be applied for all sources.

Default

ts
["front_camera","back_camera","upload","companion"]

ignored-quality-checks?

string

A comma-separated list of post-capture quality checks to ignore.

Ignored checks are excluded from preview issues, blocking logic, and the resulting quality_check payload after capture. Live guidance is not affected.

Available values are:

  • enough_skin
  • pose
  • resolution
  • blur
  • occlusions
  • glasses
  • forehead
  • exposure
  • uniform_illumination
  • shadows

Example

ts
`"shadows,uniform_illumination"`

Default

ts
""

best-frame-selection?

"true" | "false"

A flag to enable or disable best frame selection during image capture.

When enabled, LIQA will track multiple frames during the capture process and automatically select the frame with the highest quality metrics.

Default

ts
"true"

character?

string | "false"

A character ID to use Accepts a number corresponding to a specific character.

Example

ts
`"0"`

Default

ts
false

tutorial-character?

string | "false"

A character ID to use in tutorials Accepts a number corresponding to a specific character.

Example

ts
`"0"`

Default

ts
false

LiqaElement

LIQA Web component available as <hautai-liqa></hautai-liqa> tag.

Example

html
<hautai-liqa license="xxx-xxx-xxx"></hautai-liqa>

Extends

  • any

Methods

upload()
Call Signature
ts
upload(files): void;

Programmatically uploads one or more files to LIQA, bypassing the manual file selection UI.

Can be called before the ready event (even before the element is connected): the files are buffered and delivered once LIQA has booted. Programmatic upload does not require the upload source — sources only controls LIQA-rendered source buttons/fallbacks. To keep LIQA from requesting the camera in an upload-only integration, include upload in sources.

Parameters
files

File | File[]

A single File (or array of Files) to upload.

Returns

void

Example
js
// Upload a single file
liqa.upload(file)

// Upload multiple files programmatically
const files = [file1, file2, file3]
liqa.upload(files)
Call Signature
ts
upload(files): void;

Programmatically uploads one or more files to LIQA.

Parameters
files

File | File[]

Returns

void

reset()
Call Signature
ts
reset(): Promise<void>;

Programmatically resets LIQA to its initial state, clearing any captured images and stopping the camera.

Returns

Promise<void>

Example
js
// Reset LIQA to start over
liqa.reset()
Call Signature
ts
reset(): Promise<void>;

Programmatically resets LIQA to its initial state and resolves after the new session is ready.

Returns

Promise<void>

checkDeviceCapability()
Call Signature
ts
checkDeviceCapability(options?): Promise<DeviceCapabilityResult>;

Checks whether the current device is good enough for LIQA to capture a good-quality photo. Resolves to { capable, reasons }, where reasons names every failed check. The default check does not open the camera; pass { camera: true } to also verify the front camera on Android (this prompts for permission).

Parameters
options?

DeviceCapabilityOptions

Returns

Promise<DeviceCapabilityResult>

Call Signature
ts
checkDeviceCapability(options?): Promise<DeviceCapabilityResult>;

Checks whether the current device is good enough for LIQA capture, with per-check reasons.

Parameters
options?

DeviceCapabilityOptions

Returns

Promise<DeviceCapabilityResult>

addEventListener()
ts
addEventListener<K>(
   type, 
   listener, 
   options?): void;

Subscribes the event listener to the given LIQA event.

Type Parameters
K

K extends keyof LiqaEventMap

Parameters
type

K

listener

(this, ev) => any

options?

any

Returns

void

removeEventListener()
ts
removeEventListener<K>(
   type, 
   listener, 
   options?): void;

Unsubscribes the event listener from the given LIQA event.

Type Parameters
K

K extends keyof LiqaEventMap

Parameters
type

K

listener

(this, ev) => any

options?

boolean | EventListenerOptions

Returns

void

Component (imperative)

Liqa()

ts
function Liqa(config): LiqaElement;

An imperative way to create LIQA web component.

Parameters

config

LiqaConfig

Returns

LiqaElement

Example

javascript
const liqa = new Liqa({
  license: "xxx-xxx-xxx",
  target: document.querySelector("#liqa-container"),
  styles: "@import url('/path/to/custom-liqa-styles.css')"
})

Deprecated

Use the <hautai-liqa> web component instead.


LiqaConfig

ts
type LiqaConfig = object;

Options to configure the LIQA‘s look and behavior.

Deprecated

Use the <hautai-liqa> web component with the LiqaAttributes instead.

Properties

PropertyTypeDescription

license

string

The license key obtained from Haut.ai.

target?

Element | string

Query selector to the target element or HTMLElement to render LIQA to.

Example

ts
document.querySelector("#liqa-container")

styles?

string

A string containing valid CSS rules. For more information, see Styles page.

Example

ts
"@import url('/path/to/custom-liqa-styles.css')"

use-iframe?

boolean

Render LIQA inside an iframe instead of Shadow DOM.

Default

ts
false

messages?

Messages

An object whose keys are messages keys and values are messages texts. For more information, see Text Messages page.

Example

ts
{ "preview": { "submit": "Confirm" } }

preset?

"face" | "face-180" | "hair"

A preset used to customize AI quality criteria and user flow. For more information, see Presets page.

Default

ts
"face"

sources?

("camera" | "front_camera" | "back_camera" | "upload" | "companion")[]

A list of sources to capture the image from: different device cameras or file upload. Check the relevant user flow customization section to learn about the logic.

Default

ts
["front_camera"]

Alias

["camera"] Starting from 6.7.0 version "camera" acts as an alias for "front_camera".

Note: For face-180 preset only "front_camera" and "companion" sources are available. The rest will be ignored.

capture?

"auto" | "manual"

Image capture mode for "camera" source.

  • "auto": LIQA will automatically take a photo when all AI quality criteria are met.
  • "manual": LIQA will allow the user to take a photo on their own via a button.

Note: The option is configurable only for "hair" preset. Other presets are always "auto".

required-lighting?

"none" | "adaptive" | "default"

Lighting requirements for the image capture.

  • "none": no requirements are set and lighting will not be validated. (WARNING: the quality of the processing results may be affected)
  • "adaptive": the requirements will be softened if the lighting conditions are poor.
  • "default": the requirements will be set to optimal which will provide more details on the photo.

Note: The option is only applicable to "face" preset. For other presets it is always "default".

Default

ts
"default"

effects?

boolean | "true" | "false"

A flag to enable or disable the effects during the image capture process.

Default

ts
true

tutorial?

"off" | "image" | "video"

A flag to enable or disable tutorial option on the source selection screen. Regular tutorial/banner flows require sources to contain a camera source and "upload". With entry-point="tutorial-alt", tutorial can also be shown for camera-only configs.

  • "off": no tutorial will be shown.
  • "video": a video tutorial will be shown.
  • "image": an image tutorial will be shown. Can be used as a fallback for reducing the loading time.

Default

ts
"off"

stepOrder?

( | "glasses-off" | "hair-away-from-face" | "makeup-off" | "good-lighting" | "hair-well-lit" | "hair-forward" | "hair-dry")[]

The built-in tutorial step order.

Must contain every step id for the selected preset exactly once. Invalid values fall back to the default order and emit a console warning.

Default

ts
preset-specific default tutorial order

entry-point?

string | "capture" | "tutorial" | "tutorial-alt"

A flag to set the entry point of the LIQA.

  • "capture": the entry point will be set to the capture screen.
  • "tutorial": the entry point will be set to the tutorial screen.
  • "tutorial-alt": the entry point will be set to the source selection screen with tutorial shown immediately. Works with regular camera + upload configs and with camera-only configs when tutorial is enabled.

Default

ts
"capture"

quality-check?

"off" | "normal" | "strict"

A flag to set the quality check behavior.

  • off: disables the configurable quality-check policy.
  • normal: shows detected issues to the user but still allows submission.
  • strict: shows detected issues and blocks submission until the required checks pass.

Live guidance is available for the "face" and "face-180" presets. Post-capture preview validation is available for "face" and for front, left, and right captures in "face-180". For supported presets, this already includes glasses and forehead checks in live validation and in post-capture validation where available.

Default

ts
"off"

audio?

"off" | "on" | "auto"

Voice guidance for the live-video session: "off" (default), "on", or "auto".

See

LiqaAttributes.audio

occlusion-detection?

"off" | "normal" | "strict" | "live"

A flag to set the occlusion detection behavior.

  • off: skips occlusion detection completely.
  • strict: runs occlusion detection after capture; occlusion issues block submission.
  • normal: runs occlusion detection after capture; occlusion issues are shown as a warning but do not block submission.
  • live: runs lightweight occlusion checks during live camera capture; for non-camera sources (upload, companion) occlusion checks still run after capture.

Available for the "face" and "face-180" presets. Use this when you want glasses / forehead validation without enabling the full quality-check flow. If quality-check is already enabled, glasses and forehead checks are already included for supported presets.

Detection signals:

  • Flags >35% forehead coverage (bangs/hat/brim).
  • Flags glasses; detection aims for sensitivity and may not be perfect in all cases.

Default

ts
"off"

quality-check-sources?

("front_camera" | "back_camera" | "upload" | "companion")[]

An array specifying which capture sources should enforce quality checks.

The quality-check behavior (set via the quality-check property) will only be applied for the sources included in this array. This option does not scope explicit occlusion-detection.

Available values are:

  • front_camera: Enforces quality check on images captured from the front camera.
  • back_camera: Enforces quality check on images captured from the back camera.
  • upload: Enforces quality check on images provided via file upload.
  • companion: Enforces quality check on images captured via a companion source.

If not provided, quality checks will be applied for all sources.

Default

ts
["front_camera","back_camera","upload","companion"]

ignored-quality-checks?

( | "enough_skin" | "pose" | "resolution" | "blur" | "occlusions" | "glasses" | "forehead" | "exposure" | "uniform_illumination" | "shadows")[]

An array specifying post-capture quality checks to ignore.

Ignored checks are excluded from preview issues, blocking logic, and the resulting quality_check payload after capture. Live guidance is not affected.

Available values are:

  • enough_skin
  • pose
  • resolution
  • blur
  • occlusions
  • glasses
  • forehead
  • exposure
  • uniform_illumination
  • shadows

Default

ts
[]

best-frame-selection?

"true" | "false"

A flag to enable or disable best frame selection during image capture.

When enabled, LIQA will track multiple frames during the capture process and automatically select the frame with the highest quality metrics.

Default

ts
"true"

Capture

ImageCapture

Interface for accessing the captured frame in different formats and image types.

Properties

PropertyTypeDescription

source

"front_camera" | "back_camera" | "upload"

The capture source.

The value can be leveraged to perform a conditional logic, e.g. a conditional horizontal flip of the captured image.

metadata

CaptureMetadata

The capture-related metadata.

anonymized?

() => Promise<{ blobs: object[]; transformSequence: TransformSequence; mesh: Mesh; colorCorrectionCoefficients?: [number, number][]; }>

Accesses the anonymized image processing pipeline.

Note: This method is only available when the postprocessing parameter is set to "anonymized".

Methods

blob()
ts
blob(format?): Promise<Blob>;

Converts the captured image to Blob.

Parameters
format?

any

Desired image format. "jpeg" by default.

Returns

Promise<Blob>

The captured frame as Blob in the specified image format.

Example
js
const imageBlob = await capture.blob()
transform()
ts
transform(transformations): this;
Parameters
transformations

CaptureTransformations

Returns

this

a copy of the ImageCapture with the specified transformations applied.

Example
js
/*
   By default, the image is returned as the camera sees it,
   but it can be flipped horizontally to look like it is in a mirror
*/
const mirroredImageBlob = await capture
   .transform({ horizontalFlip: true })
   .blob()

CaptureTransformations

ts
type CaptureTransformations = object;

Image capture transformations.

Properties

PropertyTypeDescription

horizontalFlip?

boolean

Mirrors the given image horizontally

Default

ts
false

CaptureFormat

ts
type CaptureFormat = ImageFormat;

Image capture image format.


CaptureMetadata

ts
type CaptureMetadata = object;

The capture-related metadata.

Properties

PropertyTypeDescription

preset

NonNullable<LiqaAttributes>["preset"]

Preset used to produce the capture, reflects `LiqaAttributes.preset`

source

NonNullable<LiqaAttributes>["sources"][number]

The source of the capture, reflects `LiqaAttributes.source`

side?

"front" | "left" | "right"

The captured face side, either "front", "left", or "right"

capture

LiqaAttributes["capture"]

The capture mode, reflects `LiqaAttributes.capture`

Analytics

AnalyticsEventsMap

ts
type AnalyticsEventsMap = object;

LIQA analytics event names and corresponding event payloads.

Customer applications receive only the externally forwarded CTA events through the LIQA DOM analytics event. The trackable event names are: photo_capture, photo_upload, photo_retake, photo_confirm, photo_confirmation_shown, instructions_opened, instructions_close, instructions_next, instructions_back, instructions_viewed, take_photo, continue_desktop, companion_flow_start, companion_flow_finish, qr_scanned, photo_capture_opened, quality_check_result, and error_screen_shown.

Internal events marked with @internal are used by LIQA/PostHog and are not forwarded to customer applications through the DOM analytics event.

For more information, see CTA Events page.

Properties

PropertyTypeDescription

photo_upload

object

Fired when the user uploads a photo via the Source Selection screen.

photo_upload.event_content?

| "start_screen" | "companion_screen" | "instructions" | "confirmation_screen" | "companion"

photo_capture

object

Fired when a photo of the user is captured.

photo_capture.mode

"auto" | "manual"

The photo capture mode. Reflects the `capture` parameter of LiqaAttributes.

photo_retake

void

Fired when the user decided to retake the photo capture.

photo_confirm

object

Fired when the user confirmed the photo capture.

photo_confirm.camera_facing_mode?

"front" | "back"

instructions_opened

void

Fired when the user opens the instructions (Image or Video tutorial) screen.

instructions_close

void

Fired then the user clicks "close" on the instruction screen.

instructions_next

void

Fired then the user clicks "next" on the instruction screen

instructions_back

void

Fired when the user clicks "back" on the instruction screen.

instructions_viewed

object

Fired when the user views any instruction screen.

instructions_viewed.index?

number

take_photo

object

Fired when the user clicks "Take Photo" button

take_photo.event_content?

| "start_screen" | "companion_screen" | "instructions" | "confirmation_screen"

continue_desktop

void

Fired when the user clicks "Continue on desktop" button in companion flow.

companion_flow_start

void

Fired when the companion flow starts after the mobile device connects to the desktop session.

companion_flow_finish

void

Fired when the companion flow completes after desktop receives all transferred files.

qr_scanned

void

Fired when the companion QR flow is connected (QR scanned and session started).

photo_capture_opened

void

Fired when the live stream is launched.

quality_check_result

object

Fired when there is a problem with photo after the quality check. The payload contains only measured facts for the first reportable validated capture. Missing fields mean the corresponding metric was not evaluated.

quality_check_result.event_content?

object

quality_check_result.event_content.score?

number

quality_check_result.event_content.has_face?

boolean

quality_check_result.event_content.has_enough_skin?

boolean

quality_check_result.event_content.has_valid_pose?

boolean

quality_check_result.event_content.has_good_resolution?

boolean

quality_check_result.event_content.has_no_blur?

boolean

quality_check_result.event_content.has_no_occlusions?

boolean

quality_check_result.event_content.has_no_eyeglasses?

boolean

quality_check_result.event_content.has_no_hair_bangs?

boolean

quality_check_result.event_content.has_good_exposure?

boolean

quality_check_result.event_content.has_uniform_illumination?

boolean

quality_check_result.event_content.has_no_shadows?

boolean

quality_check_result.event_content.ignored_quality_checks?

string[]

quality_check_result.event_content.errors?

( | "face_mesh_failed" | "face_crop_failed" | "unsupported_file_format" | "anonymized_image_processing_error" | "detector_error")[]

photo_confirmation_shown

object

Fired when the confirmation screen appears

photo_confirmation_shown.event_content?

"camera" | "upload"

error_screen_shown

object

Fired when there is an error in LIQA

error_screen_shown.event_content?

"live_video_failed" | "wrong_file_format" | "photo_send_error"


AnalyticsDetails

ts
type AnalyticsDetails = { [K in keyof AnalyticsEventsMap]: { name: K; payload: AnalyticsEventsMap[K] } }[keyof AnalyticsEventsMap];

LIQA analytics event detail.

Customer applications receive this detail through the LIQA DOM analytics event. Track each CTA independently by switching on event.detail.name. Trackable analytics names are not dispatched as standalone DOM events.

Example

js
function handleLiqaAnalyticsEvent(event) {
  const { name, payload } = event.detail

  if (name === "photo_capture") {
    if (payload.mode === "auto")
      console.log("LIQA has automatically captured a photo")
    if (payload.mode === "manual")
      console.log("User has manually captured a photo")
  }

  if (name === "photo_upload")
    console.log("User has uploaded a photo")

  if (name === "photo_retake")
    console.log("User decided to retake the photo")
  if (name === "photo_confirm")
    console.log("User has confirmed the photo")
}

Errors

ErrorCodes

Enumeration Members

Enumeration MemberValueDescription
UNKNOWN0An unexpected error that should never arise. Please, contact LIQA support in case of occurrence and provide reproduction details.
LICENSE_KEY_MALFORMED1The supplied License key is malformed or missing.
LICENSE_KEY_EXPIRED2The supplied License key has expired.
CAMERA_NOT_FOUND3The environment has no camera devices available.
CAMERA_PERMISSION_DENIED4-
IMAGE_SIZE_EXCEEDED5The uploaded image exceeds maximum allowed size for processing.
UNSUPPORTED_IMAGE_FORMAT6The uploaded file is not a supported image format.

LiqaError

Extends

  • Error

Properties

PropertyModifierTypeDefault valueDescriptionOverridesInherited from

name

readonly

"LiqaError"

"LiqaError"

The name for the type of error. MDN Reference

ts
Error.name

code

readonly

ErrorCodes

undefined

Internal error code. You may want to report this value when discussing an issue with LIQA support.

message

readonly

string

undefined

A human-readable description of the error. MDN Reference

ts
Error.message

cause?

readonly

Error

undefined

The specific original cause of the error. MDN Reference

ts
Error.cause

stack?

readonly

string

undefined

A trace of which functions were called, in what order, from which line and file, and with what arguments. MDN Reference

ts
Error.stack

Misc

VERSION

ts
const VERSION: string;

The library version.

Example

js
"6.0.0"

preload()

ts
function preload(options?): Promise<void>;

Preloads preset's resources and features in advance. For more information, see Preload Resources page.

Parameters

options?

PreloadOptions = {}

Preload options.

Returns

Promise<void>

Example

ts
// Preload a preset
preload({ preset: "face" })

// Preload tutorial videos
preload({ feature: "tutorial" })

// Preload both preset and tutorial
preload({ preset: "face", feature: "tutorial" })

PreloadOptions

ts
type PreloadOptions = object;

Properties

PropertyType

preset?

"face" | "face-180" | "hair"

feature?

Feature