Appearance
@haut.ai/liqa
Component
LiqaEventMap
ts
type LiqaEventMap = object;LIQA DOM event names and corresponding event details.
Properties
| Property | Type | Description |
|---|---|---|
| Fired when LIQA has finished initializing | |
| Fired when LIQA has finished loading preset's resources for image processing and is ready to operate. | |
| Fired when LIQA has finished loading its resources and is ready to operate. Alias
Deprecated Use the | |
Fired once for each image after all AI quality criteria pass and the user submits the image. The image can be obtained via the Note: For Deprecated Use the | ||
Fired when all AI quality criteria pass and the user submits the image collection. The images can be obtained via the Note: For | ||
Fired when a customer-trackable analytics event occurs. The detail shape is | ||
Fired when a LiqaError occurs. | ||
| Fired when the user requests to close LIQA. |
DEVICE_CAPABILITY_REASON
ts
const DEVICE_CAPABILITY_REASON: object;Type Declaration
DeviceCapabilityReason
ts
type DeviceCapabilityReason = typeof DEVICE_CAPABILITY_REASON[keyof typeof DEVICE_CAPABILITY_REASON];DeviceCapabilityResult
ts
type DeviceCapabilityResult = object;Properties
| Property | Type | Description |
|---|---|---|
|
| |
Every check that failed — empty when |
DeviceCapabilityOptions
ts
type DeviceCapabilityOptions = object;Properties
| Property | Type | Description |
|---|---|---|
| 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?
Returns
Promise<DeviceCapabilityResult>
FEATURE
ts
const FEATURE: object;Type Declaration
| Name | Type | Default 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
| Property | Type | Description |
|---|---|---|
| The license key obtained from Haut.ai. | |
| A string containing valid CSS rules. For more information, see Styles page. Example ts | |
| Render LIQA inside an iframe instead of Shadow DOM. Default ts | |
| 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 | |
| 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 | |
| A preset used to customize AI quality criteria and user flow. For more information, see Presets page. Default ts | |
| Capture quality mode.
Default ts | |
| Voice guidance for the live-video camera session, spoken via the browser Web Speech API.
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 | |
| A list of sources to capture the image from: different device cameras or file upload. They can be combined using Default ts Alias
Note: For | |
| Image capture mode for
Note: The option is configurable only for | |
| Lighting requirements for the image capture.
Note: The option is only applicable to Default ts | |
| Image post-processing settings. Accepts a comma-separated list of flags:
Default ts | |
| A flag to enable or disable the effects during the image capture process. Default ts | |
| A flag to enable or disable tutorial option on the Source Selection screen. Regular tutorial/banner flows require the
Default ts | |
| A comma-separated order for built-in tutorial steps. Face and face-180 presets accept: Hair preset accepts: 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 Default ts | |
| A flag to set the entry point of the LIQA.
Default ts | |
| A flag to set the quality check behavior.
Live guidance is available for the Default ts | |
| A flag to set the occlusion detection behavior.
Available for the Detection signals:
Default ts | |
| An array specifying which capture sources should enforce quality checks. The quality-check behavior (set via the Available values are:
If not provided, quality checks will be applied for all sources. Default ts | |
| A comma-separated list of post-capture quality checks to ignore. Ignored checks are excluded from preview issues, blocking logic, and the resulting Available values are:
Example ts Default ts | |
| 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 | |
| A character ID to use Accepts a number corresponding to a specific character. Example ts Default ts | |
| A character ID to use in tutorials Accepts a number corresponding to a specific character. Example ts Default ts |
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?
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?
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
Returns
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
| Property | Type | Description |
|---|---|---|
| The license key obtained from Haut.ai. | |
| Query selector to the target element or HTMLElement to render LIQA to. Example ts | |
| A string containing valid CSS rules. For more information, see Styles page. Example ts | |
| Render LIQA inside an iframe instead of Shadow DOM. Default ts | |
| An object whose keys are messages keys and values are messages texts. For more information, see Text Messages page. Example ts | |
| A preset used to customize AI quality criteria and user flow. For more information, see Presets page. Default ts | |
( | 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 Alias
Note: For | |
| Image capture mode for
Note: The option is configurable only for | |
| Lighting requirements for the image capture.
Note: The option is only applicable to Default ts | |
| A flag to enable or disable the effects during the image capture process. Default ts | |
| A flag to enable or disable tutorial option on the source selection screen. Regular tutorial/banner flows require
Default ts | |
( | | 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 | |
| A flag to set the entry point of the LIQA.
Default ts | |
| A flag to set the quality check behavior.
Live guidance is available for the Default ts | |
| Voice guidance for the live-video session: See LiqaAttributes.audio | |
| A flag to set the occlusion detection behavior.
Available for the Detection signals:
Default ts | |
( | An array specifying which capture sources should enforce quality checks. The quality-check behavior (set via the Available values are:
If not provided, quality checks will be applied for all sources. Default ts | |
( | | An array specifying post-capture quality checks to ignore. Ignored checks are excluded from preview issues, blocking logic, and the resulting Available values are:
Default ts | |
| 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 |
Capture
ImageCapture
Interface for accessing the captured frame in different formats and image types.
Properties
| Property | Type | Description |
|---|---|---|
| The capture source. The value can be leveraged to perform a conditional logic, e.g. a conditional horizontal flip of the captured image. | |
The capture-related metadata. | ||
() => | Accesses the anonymized image processing pipeline. Note: This method is only available when the |
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
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
| Property | Type | Description |
|---|---|---|
| Mirrors the given image horizontally Default ts |
CaptureFormat
ts
type CaptureFormat = ImageFormat;Image capture image format.
CaptureMetadata
ts
type CaptureMetadata = object;The capture-related metadata.
Properties
| Property | Type | Description |
|---|---|---|
| Preset used to produce the capture, reflects `LiqaAttributes.preset` | |
| The source of the capture, reflects `LiqaAttributes.source` | |
| The captured face side, either "front", "left", or "right" | |
| 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
| Property | Type | Description |
|---|---|---|
| Fired when the user uploads a photo via the Source Selection screen. | |
| | | ‐ |
| Fired when a photo of the user is captured. | |
|
| The photo capture mode. Reflects the `capture` parameter of LiqaAttributes. |
| Fired when the user decided to retake the photo capture. | |
| Fired when the user confirmed the photo capture. | |
|
| ‐ |
| Fired when the user opens the instructions (Image or Video tutorial) screen. | |
| Fired then the user clicks "close" on the instruction screen. | |
| Fired then the user clicks "next" on the instruction screen | |
| Fired when the user clicks "back" on the instruction screen. | |
| Fired when the user views any instruction screen. | |
|
| ‐ |
| Fired when the user clicks "Take Photo" button | |
| | | ‐ |
| Fired when the user clicks "Continue on desktop" button in companion flow. | |
| Fired when the companion flow starts after the mobile device connects to the desktop session. | |
| Fired when the companion flow completes after desktop receives all transferred files. | |
| Fired when the companion QR flow is connected (QR scanned and session started). | |
| Fired when the live stream is launched. | |
| 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. | |
|
| ‐ |
|
| ‐ |
|
| ‐ |
|
| ‐ |
|
| ‐ |
|
| ‐ |
|
| ‐ |
|
| ‐ |
|
| ‐ |
|
| ‐ |
|
| ‐ |
|
| ‐ |
|
| ‐ |
|
| ‐ |
| ( | | ‐ |
| Fired when the confirmation screen appears | |
|
| ‐ |
| Fired when there is an error in LIQA | |
|
| ‐ |
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
LiqaError
Extends
Error
Properties
| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |
|---|---|---|---|---|---|---|
|
|
| The name for the type of error. MDN Reference | ts | ‐ | |
|
| Internal error code. You may want to report this value when discussing an issue with LIQA support. | ‐ | ‐ | ||
|
|
| A human-readable description of the error. MDN Reference | ‐ | ts | |
|
|
| The specific original cause of the error. MDN Reference | ‐ | ts | |
|
|
| A trace of which functions were called, in what order, from which line and file, and with what arguments. MDN Reference | ‐ | ts |
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
| Property | Type |
|---|---|
| |