@regulaforensics/vp-frontend-face-components 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +372 -165
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +30 -0
- package/lib/index.d.ts +229 -0
- package/package.json +5 -83
- package/lib/common/BackCameraIcon.d.ts +0 -6
- package/lib/common/Button.d.ts +0 -7
- package/lib/common/CameraChangeIcon.d.ts +0 -6
- package/lib/common/CameraIcon.d.ts +0 -6
- package/lib/common/CheckIcon.d.ts +0 -6
- package/lib/common/CrossIcon.d.ts +0 -6
- package/lib/common/DocReaderCameraDisabled.d.ts +0 -5
- package/lib/common/DocReaderCameraPreparing.d.ts +0 -5
- package/lib/common/DocReaderFlip.d.ts +0 -5
- package/lib/common/DocReaderProcessing.d.ts +0 -5
- package/lib/common/DocReaderProcessingError.d.ts +0 -5
- package/lib/common/DocReaderProcessingFinished.d.ts +0 -6
- package/lib/common/DocReaderSearch.d.ts +0 -5
- package/lib/common/ErrorIcon.d.ts +0 -6
- package/lib/common/FromCameraIcon.d.ts +0 -5
- package/lib/common/FromGalleryIcon.d.ts +0 -5
- package/lib/common/FrontCameraIcon.d.ts +0 -6
- package/lib/common/FullscreenExitIcon.d.ts +0 -6
- package/lib/common/FullscreenIcon.d.ts +0 -6
- package/lib/common/Icon.d.ts +0 -64
- package/lib/common/Message.d.ts +0 -8
- package/lib/common/NoGlareIconLivenessDetection.d.ts +0 -5
- package/lib/common/NoSmilingIconLivenessDetection.d.ts +0 -5
- package/lib/common/PortraitOrientationOnlyIcon.d.ts +0 -6
- package/lib/common/RegulaLogo.d.ts +0 -6
- package/lib/common/RegulaLogoLivenessDetection.d.ts +0 -5
- package/lib/common/SnapshotIcon.d.ts +0 -6
- package/lib/common/Spinner.d.ts +0 -3
- package/lib/common/SquareIcon.d.ts +0 -6
- package/lib/common/StopIcon.d.ts +0 -6
- package/lib/common/VerifiedIcon.d.ts +0 -6
- package/lib/components/ButtonFaceLiveness.d.ts +0 -7
- package/lib/components/CameraCapture.d.ts +0 -9
- package/lib/components/CameraSnapshot.d.ts +0 -2
- package/lib/components/CameraSnapshotFileCapture.d.ts +0 -10
- package/lib/components/DocumentCapture.d.ts +0 -11
- package/lib/components/DocumentContainer.d.ts +0 -11
- package/lib/components/DocumentReader.d.ts +0 -2
- package/lib/components/DocumentReaderFileCapture.d.ts +0 -12
- package/lib/components/DocumentReaderLayout.d.ts +0 -22
- package/lib/components/DocumentReaderStartScreen.d.ts +0 -10
- package/lib/components/ErrorBoundary.d.ts +0 -18
- package/lib/components/FaceCapture.d.ts +0 -25
- package/lib/components/FaceDetection.d.ts +0 -2
- package/lib/components/FaceFullScreenOverlay.d.ts +0 -10
- package/lib/components/FaceHintAnimaition.d.ts +0 -16
- package/lib/components/FaceLayout.d.ts +0 -23
- package/lib/components/FaceLiveness.d.ts +0 -2
- package/lib/components/InfoScreen.d.ts +0 -11
- package/lib/components/InfoScreenFaceLiveness.d.ts +0 -12
- package/lib/components/InstructionVideoScreen.d.ts +0 -9
- package/lib/components/ProcessScreen.d.ts +0 -6
- package/lib/components/ProcessScreenFaceLiveness.d.ts +0 -6
- package/lib/components/RetryScreenFaceLiveness.d.ts +0 -7
- package/lib/components/SectorAnimationSvg.d.ts +0 -11
- package/lib/components/WebCamera.d.ts +0 -19
- package/lib/constants.d.ts +0 -686
- package/lib/contexts/DocumentAttributesContext.d.ts +0 -25
- package/lib/contexts/DocumentSDKContext.d.ts +0 -8
- package/lib/contexts/FaceAttributesContext.d.ts +0 -25
- package/lib/hoc/withDocumentAttributesContext.d.ts +0 -4
- package/lib/hoc/withDocumentSDKContext.d.ts +0 -3
- package/lib/hoc/withFaceAttributesContext.d.ts +0 -4
- package/lib/hoc/withLocalize.d.ts +0 -8
- package/lib/hooks/useDocumentReaderSeries.d.ts +0 -20
- package/lib/hooks/useDocumentReaderSingle.d.ts +0 -15
- package/lib/hooks/useFaceLiveness.d.ts +0 -41
- package/lib/hooks/useImageInputParam.d.ts +0 -7
- package/lib/hooks/useOrientationChange.d.ts +0 -10
- package/lib/hooks/useStateCallback.d.ts +0 -1
- package/lib/hooks/useStream.d.ts +0 -10
- package/lib/hooks/useUserAgent.d.ts +0 -3
- package/lib/hooks/useWindowBlur.d.ts +0 -2
- package/lib/i18n/dictionaries/_dictionaries.d.ts +0 -2275
- package/lib/index-document.d.ts +0 -4
- package/lib/index-face.d.ts +0 -1
- package/lib/media-resources/resourcesBase64.d.ts +0 -7
- package/lib/models/CameraModel.d.ts +0 -9
- package/lib/models/CustomError.d.ts +0 -7
- package/lib/models/DocReaderWebclient/ext/authenticity/authenticity.d.ts +0 -32
- package/lib/models/DocReaderWebclient/ext/authenticity/fiber.d.ts +0 -7
- package/lib/models/DocReaderWebclient/ext/authenticity/ident.d.ts +0 -8
- package/lib/models/DocReaderWebclient/ext/authenticity/image-ident.d.ts +0 -7
- package/lib/models/DocReaderWebclient/ext/authenticity/index.d.ts +0 -5
- package/lib/models/DocReaderWebclient/ext/authenticity/ocr-security-text.d.ts +0 -7
- package/lib/models/DocReaderWebclient/ext/authenticity/security-feature.d.ts +0 -8
- package/lib/models/DocReaderWebclient/ext/images.d.ts +0 -16
- package/lib/models/DocReaderWebclient/ext/index.d.ts +0 -6
- package/lib/models/DocReaderWebclient/ext/process-request-image.d.ts +0 -5
- package/lib/models/DocReaderWebclient/ext/process-request.d.ts +0 -38
- package/lib/models/DocReaderWebclient/ext/process-response.d.ts +0 -36
- package/lib/models/DocReaderWebclient/ext/text-field.d.ts +0 -40
- package/lib/models/DocReaderWebclient/ext/text.d.ts +0 -14
- package/lib/models/DocReaderWebclient/models/area-array.d.ts +0 -32
- package/lib/models/DocReaderWebclient/models/area-container.d.ts +0 -38
- package/lib/models/DocReaderWebclient/models/authenticity-check-list.d.ts +0 -31
- package/lib/models/DocReaderWebclient/models/authenticity-check-result-item.d.ts +0 -38
- package/lib/models/DocReaderWebclient/models/authenticity-check-result.d.ts +0 -43
- package/lib/models/DocReaderWebclient/models/authenticity-result-all-of.d.ts +0 -25
- package/lib/models/DocReaderWebclient/models/authenticity-result-type.d.ts +0 -33
- package/lib/models/DocReaderWebclient/models/authenticity-result.d.ts +0 -18
- package/lib/models/DocReaderWebclient/models/bc-pdf417-info.d.ts +0 -54
- package/lib/models/DocReaderWebclient/models/bc-roidetect.d.ts +0 -42
- package/lib/models/DocReaderWebclient/models/check-diagnose.d.ts +0 -98
- package/lib/models/DocReaderWebclient/models/check-result.d.ts +0 -30
- package/lib/models/DocReaderWebclient/models/chosen-document-type-result-all-of.d.ts +0 -25
- package/lib/models/DocReaderWebclient/models/chosen-document-type-result.d.ts +0 -19
- package/lib/models/DocReaderWebclient/models/chosen-document-type.d.ts +0 -74
- package/lib/models/DocReaderWebclient/models/container-list.d.ts +0 -45
- package/lib/models/DocReaderWebclient/models/critical.d.ts +0 -26
- package/lib/models/DocReaderWebclient/models/cross-source-value-comparison.d.ts +0 -38
- package/lib/models/DocReaderWebclient/models/data-module.d.ts +0 -48
- package/lib/models/DocReaderWebclient/models/details-optical.d.ts +0 -67
- package/lib/models/DocReaderWebclient/models/details-rfid.d.ts +0 -61
- package/lib/models/DocReaderWebclient/models/device-info.d.ts +0 -54
- package/lib/models/DocReaderWebclient/models/doc-bar-code-info-all-of.d.ts +0 -31
- package/lib/models/DocReaderWebclient/models/doc-bar-code-info.d.ts +0 -19
- package/lib/models/DocReaderWebclient/models/doc-visual-extended-field.d.ts +0 -70
- package/lib/models/DocReaderWebclient/models/doc-visual-extended-info.d.ts +0 -25
- package/lib/models/DocReaderWebclient/models/document-format.d.ts +0 -70
- package/lib/models/DocReaderWebclient/models/document-image-result-all-of.d.ts +0 -25
- package/lib/models/DocReaderWebclient/models/document-image-result.d.ts +0 -18
- package/lib/models/DocReaderWebclient/models/document-image.d.ts +0 -24
- package/lib/models/DocReaderWebclient/models/document-position-result-all-of.d.ts +0 -25
- package/lib/models/DocReaderWebclient/models/document-position-result.d.ts +0 -19
- package/lib/models/DocReaderWebclient/models/document-position.d.ts +0 -80
- package/lib/models/DocReaderWebclient/models/document-type-recognition-result.d.ts +0 -30
- package/lib/models/DocReaderWebclient/models/document-type.d.ts +0 -246
- package/lib/models/DocReaderWebclient/models/document-types-candidates-list.d.ts +0 -32
- package/lib/models/DocReaderWebclient/models/document-types-candidates-result-all-of.d.ts +0 -25
- package/lib/models/DocReaderWebclient/models/document-types-candidates-result.d.ts +0 -18
- package/lib/models/DocReaderWebclient/models/document-types-candidates.d.ts +0 -32
- package/lib/models/DocReaderWebclient/models/encrypted-rclresult-all-of.d.ts +0 -24
- package/lib/models/DocReaderWebclient/models/encrypted-rclresult.d.ts +0 -18
- package/lib/models/DocReaderWebclient/models/fdsidlist.d.ts +0 -80
- package/lib/models/DocReaderWebclient/models/fiber-result-all-of.d.ts +0 -74
- package/lib/models/DocReaderWebclient/models/fiber-result.d.ts +0 -18
- package/lib/models/DocReaderWebclient/models/graphic-field-type.d.ts +0 -118
- package/lib/models/DocReaderWebclient/models/graphic-field.d.ts +0 -63
- package/lib/models/DocReaderWebclient/models/graphic-fields-list.d.ts +0 -25
- package/lib/models/DocReaderWebclient/models/graphics-result-all-of.d.ts +0 -25
- package/lib/models/DocReaderWebclient/models/graphics-result.d.ts +0 -19
- package/lib/models/DocReaderWebclient/models/ident-result-all-of.d.ts +0 -65
- package/lib/models/DocReaderWebclient/models/ident-result.d.ts +0 -18
- package/lib/models/DocReaderWebclient/models/image-data.d.ts +0 -24
- package/lib/models/DocReaderWebclient/models/image-qa.d.ts +0 -54
- package/lib/models/DocReaderWebclient/models/image-quality-check-list.d.ts +0 -32
- package/lib/models/DocReaderWebclient/models/image-quality-check-type.d.ts +0 -50
- package/lib/models/DocReaderWebclient/models/image-quality-check.d.ts +0 -64
- package/lib/models/DocReaderWebclient/models/image-quality-result-all-of.d.ts +0 -25
- package/lib/models/DocReaderWebclient/models/image-quality-result.d.ts +0 -18
- package/lib/models/DocReaderWebclient/models/images-available-source.d.ts +0 -31
- package/lib/models/DocReaderWebclient/models/images-field-value.d.ts +0 -70
- package/lib/models/DocReaderWebclient/models/images-field.d.ts +0 -38
- package/lib/models/DocReaderWebclient/models/images-result-all-of.d.ts +0 -25
- package/lib/models/DocReaderWebclient/models/images-result.d.ts +0 -18
- package/lib/models/DocReaderWebclient/models/images.d.ts +0 -32
- package/lib/models/DocReaderWebclient/models/index.d.ts +0 -123
- package/lib/models/DocReaderWebclient/models/lcid.d.ts +0 -582
- package/lib/models/DocReaderWebclient/models/lexical-analysis-result-all-of.d.ts +0 -25
- package/lib/models/DocReaderWebclient/models/lexical-analysis-result.d.ts +0 -19
- package/lib/models/DocReaderWebclient/models/license-result-all-of.d.ts +0 -24
- package/lib/models/DocReaderWebclient/models/license-result.d.ts +0 -18
- package/lib/models/DocReaderWebclient/models/light.d.ts +0 -34
- package/lib/models/DocReaderWebclient/models/list-verified-fields.d.ts +0 -25
- package/lib/models/DocReaderWebclient/models/log-level.d.ts +0 -23
- package/lib/models/DocReaderWebclient/models/measure-system.d.ts +0 -26
- package/lib/models/DocReaderWebclient/models/mrzformat.d.ts +0 -24
- package/lib/models/DocReaderWebclient/models/ocrsecurity-text-result-all-of.d.ts +0 -81
- package/lib/models/DocReaderWebclient/models/ocrsecurity-text-result.d.ts +0 -18
- package/lib/models/DocReaderWebclient/models/one-candidate.d.ts +0 -74
- package/lib/models/DocReaderWebclient/models/original-symbol.d.ts +0 -37
- package/lib/models/DocReaderWebclient/models/parray-field.d.ts +0 -81
- package/lib/models/DocReaderWebclient/models/per-document-config.d.ts +0 -30
- package/lib/models/DocReaderWebclient/models/photo-ident-result-all-of.d.ts +0 -76
- package/lib/models/DocReaderWebclient/models/photo-ident-result.d.ts +0 -18
- package/lib/models/DocReaderWebclient/models/point-array.d.ts +0 -25
- package/lib/models/DocReaderWebclient/models/point.d.ts +0 -30
- package/lib/models/DocReaderWebclient/models/points-container.d.ts +0 -31
- package/lib/models/DocReaderWebclient/models/process-params.d.ts +0 -254
- package/lib/models/DocReaderWebclient/models/process-request-image.d.ts +0 -38
- package/lib/models/DocReaderWebclient/models/process-request.d.ts +0 -60
- package/lib/models/DocReaderWebclient/models/process-response.d.ts +0 -66
- package/lib/models/DocReaderWebclient/models/process-system-info.d.ts +0 -30
- package/lib/models/DocReaderWebclient/models/processing-status.d.ts +0 -30
- package/lib/models/DocReaderWebclient/models/raw-image-container-list.d.ts +0 -31
- package/lib/models/DocReaderWebclient/models/rectangle-coordinates.d.ts +0 -42
- package/lib/models/DocReaderWebclient/models/result-item.d.ts +0 -48
- package/lib/models/DocReaderWebclient/models/result.d.ts +0 -98
- package/lib/models/DocReaderWebclient/models/rfid-location.d.ts +0 -30
- package/lib/models/DocReaderWebclient/models/rfid-origin.d.ts +0 -42
- package/lib/models/DocReaderWebclient/models/scenario.d.ts +0 -36
- package/lib/models/DocReaderWebclient/models/security-feature-result-all-of.d.ts +0 -59
- package/lib/models/DocReaderWebclient/models/security-feature-result.d.ts +0 -18
- package/lib/models/DocReaderWebclient/models/security-feature-type.d.ts +0 -49
- package/lib/models/DocReaderWebclient/models/source-validity.d.ts +0 -32
- package/lib/models/DocReaderWebclient/models/source.d.ts +0 -23
- package/lib/models/DocReaderWebclient/models/status-result-all-of.d.ts +0 -25
- package/lib/models/DocReaderWebclient/models/status-result.d.ts +0 -18
- package/lib/models/DocReaderWebclient/models/status.d.ts +0 -63
- package/lib/models/DocReaderWebclient/models/string-recognition-result.d.ts +0 -25
- package/lib/models/DocReaderWebclient/models/symbol-candidate.d.ts +0 -30
- package/lib/models/DocReaderWebclient/models/symbol-recognition-result.d.ts +0 -32
- package/lib/models/DocReaderWebclient/models/text-available-source.d.ts +0 -38
- package/lib/models/DocReaderWebclient/models/text-data-result-all-of.d.ts +0 -25
- package/lib/models/DocReaderWebclient/models/text-data-result.d.ts +0 -19
- package/lib/models/DocReaderWebclient/models/text-field-type.d.ts +0 -2386
- package/lib/models/DocReaderWebclient/models/text-field-value.d.ts +0 -70
- package/lib/models/DocReaderWebclient/models/text-field.d.ts +0 -84
- package/lib/models/DocReaderWebclient/models/text-post-processing.d.ts +0 -22
- package/lib/models/DocReaderWebclient/models/text-result-all-of.d.ts +0 -25
- package/lib/models/DocReaderWebclient/models/text-result.d.ts +0 -18
- package/lib/models/DocReaderWebclient/models/text.d.ts +0 -51
- package/lib/models/DocReaderWebclient/models/transaction-info.d.ts +0 -42
- package/lib/models/DocReaderWebclient/models/verification-result.d.ts +0 -38
- package/lib/models/DocReaderWebclient/models/verified-field-map.d.ts +0 -63
- package/lib/models/DocReaderWebclient/models/visibility.d.ts +0 -23
- package/lib/models/ImageModel.d.ts +0 -7
- package/lib/services/DebugService.d.ts +0 -17
- package/lib/services/DocumentReaderProcessor.d.ts +0 -50
- package/lib/services/DocumentReaderService.d.ts +0 -57
- package/lib/services/EventEmitter.d.ts +0 -9
- package/lib/services/FaceLivenessService.d.ts +0 -62
- package/lib/services/FaceService.d.ts +0 -39
- package/lib/services/StreamRecorderService.d.ts +0 -24
- package/lib/types.d.ts +0 -361
- package/lib/utils.d.ts +0 -30
- package/lib/web-components/CameraSnapshot.d.ts +0 -14
- package/lib/web-components/DocumentReader.d.ts +0 -14
- package/lib/web-components/FaceDetection.d.ts +0 -11
- package/lib/web-components/FaceLiveness.d.ts +0 -17
- package/lib/web-components/FullScreenContainer.d.ts +0 -4
package/README.md
CHANGED
|
@@ -1,28 +1,46 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
# Face SDK Web Components
|
|
2
|
+
|
|
3
|
+
- [Overview](#overview)
|
|
4
|
+
- [Before you start](#before-you-start)
|
|
5
|
+
- [Compatibility](#compatibility)
|
|
6
|
+
- [Install via NPM](#install-via-npm)
|
|
7
|
+
- [Install via CDN](#install-via-cdn)
|
|
8
|
+
- [Settings](#settings)
|
|
9
|
+
- [Customization](#customization)
|
|
10
|
+
- [Events](#events)
|
|
11
|
+
- [Response](#response)
|
|
12
|
+
- [Attributes](#attributes)
|
|
13
|
+
- [Custom translations](#custom-translations)
|
|
14
|
+
- [Examples](#examples)
|
|
15
|
+
- [Additional resources](#additional-resources)
|
|
12
16
|
|
|
13
17
|
---
|
|
14
18
|
|
|
15
|
-
##
|
|
19
|
+
## Overview
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
The Face SDK web components let you add automatic capture of a user's selfie and liveness check to your web site. The components capture a face from the device camera and can either simply detect a face on the captured photo or confirm the face <a href="https://docs.regulaforensics.com/develop/overview/#liveness-detection" target="_blank">liveness</a>.
|
|
22
|
+
|
|
23
|
+
The available components are:
|
|
24
|
+
|
|
25
|
+
- `face-capture`
|
|
26
|
+
- `face-liveness`
|
|
27
|
+
|
|
28
|
+
The web components are based on WebAssembly (.wasm module), which is our core C++ code compiled for use in browsers and wrapped with a JS layer. It is exactly the same code as built for all the other platform SDK packages.
|
|
29
|
+
|
|
30
|
+
## Before you start
|
|
31
|
+
|
|
32
|
+
Please note that:
|
|
33
|
+
|
|
34
|
+
- The components work **only** under the HTTPS protocol on the web site.
|
|
35
|
+
- The components library does register the components on the web page itself, so make sure to import the library to your web site before adding the components to the web page code.
|
|
18
36
|
|
|
19
37
|
## Compatibility
|
|
20
38
|
|
|
21
39
|
| Devices |  |  |  |
|
|
22
40
|
|:---------------------|:-------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------:|
|
|
23
41
|
| **Mobile (iOS)** | 99 (iOS14.4+) | 99 (iOS14.4+) | 11 |
|
|
24
|
-
| **Mobile (Android)** |
|
|
25
|
-
| **Desktop** | 66 |
|
|
42
|
+
| **Mobile (Android)** | 69 | 63 | - |
|
|
43
|
+
| **Desktop** | 66 | 69 | 11 |
|
|
26
44
|
|
|
27
45
|
## Install via NPM
|
|
28
46
|
|
|
@@ -39,26 +57,26 @@ npm init
|
|
|
39
57
|
```
|
|
40
58
|
Answer the questions in the command line questionnaire.
|
|
41
59
|
|
|
42
|
-
Install
|
|
60
|
+
Install `@regulaforensics/vp-frontend-face-components`:
|
|
43
61
|
|
|
44
62
|
```
|
|
45
63
|
npm i @regulaforensics/vp-frontend-face-components
|
|
46
64
|
```
|
|
47
65
|
|
|
48
|
-
Create
|
|
66
|
+
Create `index.html` and `index.js` files in the root directory of the project.
|
|
49
67
|
|
|
50
|
-
Import
|
|
68
|
+
Import `@regulaforensics/vp-frontend-face-components` into your `index.js`:
|
|
51
69
|
|
|
52
70
|
```javascript
|
|
53
71
|
import './node_modules/@regulaforensics/vp-frontend-face-components/dist/main.js';
|
|
54
72
|
```
|
|
55
73
|
|
|
56
|
-
In
|
|
74
|
+
In `index.html` connect `index.js` and add the name of the component you want to use. Available components:
|
|
57
75
|
|
|
58
|
-
1.
|
|
59
|
-
1.
|
|
76
|
+
1. `<face-capture></face-capture>` - for creating a face snapshot;
|
|
77
|
+
1. `<face-liveness></face-liveness>` - for performing liveness verification.
|
|
60
78
|
|
|
61
|
-
|
|
79
|
+
For example:
|
|
62
80
|
|
|
63
81
|
```html
|
|
64
82
|
<!DOCTYPE html>
|
|
@@ -76,43 +94,158 @@ Example:
|
|
|
76
94
|
|
|
77
95
|
## Install via CDN
|
|
78
96
|
|
|
79
|
-
Connect the script in your
|
|
97
|
+
Connect the script in your `.html` file. CDN link: `unpkg.com/:package@:version/:file`
|
|
80
98
|
|
|
81
|
-
|
|
99
|
+
For example:
|
|
82
100
|
|
|
83
101
|
```html
|
|
84
|
-
<script src="https://unpkg.com/@regulaforensics/vp-frontend-face-components@
|
|
102
|
+
<script src="https://unpkg.com/@regulaforensics/vp-frontend-face-components@latest/dist/main.js"></script>
|
|
85
103
|
```
|
|
86
104
|
|
|
87
105
|
Add the name of the component to the html, as in the example above.
|
|
88
106
|
|
|
89
|
-
##
|
|
90
|
-
|
|
91
|
-
### face-liveness
|
|
107
|
+
## Settings
|
|
92
108
|
|
|
93
|
-
|
|
109
|
+
You can set any parameter using `settings`. Find below examples of applying all the settings at once and just some of them.
|
|
94
110
|
|
|
95
|
-
Example:
|
|
111
|
+
Example of using all the settings:
|
|
96
112
|
|
|
97
|
-
|
|
113
|
+
````javascript
|
|
98
114
|
const component = document.getElementsByTagName('face-liveness')[0];
|
|
99
115
|
|
|
100
|
-
component.
|
|
101
|
-
|
|
116
|
+
component.settings = {
|
|
117
|
+
locale: 'en',
|
|
118
|
+
copyright: true,
|
|
119
|
+
cameraId: '123',
|
|
120
|
+
changeCamera: true,
|
|
121
|
+
startScreen: true,
|
|
122
|
+
closeDisabled: true,
|
|
123
|
+
finishScreen: true,
|
|
124
|
+
videoRecording: true,
|
|
125
|
+
url: 'https://your-server.com',
|
|
126
|
+
headers: {
|
|
127
|
+
Authorization: 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
|
|
128
|
+
},
|
|
129
|
+
tag: 'sessionIdValue',
|
|
130
|
+
retryCount: 5,
|
|
131
|
+
customization: {
|
|
132
|
+
fontFamily: 'Noto Sans, sans-serif',
|
|
133
|
+
fontSize: '16px',
|
|
134
|
+
onboardingScreenStartButtonBackground: '#7E57C5',
|
|
135
|
+
onboardingScreenStartButtonBackgroundHover: '#7c45b4',
|
|
136
|
+
onboardingScreenStartButtonTitle: '#FFFFFF',
|
|
137
|
+
onboardingScreenStartButtonTitleHover: '#FFFFFF',
|
|
138
|
+
cameraScreenFrontHintLabelBackground: '#E8E8E8',
|
|
139
|
+
onboardingScreenIllumination: 'https://path-to-image.com',
|
|
140
|
+
onboardingScreenAccessories: 'data:image/svg+xml;base64,PHN2...',
|
|
141
|
+
onboardingScreenCameraLevel: importedImage,
|
|
142
|
+
cameraScreenFrontHintLabelText: '#000000',
|
|
143
|
+
cameraScreenSectorActive: '#7E57C5',
|
|
144
|
+
cameraScreenSectorTarget: '#BEABE2',
|
|
145
|
+
cameraScreenStrokeNormal: '#7E57C5',
|
|
146
|
+
processingScreenProgress: '#7E57C5',
|
|
147
|
+
retryScreenRetryButtonBackground: '#7E57C5',
|
|
148
|
+
retryScreenRetryButtonBackgroundHover: '#7c45b4',
|
|
149
|
+
retryScreenRetryButtonTitle: '#FFFFFF',
|
|
150
|
+
retryScreenRetryButtonTitleHover: '#FFFFFF',
|
|
151
|
+
retryScreenEnvironmentImage: 'https://path-to-image.com',
|
|
152
|
+
retryScreenPersonImage: 'data:image/svg+xml;base64,PHN2...',
|
|
153
|
+
successScreenImage: importedImage,
|
|
154
|
+
}
|
|
155
|
+
}
|
|
102
156
|
|
|
103
|
-
|
|
157
|
+
````
|
|
104
158
|
|
|
105
|
-
Example:
|
|
159
|
+
Example of using just the selected settings:
|
|
160
|
+
|
|
161
|
+
````javascript
|
|
162
|
+
const yourSettings = {
|
|
163
|
+
locale: 'de',
|
|
164
|
+
videoRecording: false,
|
|
165
|
+
url: 'https://your-server.com',
|
|
166
|
+
headers: {
|
|
167
|
+
Authorization: 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
|
|
168
|
+
},
|
|
169
|
+
customization: {
|
|
170
|
+
fontFamily: 'Noto Sans, sans-serif',
|
|
171
|
+
successScreenImage: importedImage,
|
|
172
|
+
}
|
|
173
|
+
}
|
|
106
174
|
|
|
107
|
-
```javascript
|
|
108
175
|
const component = document.getElementsByTagName('face-liveness')[0];
|
|
109
176
|
|
|
110
|
-
component.
|
|
111
|
-
|
|
177
|
+
component.settings = yourSettings;
|
|
178
|
+
|
|
179
|
+
````
|
|
180
|
+
|
|
181
|
+
Here are all the available settings:
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
| Setting | Info | Data type | Default value | Values | Used in |
|
|
185
|
+
|:-----------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------:|:--------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|----------------------------------|
|
|
186
|
+
| `locale` | The language of the component. | `string` | `en` | `ru`, `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` | `face-liveness`, `face-capture` |
|
|
187
|
+
| `url` | The backend URL. | `string` | `https://faceapi.regulaforensics.com/` | any url | `face-liveness` |
|
|
188
|
+
| `copyright` | Whether to show the Regula copyright footer. | `boolean` | `false` | `true`, `false` | `face-liveness`, `face-capture` |
|
|
189
|
+
| `cameraId` | The ability to select a camera by defining the camera ID. | `string` | `undefined` | `camera id string value` | `face-liveness`, `face-capture` |
|
|
190
|
+
| `changeCamera` | Whether to show the camera switch button. | `boolean` | `true` | `true`, `false` | `face-liveness`, `face-capture` |
|
|
191
|
+
| `startScreen` | Whether to show the start screen with video instruction. 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 the face. | `boolean` | `true` | `true`, `false` | `face-liveness`, `face-capture` |
|
|
192
|
+
| `finishScreen` | Whether to show the finish screen (`success screen`, `retry-screen`). If `true`, the finish screen is shown. If `false`, no finish screen will be displayed, and **the user will only have one attempt to pass the liveness check**. | `boolean` | `true` | `true`, `false` | `face-liveness`, `face-capture` |
|
|
193
|
+
| `closeDisabled` | Whether to disable the "Close" button of the component. If set to `true`, the "Close" button is hidden from the user. | `boolean` | `false` | `true`, `false` | `face-liveness`, `face-capture` |
|
|
194
|
+
| `videoRecording` | Whether to enable the video recording of the process. If set to `true`, the video is sent to the server. The video format depends on the browser: MP4 for Safari, WEB for other browsers. | `boolean` | `false` | `true`, `false` | `face-liveness` |
|
|
195
|
+
| `tag` | The 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. | `string` | `undefined` | any unique for each session | `face-liveness` |
|
|
196
|
+
| `retryCount` | Using 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. | `number` | `-1` | number of the attempts count | `face-liveness` |
|
|
197
|
+
| `headers` | Before 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`. | `object` | `undefined` | object with headers (key, value) | `face-liveness` |
|
|
198
|
+
| `customization` | You can customize element colors, fonts, and images using this object. See the customization section below. | `object` | `undefined` | object with customization settings | `face-liveness`, `face-capture` |
|
|
199
|
+
|
|
200
|
+
## Customization
|
|
201
|
+
|
|
202
|
+
You can customize colors of some elements, fonts, and images using the `customization` field in the `settings` object. The customization settings are the following:
|
|
203
|
+
|
|
204
|
+
| Setting | Info | Migrate from | Data type | Default value |
|
|
205
|
+
|:---------------------------------------------|:-----------------------------------------------------------------------------|-------------------------|:-------------------------------:|:-----------------------:|
|
|
206
|
+
| `fontFamily` | The component font. | `--font-family` | string | `Noto Sans, sans-serif` |
|
|
207
|
+
| `fontSize` | The component base font size. | `--font-size` | string | `16px` |
|
|
208
|
+
| `onboardingScreenStartButtonBackground` | The instruction screen button background color. | `--main-color` | string | `#7E57C5` |
|
|
209
|
+
| `onboardingScreenStartButtonBackgroundHover` | The instruction screen button background hover color. | `--hover-color` | string | `#7C45B4` |
|
|
210
|
+
| `onboardingScreenStartButtonTitle` | The instruction screen button text color. | | string | `#FFFFFF` |
|
|
211
|
+
| `onboardingScreenStartButtonTitleHover` | The instruction screen button text hover color. | | string | `#FFFFFF` |
|
|
212
|
+
| `onboardingScreenIllumination` | The instruction screen "Illumination" icon image. | | base64 or url or imported image | `` |
|
|
213
|
+
| `onboardingScreenAccessories` | The instruction screen "No accessories" icon image. | | base64 or url or imported image | `` |
|
|
214
|
+
| `onboardingScreenCameraLevel` | The instruction screen "Camera level" icon image. | | base64 or url or imported image | `` |
|
|
215
|
+
| `cameraScreenFrontHintLabelBackground` | The camera screen plate with info-message background color. | `--plate-color` | string | `#E8E8E8` |
|
|
216
|
+
| `cameraScreenFrontHintLabelText` | The camera screen plate with info-message text color. | | string | `#000000` |
|
|
217
|
+
| `cameraScreenSectorActive` | The user progress sector color (available only in face-liveness component). | | string | `#7E57C5` |
|
|
218
|
+
| `cameraScreenSectorTarget` | The target sector color (available only in face-liveness component). | `--target-sector-color` | string | `#BEABE2` |
|
|
219
|
+
| `cameraScreenStrokeNormal` | The stroke color of the camera circle. | | string | `#7E57C5` |
|
|
220
|
+
| `processingScreenProgress` | The processing screen spinner color. | | string | `#7E57C5` |
|
|
221
|
+
| `retryScreenEnvironmentImage` | The Retry screen environment image. | | base64 or url or imported image | `` |
|
|
222
|
+
| `retryScreenPersonImage` | The Retry screen person image. | | base64 or url or imported image | `` |
|
|
223
|
+
| `retryScreenRetryButtonBackground` | The Retry screen button background color. | `--main-color` | string | `#7E57C5` |
|
|
224
|
+
| `retryScreenRetryButtonBackgroundHover` | The Retry screen button background hover color. | `--hover-color` | string | `#7C45B4` |
|
|
225
|
+
| `retryScreenRetryButtonTitle` | The Retry screen button text color. | | string | `#FFFFFF` |
|
|
226
|
+
| `retryScreenRetryButtonTitleHover` | The Retry screen button text hover color. | | string | `#FFFFFF` |
|
|
227
|
+
| `successScreenImage` | The Success screen image. | | base64 or url or imported image | `` |
|
|
228
|
+
|
|
229
|
+
For example:
|
|
230
|
+
|
|
231
|
+
```javascript
|
|
232
|
+
const component = document.getElementsByTagName('face-liveness')[0];
|
|
233
|
+
|
|
234
|
+
component.settings = {
|
|
235
|
+
...otherSettings,
|
|
236
|
+
customization: {
|
|
237
|
+
fontFamily: 'Noto Sans, sans-serif',
|
|
238
|
+
fontSize: '16px',
|
|
239
|
+
onboardingScreenStartButtonBackground: '#7E57C5',
|
|
240
|
+
onboardingScreenStartButtonBackgroundHover: '#7c45b4',
|
|
241
|
+
retryScreenPersonImage: 'data:image/svg+xml;base64,PHN2...',
|
|
242
|
+
}
|
|
112
243
|
}
|
|
244
|
+
|
|
113
245
|
```
|
|
114
246
|
|
|
115
|
-
|
|
247
|
+
|
|
248
|
+
## Events
|
|
116
249
|
|
|
117
250
|
You can subscribe to the component events.
|
|
118
251
|
|
|
@@ -126,9 +259,9 @@ faceLivenessComponent.addEventListener('face-liveness', (event) => console.log(e
|
|
|
126
259
|
faceCaptureComponent.addEventListener('face-capture', (event) => console.log(event.detail)); // event listener for face-capture component
|
|
127
260
|
```
|
|
128
261
|
|
|
129
|
-
The
|
|
262
|
+
The `face-liveness` type of event is generated for the face-liveness component, and `face-capture` type of event is generated for the face-capture component.
|
|
130
263
|
|
|
131
|
-
The generated event object (
|
|
264
|
+
The generated event object (`event.detail`) contains three fields that describe the event:
|
|
132
265
|
|
|
133
266
|
```javascript
|
|
134
267
|
{
|
|
@@ -140,16 +273,17 @@ The generated event object (```event.detail```) contains three fields that descr
|
|
|
140
273
|
|
|
141
274
|
Type of actions:
|
|
142
275
|
|
|
143
|
-
| Type of action
|
|
144
|
-
|
|
145
|
-
|
|
|
146
|
-
|
|
|
147
|
-
|
|
|
148
|
-
|
|
|
149
|
-
|
|
|
150
|
-
|
|
|
276
|
+
| Type of action | Description of the action | The component |
|
|
277
|
+
|:-------------------------|:---------------------------------------------------------------------------------------:|:-------------------------------:|
|
|
278
|
+
| `ELEMENT_VISIBLE` | The component is appended in the DOM. | `face-liveness`, `face-capture` |
|
|
279
|
+
| `PRESS_START_BUTTON` | The "Get started" button is pressed. | `face-liveness`, `face-capture` |
|
|
280
|
+
| `PRESS_RETRY_BUTTON` | The "Retry" button is pressed. | `face-liveness`, `face-capture` |
|
|
281
|
+
| `CLOSE` | The "Close" button is pressed. | `face-liveness`, `face-capture` |
|
|
282
|
+
| `PROCESS_FINISHED` | The component has finished its work. | `face-liveness`, `face-capture` |
|
|
283
|
+
| `SERVICE_INITIALIZED` | The component has started its work. | `face-liveness`, `face-capture` |
|
|
284
|
+
| `RETRY_COUNTER_EXCEEDED` | The component has finished its work due to the exceeded number of transaction attempts. | `face-liveness` |
|
|
151
285
|
|
|
152
|
-
In cases of successful operation of the components, the
|
|
286
|
+
In cases of successful operation of the components, the `data` field will contain the following fields:
|
|
153
287
|
|
|
154
288
|
```javascript
|
|
155
289
|
{
|
|
@@ -158,7 +292,7 @@ In cases of successful operation of the components, the ```data``` field will co
|
|
|
158
292
|
}
|
|
159
293
|
```
|
|
160
294
|
|
|
161
|
-
In cases of unsuccessful work, the
|
|
295
|
+
In cases of unsuccessful work, the `data` field will contain the following fields:
|
|
162
296
|
|
|
163
297
|
```javascript
|
|
164
298
|
{
|
|
@@ -167,19 +301,23 @@ In cases of unsuccessful work, the ```data``` field will contain the following f
|
|
|
167
301
|
}
|
|
168
302
|
```
|
|
169
303
|
|
|
170
|
-
Table of
|
|
171
|
-
|
|
172
|
-
| Reason
|
|
173
|
-
|
|
174
|
-
|
|
|
175
|
-
|
|
|
176
|
-
|
|
|
177
|
-
|
|
|
178
|
-
|
|
|
179
|
-
|
|
|
180
|
-
|
|
|
181
|
-
|
|
|
182
|
-
|
|
|
304
|
+
Table of event causes:
|
|
305
|
+
|
|
306
|
+
| Reason | Description of the reason |
|
|
307
|
+
|:----------------------------|:-------------------------------------------------------------------------------------------------------:|
|
|
308
|
+
| `WASM_ERROR` | Error in WASM. |
|
|
309
|
+
| `UNKNOWN_ERROR` | Unknown error. |
|
|
310
|
+
| `NOT_SUPPORTED` | The browser is not supported. |
|
|
311
|
+
| `CAMERA_UNKNOWN_ERROR` | Unknown camera error. |
|
|
312
|
+
| `CAMERA_PERMISSION_DENIED` | Access to the camera is prohibited. |
|
|
313
|
+
| `NO_CAMERA` | There is no camera. |
|
|
314
|
+
| `CONNECTION_ERROR` | Connection errors. |
|
|
315
|
+
| `LANDSCAPE_MODE_RESTRICTED` | Work in landscape orientation is prohibited. |
|
|
316
|
+
| `TIMEOUT_ERROR` | Transaction failed due to timeout. |
|
|
317
|
+
| `CHANGE_CAMERA` | The user has changed the camera. Return to start-screen or restart service if start-screen is disabled. |
|
|
318
|
+
| `DEVICE_ROTATE` | The user has rotated the device. Return to start-screen or restart service if start-screen is disabled. |
|
|
319
|
+
| `APP_INACTIVE` | The user has closed the tab or browser during the face capture process. |
|
|
320
|
+
| `INCORRECT_CAMERA_ID` | No camera with the specified ID found. |
|
|
183
321
|
|
|
184
322
|
The table below describes the cases of event generation:
|
|
185
323
|
|
|
@@ -192,7 +330,7 @@ The table below describes the cases of event generation:
|
|
|
192
330
|
<th>Event type</th>
|
|
193
331
|
<th>
|
|
194
332
|
|
|
195
|
-
Event object
|
|
333
|
+
Event object `event.detail`
|
|
196
334
|
</th>
|
|
197
335
|
<th>Description</th>
|
|
198
336
|
</tr>
|
|
@@ -202,11 +340,10 @@ Event object ```event.detail```
|
|
|
202
340
|
<td>The component is mounted in the DOM.</td>
|
|
203
341
|
<td>
|
|
204
342
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
```face-capture```
|
|
343
|
+
`face-liveness`
|
|
344
|
+
<br>
|
|
345
|
+
<br>
|
|
346
|
+
`face-capture`
|
|
210
347
|
|
|
211
348
|
</td>
|
|
212
349
|
<td>
|
|
@@ -214,8 +351,7 @@ For face-capture:
|
|
|
214
351
|
```javascript
|
|
215
352
|
{
|
|
216
353
|
action: "ELEMENT_VISIBLE",
|
|
217
|
-
data: null
|
|
218
|
-
manual: true
|
|
354
|
+
data: null
|
|
219
355
|
}
|
|
220
356
|
```
|
|
221
357
|
|
|
@@ -224,7 +360,8 @@ For face-capture:
|
|
|
224
360
|
|
|
225
361
|
To receive this event, you must wrap the component in another element (for example, a div) and add an addEventListener to it. When the component appears in the DOM, the event will pop up.
|
|
226
362
|
|
|
227
|
-
|
|
363
|
+
For example:
|
|
364
|
+
|
|
228
365
|
```html
|
|
229
366
|
<div id="add-event-listener-to-this-element">
|
|
230
367
|
<face-liveness></face-liveness>
|
|
@@ -237,11 +374,10 @@ Example:
|
|
|
237
374
|
<td>The "Get started" button is pressed.</td>
|
|
238
375
|
<td>
|
|
239
376
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
```face-capture```
|
|
377
|
+
`face-liveness`
|
|
378
|
+
<br>
|
|
379
|
+
<br>
|
|
380
|
+
`face-capture`
|
|
245
381
|
|
|
246
382
|
</td>
|
|
247
383
|
<td>
|
|
@@ -249,8 +385,7 @@ For face-capture:
|
|
|
249
385
|
```javascript
|
|
250
386
|
{
|
|
251
387
|
action: "PRESS_START_BUTTON",
|
|
252
|
-
data: null
|
|
253
|
-
manual: true
|
|
388
|
+
data: null
|
|
254
389
|
}
|
|
255
390
|
```
|
|
256
391
|
|
|
@@ -261,11 +396,10 @@ For face-capture:
|
|
|
261
396
|
<td>The "Retry" button is pressed.</td>
|
|
262
397
|
<td>
|
|
263
398
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
```face-capture```
|
|
399
|
+
`face-liveness`
|
|
400
|
+
<br>
|
|
401
|
+
<br>
|
|
402
|
+
`face-capture`
|
|
269
403
|
|
|
270
404
|
</td>
|
|
271
405
|
<td>
|
|
@@ -273,8 +407,7 @@ For face-capture:
|
|
|
273
407
|
```javascript
|
|
274
408
|
{
|
|
275
409
|
action: "PRESS_RETRY_BUTTON",
|
|
276
|
-
data: null
|
|
277
|
-
manual: true
|
|
410
|
+
data: null
|
|
278
411
|
}
|
|
279
412
|
```
|
|
280
413
|
|
|
@@ -285,11 +418,10 @@ For face-capture:
|
|
|
285
418
|
<td>The "Close" button is pressed.</td>
|
|
286
419
|
<td>
|
|
287
420
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
```face-capture```
|
|
421
|
+
`face-liveness`
|
|
422
|
+
<br>
|
|
423
|
+
<br>
|
|
424
|
+
`face-capture`
|
|
293
425
|
|
|
294
426
|
</td>
|
|
295
427
|
<td>
|
|
@@ -297,8 +429,7 @@ For face-capture:
|
|
|
297
429
|
```javascript
|
|
298
430
|
{
|
|
299
431
|
action: "CLOSE",
|
|
300
|
-
data: null
|
|
301
|
-
manual: true
|
|
432
|
+
data: null
|
|
302
433
|
}
|
|
303
434
|
```
|
|
304
435
|
|
|
@@ -309,11 +440,10 @@ For face-capture:
|
|
|
309
440
|
<td>The work of the component is completed successfully.</td>
|
|
310
441
|
<td>
|
|
311
442
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
```face-capture```
|
|
443
|
+
`face-liveness`
|
|
444
|
+
<br>
|
|
445
|
+
<br>
|
|
446
|
+
`face-capture`
|
|
317
447
|
|
|
318
448
|
</td>
|
|
319
449
|
<td>
|
|
@@ -325,7 +455,6 @@ For face-capture:
|
|
|
325
455
|
response: { ... },
|
|
326
456
|
status: 1
|
|
327
457
|
},
|
|
328
|
-
manual: false
|
|
329
458
|
}
|
|
330
459
|
```
|
|
331
460
|
|
|
@@ -336,11 +465,10 @@ For face-capture:
|
|
|
336
465
|
<td>The work of the component failed.</td>
|
|
337
466
|
<td>
|
|
338
467
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
```face-capture```
|
|
468
|
+
`face-liveness`
|
|
469
|
+
<br>
|
|
470
|
+
<br>
|
|
471
|
+
`face-capture`
|
|
344
472
|
|
|
345
473
|
</td>
|
|
346
474
|
<td>
|
|
@@ -349,10 +477,9 @@ For face-capture:
|
|
|
349
477
|
{
|
|
350
478
|
action: "PROCESS_FINISHED",
|
|
351
479
|
data: {
|
|
352
|
-
reason: "An
|
|
480
|
+
reason: "An event has occurred",
|
|
353
481
|
status: 0
|
|
354
482
|
},
|
|
355
|
-
manual: false
|
|
356
483
|
}
|
|
357
484
|
```
|
|
358
485
|
|
|
@@ -360,14 +487,38 @@ For face-capture:
|
|
|
360
487
|
<td></td>
|
|
361
488
|
</tr>
|
|
362
489
|
<tr>
|
|
363
|
-
<td>
|
|
490
|
+
<td>The work of the component finished by timeout.</td>
|
|
364
491
|
<td>
|
|
365
492
|
|
|
366
|
-
|
|
367
|
-
|
|
493
|
+
`face-liveness`
|
|
494
|
+
<br>
|
|
495
|
+
<br>
|
|
496
|
+
`face-capture`
|
|
368
497
|
|
|
369
|
-
|
|
370
|
-
|
|
498
|
+
</td>
|
|
499
|
+
<td>
|
|
500
|
+
|
|
501
|
+
```javascript
|
|
502
|
+
{
|
|
503
|
+
action: "PROCESS_FINISHED",
|
|
504
|
+
data: {
|
|
505
|
+
reason: "TIMEOUT_ERROR"
|
|
506
|
+
status: 0
|
|
507
|
+
},
|
|
508
|
+
}
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
</td>
|
|
512
|
+
<td></td>
|
|
513
|
+
</tr>
|
|
514
|
+
<tr>
|
|
515
|
+
<td>The component is initialized and ready to work.</td>
|
|
516
|
+
<td>
|
|
517
|
+
|
|
518
|
+
`face-liveness`
|
|
519
|
+
<br>
|
|
520
|
+
<br>
|
|
521
|
+
`face-capture`
|
|
371
522
|
|
|
372
523
|
</td>
|
|
373
524
|
<td>
|
|
@@ -375,8 +526,7 @@ For face-capture:
|
|
|
375
526
|
```javascript
|
|
376
527
|
{
|
|
377
528
|
action: "SERVICE_INITIALIZED",
|
|
378
|
-
data: null
|
|
379
|
-
manual: false
|
|
529
|
+
data: null
|
|
380
530
|
}
|
|
381
531
|
```
|
|
382
532
|
|
|
@@ -386,11 +536,11 @@ For face-capture:
|
|
|
386
536
|
</tbody>
|
|
387
537
|
</table>
|
|
388
538
|
|
|
389
|
-
##
|
|
539
|
+
## Response
|
|
390
540
|
|
|
391
|
-
You can get the response of the component in the
|
|
541
|
+
You can get the response of the component in the `detail` field of the event object.
|
|
392
542
|
|
|
393
|
-
|
|
543
|
+
For example:
|
|
394
544
|
|
|
395
545
|
```javascript
|
|
396
546
|
const component = document.getElementsByTagName('face-capture')[0];
|
|
@@ -405,73 +555,130 @@ function listener(event) {
|
|
|
405
555
|
component.addEventListener('face-capture', listener);
|
|
406
556
|
```
|
|
407
557
|
|
|
408
|
-
|
|
558
|
+
The `face-liveness` response has the following structure:
|
|
409
559
|
|
|
560
|
+
```javascript
|
|
561
|
+
{
|
|
562
|
+
code: number // Result codes from core lib
|
|
563
|
+
metadata: {
|
|
564
|
+
[key: string]: any
|
|
565
|
+
};
|
|
566
|
+
tag: string
|
|
567
|
+
status: number // liveness status: 0 if the person's liveness is confirmed, 1 if not.
|
|
568
|
+
estimatedAge: number | null // approximate age with an accuracy of +/-3 years
|
|
569
|
+
transactionId: string
|
|
570
|
+
images: string[] // array with the final image in base64
|
|
571
|
+
}
|
|
572
|
+
````
|
|
410
573
|
|
|
411
|
-
The
|
|
574
|
+
The `face-capture` response has the following structure:
|
|
412
575
|
|
|
413
576
|
```javascript
|
|
414
577
|
{
|
|
415
578
|
capture: string[] // array with the final image in base64
|
|
416
579
|
}
|
|
417
|
-
|
|
580
|
+
```
|
|
418
581
|
|
|
419
|
-
##
|
|
582
|
+
## Attributes
|
|
583
|
+
|
|
584
|
+
**Warning**. Passing parameters via attributes is deprecated. In future versions, support will be discontinued. Please use the settings.
|
|
420
585
|
|
|
421
586
|
### face-capture
|
|
422
587
|
|
|
423
|
-
| Attribute
|
|
424
|
-
|
|
425
|
-
| **locale**
|
|
426
|
-
| **copyright**
|
|
427
|
-
| **camera-id**
|
|
428
|
-
| **change-camera**
|
|
429
|
-
| **start-screen**
|
|
588
|
+
| Attribute | Info | Data type | Default value | Values |
|
|
589
|
+
|:-------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------:|:-------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|
590
|
+
| **locale** | The language of the component. | string | `en` | `ru`, `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` |
|
|
591
|
+
| **copyright** | Whether to show the Regula copyright footer. | boolean | `false` | `true`, `false` |
|
|
592
|
+
| **camera-id** | Ability to select a camera. | string | `undefined` | `camera id string value` |
|
|
593
|
+
| **change-camera** | Whether to show the camera switch button. | boolean | `true` | `true`, `false` |
|
|
594
|
+
| **start-screen** | Whether 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 the face. | boolean | `true` | `true`, `false` |
|
|
595
|
+
| **finish-screen** | Whether to show the finish screen (`success screen`, `retry-screen`). If `true`, the finish screen is shown. If `false`, no finish screen will be displayed, and **the user will only have one attempt to pass the liveness check**. | boolean | `true` | `true`, `false` |
|
|
596
|
+
| **close-disabled** | Whether to disable the "Close" button of the component. If set to `true`, the "Close" button is hidden from the user. | boolean | `false` | `true`, `false` |
|
|
430
597
|
|
|
431
598
|
### face-liveness
|
|
432
599
|
|
|
433
|
-
| Attribute
|
|
434
|
-
|
|
435
|
-
| **locale**
|
|
436
|
-
| **url**
|
|
437
|
-
| **copyright**
|
|
438
|
-
| **camera-id**
|
|
439
|
-
| **change-camera**
|
|
440
|
-
| **start-screen**
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
CSS:
|
|
460
|
-
|
|
461
|
-
```css
|
|
462
|
-
.my-custom-style {
|
|
463
|
-
--font-family: Arial, sans-serif;
|
|
464
|
-
--main-color: green;
|
|
465
|
-
--hover-color: red;
|
|
466
|
-
}
|
|
600
|
+
| Attribute | Info | Data type | Default value | Values |
|
|
601
|
+
|:--------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------:|:--------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|
602
|
+
| **locale** | The language of the component. | string | `en` | `ru`, `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` |
|
|
603
|
+
| **url** | The backend URL. | string | `https://faceapi.regulaforensics.com/` | any url |
|
|
604
|
+
| **copyright** | Whether to show the Regula copyright footer. | boolean | `false` | `true`, `false` |
|
|
605
|
+
| **camera-id** | The ability to select a camera by defining the camera ID. | string | `undefined` | `camera id string value` |
|
|
606
|
+
| **change-camera** | Whether to show the camera switch button. | boolean | `true` | `true`, `false` |
|
|
607
|
+
| **start-screen** | Whether to show the start screen with video instruction. 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 the face. | boolean | `true` | `true`, `false` |
|
|
608
|
+
| **finish-screen** | Whether to show the finish screen (`success screen`, `retry-screen`). If `true`, the finish screen is shown. If `false`, no finish screen will be displayed, and **the user will only have one attempt to pass the liveness check**. | boolean | `true` | `true`, `false` |
|
|
609
|
+
| **close-disabled** | Whether to disable the "Close" button of the component. If set to `true`, the "Close" button is hidden from the user. | boolean | `false` | `true`, `false` |
|
|
610
|
+
| **video-recording** | Whether to enable the video recording of the process. If set to `true`, the video is sent to the server. The video format depends on the browser: MP4 for Safari, WEB for other browsers. | boolean | `false` | `true`, `false` |
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
## Custom translations
|
|
614
|
+
|
|
615
|
+
To change the standard component messages or any text, specify the language you are using (or add your own) and the label you want to change (you can see the list of available languages in the [attributes](#component-attributes) section, the `locale` attribute):
|
|
616
|
+
|
|
617
|
+
```javascript
|
|
618
|
+
const element = document.querySelector('face-liveness');
|
|
619
|
+
|
|
620
|
+
element.translations = {
|
|
621
|
+
en: {
|
|
622
|
+
selfieTime: 'Get Selfie',
|
|
623
|
+
},
|
|
624
|
+
};
|
|
467
625
|
```
|
|
468
626
|
|
|
469
|
-
|
|
627
|
+
**Note**. To see the changes, don't forget to set the language you changed to the `locale` attribute:
|
|
470
628
|
|
|
471
629
|
```html
|
|
472
|
-
<face-
|
|
630
|
+
<face-liveness locale="en"></face-liveness>
|
|
473
631
|
```
|
|
474
632
|
|
|
633
|
+
The list of labels used in the component:
|
|
634
|
+
|
|
635
|
+
| Label | Default message in `en` locale | Used in |
|
|
636
|
+
|:------------------------------|:----------------------------------------------------------------------------------------------------|:-------------------------------:|
|
|
637
|
+
| **showOnlyOneFace** | Make sure there is only one face on the screen. | `face-liveness`, `face-capture` |
|
|
638
|
+
| **preparingCamera** | Preparing the camera... | `face-liveness`, `face-capture` |
|
|
639
|
+
| **allowAccessCamera** | Allow access to the camera | `face-liveness`, `face-capture` |
|
|
640
|
+
| **somethingWentWrong** | Something went wrong | `face-liveness`, `face-capture` |
|
|
641
|
+
| **incorrectCameraId** | No camera with the specified ID found. | `face-liveness`, `face-capture` |
|
|
642
|
+
| **checkCameraId** | Check if the specified camera ID is correct. | `face-liveness`, `face-capture` |
|
|
643
|
+
| **preparingService** | Preparing the service... | `face-liveness`, `face-capture` |
|
|
644
|
+
| **allowAccessToCamera** | Allow access to the camera and reload this page to continue. | `face-liveness`, `face-capture` |
|
|
645
|
+
| **error** | Error! | `face-liveness`, `face-capture` |
|
|
646
|
+
| **versionNotSupported** | Your browser version is not supported. | `face-liveness`, `face-capture` |
|
|
647
|
+
| **updateBrowser** | Update your browser version | `face-liveness`, `face-capture` |
|
|
648
|
+
| **licenseError** | A license error has occurred | `face-liveness`, `face-capture` |
|
|
649
|
+
| **licenseExpired** | The license cannot be found or has expired | `face-liveness`, `face-capture` |
|
|
650
|
+
| **onlyPortraitOrientation** | Portrait orientation only | `face-liveness`, `face-capture` |
|
|
651
|
+
| **turnDeviceIntoPortrait** | Please turn your device into portrait mode | `face-liveness`, `face-capture` |
|
|
652
|
+
| **tryAgain** | Try again | `face-liveness`, `face-capture` |
|
|
653
|
+
| **noCameraAvailable** | No camera available | `face-liveness`, `face-capture` |
|
|
654
|
+
| **checkCameraConnection** | Check the camera connection and try again. | `face-liveness`, `face-capture` |
|
|
655
|
+
| **lookStraight** | Look straight | `face-liveness`, `face-capture` |
|
|
656
|
+
| **fitYourFace** | Center your face | `face-liveness`, `face-capture` |
|
|
657
|
+
| **moveCloser** | Move closer | `face-liveness`, `face-capture` |
|
|
658
|
+
| **moveAway** | Move away | `face-liveness`, `face-capture` |
|
|
659
|
+
| **holdSteady** | Hold steady | `face-liveness`, `face-capture` |
|
|
660
|
+
| **processing** | Processing... | `face-liveness`, `face-capture` |
|
|
661
|
+
| **retryButtonText** | Retry | `face-liveness`, `face-capture` |
|
|
662
|
+
| **followGuidelinesText** | But please follow these guidelines: | `face-liveness`, `face-capture` |
|
|
663
|
+
| **letsTryAgainTitle** | Let’s try that again | `face-liveness`, `face-capture` |
|
|
664
|
+
| **noCameraPermission** | Camera unavailable! | `face-liveness`, `face-capture` |
|
|
665
|
+
| **goButton** | Go | `face-liveness`, `face-capture` |
|
|
666
|
+
| **selfieTime** | Selfie time! | `face-liveness`, `face-capture` |
|
|
667
|
+
| **ambientLighting** | Ambient lighting is not too bright or too dark and there are no shadows or glare on your face | `face-liveness` |
|
|
668
|
+
| **noMaskSunglassesHeaddress** | Neutral facial expression (no smiling, eyes open and mouth closed), no mask, sunglasses or headwear | `face-liveness` |
|
|
669
|
+
| **turnHead** | Turn your head a bit | `face-liveness` |
|
|
670
|
+
| **centerFaceTurnHead** | Center your face, turn your head | `face-liveness` |
|
|
671
|
+
| **centerFace** | Center your face | `face-capture` |
|
|
672
|
+
| **errorCode** | Error code: | `face-liveness` |
|
|
673
|
+
| **illumination** | Good illumination. | `face-liveness`, `face-capture` |
|
|
674
|
+
| **cameraLevel** | Camera at eye level. | `face-liveness`, `face-capture` |
|
|
675
|
+
| **noAccessories** | No accessories: glasses, mask, hat, etc. | `face-liveness`, `face-capture` |
|
|
676
|
+
| **getReady** | Get ready | `face-liveness`, `face-capture` |
|
|
677
|
+
|
|
475
678
|
## Examples
|
|
476
679
|
|
|
477
|
-
You can
|
|
680
|
+
You can find examples of using the components on the <a href="https://github.com/regulaforensics/face-web-components-samples" target="_blank">Samples page</a>.
|
|
681
|
+
|
|
682
|
+
## Additional resources
|
|
683
|
+
|
|
684
|
+
The Face SDK web components are also available on <a href="https://storybook-face.regulaforensics.com/" target="_blank">Storybook</a>.
|