@regulaforensics/vp-frontend-face-components 2.0.1 → 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.
Files changed (238) hide show
  1. package/README.md +362 -167
  2. package/dist/main.js +1 -1
  3. package/dist/main.js.LICENSE.txt +20 -0
  4. package/lib/index.d.ts +229 -0
  5. package/package.json +5 -83
  6. package/lib/common/BackCameraIcon.d.ts +0 -6
  7. package/lib/common/Button.d.ts +0 -7
  8. package/lib/common/CameraChangeIcon.d.ts +0 -6
  9. package/lib/common/CameraIcon.d.ts +0 -6
  10. package/lib/common/CheckIcon.d.ts +0 -6
  11. package/lib/common/CrossIcon.d.ts +0 -6
  12. package/lib/common/DocReaderCameraDisabled.d.ts +0 -5
  13. package/lib/common/DocReaderCameraPreparing.d.ts +0 -5
  14. package/lib/common/DocReaderFlip.d.ts +0 -5
  15. package/lib/common/DocReaderProcessing.d.ts +0 -5
  16. package/lib/common/DocReaderProcessingError.d.ts +0 -5
  17. package/lib/common/DocReaderProcessingFinished.d.ts +0 -6
  18. package/lib/common/DocReaderSearch.d.ts +0 -5
  19. package/lib/common/ErrorIcon.d.ts +0 -6
  20. package/lib/common/FromCameraIcon.d.ts +0 -5
  21. package/lib/common/FromGalleryIcon.d.ts +0 -5
  22. package/lib/common/FrontCameraIcon.d.ts +0 -6
  23. package/lib/common/FullscreenExitIcon.d.ts +0 -6
  24. package/lib/common/FullscreenIcon.d.ts +0 -6
  25. package/lib/common/Icon.d.ts +0 -64
  26. package/lib/common/Message.d.ts +0 -8
  27. package/lib/common/NoGlareIconLivenessDetection.d.ts +0 -5
  28. package/lib/common/NoSmilingIconLivenessDetection.d.ts +0 -5
  29. package/lib/common/PortraitOrientationOnlyIcon.d.ts +0 -6
  30. package/lib/common/RegulaLogo.d.ts +0 -6
  31. package/lib/common/RegulaLogoLivenessDetection.d.ts +0 -5
  32. package/lib/common/SnapshotIcon.d.ts +0 -6
  33. package/lib/common/Spinner.d.ts +0 -3
  34. package/lib/common/SquareIcon.d.ts +0 -6
  35. package/lib/common/StopIcon.d.ts +0 -6
  36. package/lib/common/VerifiedIcon.d.ts +0 -6
  37. package/lib/components/ButtonFaceLiveness.d.ts +0 -7
  38. package/lib/components/CameraCapture.d.ts +0 -9
  39. package/lib/components/CameraSnapshot.d.ts +0 -2
  40. package/lib/components/CameraSnapshotFileCapture.d.ts +0 -10
  41. package/lib/components/DocumentCapture.d.ts +0 -11
  42. package/lib/components/DocumentContainer.d.ts +0 -11
  43. package/lib/components/DocumentReader.d.ts +0 -2
  44. package/lib/components/DocumentReaderFileCapture.d.ts +0 -12
  45. package/lib/components/DocumentReaderLayout.d.ts +0 -22
  46. package/lib/components/DocumentReaderStartScreen.d.ts +0 -10
  47. package/lib/components/ErrorBoundary.d.ts +0 -18
  48. package/lib/components/FaceCapture.d.ts +0 -25
  49. package/lib/components/FaceDetection.d.ts +0 -2
  50. package/lib/components/FaceFullScreenOverlay.d.ts +0 -10
  51. package/lib/components/FaceHintAnimaition.d.ts +0 -16
  52. package/lib/components/FaceLayout.d.ts +0 -23
  53. package/lib/components/FaceLiveness.d.ts +0 -2
  54. package/lib/components/InfoScreen.d.ts +0 -11
  55. package/lib/components/InfoScreenFaceLiveness.d.ts +0 -12
  56. package/lib/components/InstructionVideoScreen.d.ts +0 -9
  57. package/lib/components/ProcessScreen.d.ts +0 -6
  58. package/lib/components/ProcessScreenFaceLiveness.d.ts +0 -6
  59. package/lib/components/RetryScreenFaceLiveness.d.ts +0 -7
  60. package/lib/components/SectorAnimationSvg.d.ts +0 -11
  61. package/lib/components/WebCamera.d.ts +0 -19
  62. package/lib/constants.d.ts +0 -668
  63. package/lib/contexts/DocumentAttributesContext.d.ts +0 -25
  64. package/lib/contexts/DocumentSDKContext.d.ts +0 -8
  65. package/lib/contexts/FaceAttributesContext.d.ts +0 -26
  66. package/lib/hoc/withDocumentAttributesContext.d.ts +0 -4
  67. package/lib/hoc/withDocumentSDKContext.d.ts +0 -3
  68. package/lib/hoc/withFaceAttributesContext.d.ts +0 -4
  69. package/lib/hoc/withLocalize.d.ts +0 -8
  70. package/lib/hooks/useDocumentReaderSeries.d.ts +0 -19
  71. package/lib/hooks/useDocumentReaderSingle.d.ts +0 -14
  72. package/lib/hooks/useFaceLiveness.d.ts +0 -41
  73. package/lib/hooks/useImageInputParam.d.ts +0 -7
  74. package/lib/hooks/useOrientationChange.d.ts +0 -10
  75. package/lib/hooks/useStateCallback.d.ts +0 -1
  76. package/lib/hooks/useStream.d.ts +0 -10
  77. package/lib/hooks/useUserAgent.d.ts +0 -3
  78. package/lib/hooks/useWindowBlur.d.ts +0 -2
  79. package/lib/i18n/dictionaries/_dictionaries.d.ts +0 -2275
  80. package/lib/index-document.d.ts +0 -4
  81. package/lib/index-face.d.ts +0 -1
  82. package/lib/media-resources/resourcesBase64.d.ts +0 -7
  83. package/lib/models/CameraModel.d.ts +0 -9
  84. package/lib/models/CustomError.d.ts +0 -7
  85. package/lib/models/DocReaderWebclient/ext/authenticity/authenticity.d.ts +0 -32
  86. package/lib/models/DocReaderWebclient/ext/authenticity/fiber.d.ts +0 -7
  87. package/lib/models/DocReaderWebclient/ext/authenticity/ident.d.ts +0 -8
  88. package/lib/models/DocReaderWebclient/ext/authenticity/image-ident.d.ts +0 -7
  89. package/lib/models/DocReaderWebclient/ext/authenticity/index.d.ts +0 -5
  90. package/lib/models/DocReaderWebclient/ext/authenticity/ocr-security-text.d.ts +0 -7
  91. package/lib/models/DocReaderWebclient/ext/authenticity/security-feature.d.ts +0 -8
  92. package/lib/models/DocReaderWebclient/ext/images.d.ts +0 -16
  93. package/lib/models/DocReaderWebclient/ext/index.d.ts +0 -6
  94. package/lib/models/DocReaderWebclient/ext/process-request-image.d.ts +0 -5
  95. package/lib/models/DocReaderWebclient/ext/process-request.d.ts +0 -38
  96. package/lib/models/DocReaderWebclient/ext/process-response.d.ts +0 -36
  97. package/lib/models/DocReaderWebclient/ext/text-field.d.ts +0 -40
  98. package/lib/models/DocReaderWebclient/ext/text.d.ts +0 -14
  99. package/lib/models/DocReaderWebclient/models/area-array.d.ts +0 -32
  100. package/lib/models/DocReaderWebclient/models/area-container.d.ts +0 -38
  101. package/lib/models/DocReaderWebclient/models/authenticity-check-list.d.ts +0 -31
  102. package/lib/models/DocReaderWebclient/models/authenticity-check-result-item.d.ts +0 -38
  103. package/lib/models/DocReaderWebclient/models/authenticity-check-result.d.ts +0 -43
  104. package/lib/models/DocReaderWebclient/models/authenticity-result-all-of.d.ts +0 -25
  105. package/lib/models/DocReaderWebclient/models/authenticity-result-type.d.ts +0 -33
  106. package/lib/models/DocReaderWebclient/models/authenticity-result.d.ts +0 -18
  107. package/lib/models/DocReaderWebclient/models/bc-pdf417-info.d.ts +0 -54
  108. package/lib/models/DocReaderWebclient/models/bc-roidetect.d.ts +0 -42
  109. package/lib/models/DocReaderWebclient/models/check-diagnose.d.ts +0 -98
  110. package/lib/models/DocReaderWebclient/models/check-result.d.ts +0 -30
  111. package/lib/models/DocReaderWebclient/models/chosen-document-type-result-all-of.d.ts +0 -25
  112. package/lib/models/DocReaderWebclient/models/chosen-document-type-result.d.ts +0 -19
  113. package/lib/models/DocReaderWebclient/models/chosen-document-type.d.ts +0 -74
  114. package/lib/models/DocReaderWebclient/models/container-list.d.ts +0 -45
  115. package/lib/models/DocReaderWebclient/models/critical.d.ts +0 -26
  116. package/lib/models/DocReaderWebclient/models/cross-source-value-comparison.d.ts +0 -38
  117. package/lib/models/DocReaderWebclient/models/data-module.d.ts +0 -48
  118. package/lib/models/DocReaderWebclient/models/details-optical.d.ts +0 -67
  119. package/lib/models/DocReaderWebclient/models/details-rfid.d.ts +0 -61
  120. package/lib/models/DocReaderWebclient/models/device-info.d.ts +0 -54
  121. package/lib/models/DocReaderWebclient/models/doc-bar-code-info-all-of.d.ts +0 -31
  122. package/lib/models/DocReaderWebclient/models/doc-bar-code-info.d.ts +0 -19
  123. package/lib/models/DocReaderWebclient/models/doc-visual-extended-field.d.ts +0 -70
  124. package/lib/models/DocReaderWebclient/models/doc-visual-extended-info.d.ts +0 -25
  125. package/lib/models/DocReaderWebclient/models/document-format.d.ts +0 -70
  126. package/lib/models/DocReaderWebclient/models/document-image-result-all-of.d.ts +0 -25
  127. package/lib/models/DocReaderWebclient/models/document-image-result.d.ts +0 -18
  128. package/lib/models/DocReaderWebclient/models/document-image.d.ts +0 -24
  129. package/lib/models/DocReaderWebclient/models/document-position-result-all-of.d.ts +0 -25
  130. package/lib/models/DocReaderWebclient/models/document-position-result.d.ts +0 -19
  131. package/lib/models/DocReaderWebclient/models/document-position.d.ts +0 -80
  132. package/lib/models/DocReaderWebclient/models/document-type-recognition-result.d.ts +0 -30
  133. package/lib/models/DocReaderWebclient/models/document-type.d.ts +0 -246
  134. package/lib/models/DocReaderWebclient/models/document-types-candidates-list.d.ts +0 -32
  135. package/lib/models/DocReaderWebclient/models/document-types-candidates-result-all-of.d.ts +0 -25
  136. package/lib/models/DocReaderWebclient/models/document-types-candidates-result.d.ts +0 -18
  137. package/lib/models/DocReaderWebclient/models/document-types-candidates.d.ts +0 -32
  138. package/lib/models/DocReaderWebclient/models/encrypted-rclresult-all-of.d.ts +0 -24
  139. package/lib/models/DocReaderWebclient/models/encrypted-rclresult.d.ts +0 -18
  140. package/lib/models/DocReaderWebclient/models/fdsidlist.d.ts +0 -80
  141. package/lib/models/DocReaderWebclient/models/fiber-result-all-of.d.ts +0 -74
  142. package/lib/models/DocReaderWebclient/models/fiber-result.d.ts +0 -18
  143. package/lib/models/DocReaderWebclient/models/graphic-field-type.d.ts +0 -118
  144. package/lib/models/DocReaderWebclient/models/graphic-field.d.ts +0 -63
  145. package/lib/models/DocReaderWebclient/models/graphic-fields-list.d.ts +0 -25
  146. package/lib/models/DocReaderWebclient/models/graphics-result-all-of.d.ts +0 -25
  147. package/lib/models/DocReaderWebclient/models/graphics-result.d.ts +0 -19
  148. package/lib/models/DocReaderWebclient/models/ident-result-all-of.d.ts +0 -65
  149. package/lib/models/DocReaderWebclient/models/ident-result.d.ts +0 -18
  150. package/lib/models/DocReaderWebclient/models/image-data.d.ts +0 -24
  151. package/lib/models/DocReaderWebclient/models/image-qa.d.ts +0 -54
  152. package/lib/models/DocReaderWebclient/models/image-quality-check-list.d.ts +0 -32
  153. package/lib/models/DocReaderWebclient/models/image-quality-check-type.d.ts +0 -50
  154. package/lib/models/DocReaderWebclient/models/image-quality-check.d.ts +0 -64
  155. package/lib/models/DocReaderWebclient/models/image-quality-result-all-of.d.ts +0 -25
  156. package/lib/models/DocReaderWebclient/models/image-quality-result.d.ts +0 -18
  157. package/lib/models/DocReaderWebclient/models/images-available-source.d.ts +0 -31
  158. package/lib/models/DocReaderWebclient/models/images-field-value.d.ts +0 -70
  159. package/lib/models/DocReaderWebclient/models/images-field.d.ts +0 -38
  160. package/lib/models/DocReaderWebclient/models/images-result-all-of.d.ts +0 -25
  161. package/lib/models/DocReaderWebclient/models/images-result.d.ts +0 -18
  162. package/lib/models/DocReaderWebclient/models/images.d.ts +0 -32
  163. package/lib/models/DocReaderWebclient/models/index.d.ts +0 -123
  164. package/lib/models/DocReaderWebclient/models/lcid.d.ts +0 -582
  165. package/lib/models/DocReaderWebclient/models/lexical-analysis-result-all-of.d.ts +0 -25
  166. package/lib/models/DocReaderWebclient/models/lexical-analysis-result.d.ts +0 -19
  167. package/lib/models/DocReaderWebclient/models/license-result-all-of.d.ts +0 -24
  168. package/lib/models/DocReaderWebclient/models/license-result.d.ts +0 -18
  169. package/lib/models/DocReaderWebclient/models/light.d.ts +0 -34
  170. package/lib/models/DocReaderWebclient/models/list-verified-fields.d.ts +0 -25
  171. package/lib/models/DocReaderWebclient/models/log-level.d.ts +0 -23
  172. package/lib/models/DocReaderWebclient/models/measure-system.d.ts +0 -26
  173. package/lib/models/DocReaderWebclient/models/mrzformat.d.ts +0 -24
  174. package/lib/models/DocReaderWebclient/models/ocrsecurity-text-result-all-of.d.ts +0 -81
  175. package/lib/models/DocReaderWebclient/models/ocrsecurity-text-result.d.ts +0 -18
  176. package/lib/models/DocReaderWebclient/models/one-candidate.d.ts +0 -74
  177. package/lib/models/DocReaderWebclient/models/original-symbol.d.ts +0 -37
  178. package/lib/models/DocReaderWebclient/models/parray-field.d.ts +0 -81
  179. package/lib/models/DocReaderWebclient/models/per-document-config.d.ts +0 -30
  180. package/lib/models/DocReaderWebclient/models/photo-ident-result-all-of.d.ts +0 -76
  181. package/lib/models/DocReaderWebclient/models/photo-ident-result.d.ts +0 -18
  182. package/lib/models/DocReaderWebclient/models/point-array.d.ts +0 -25
  183. package/lib/models/DocReaderWebclient/models/point.d.ts +0 -30
  184. package/lib/models/DocReaderWebclient/models/points-container.d.ts +0 -31
  185. package/lib/models/DocReaderWebclient/models/process-params.d.ts +0 -254
  186. package/lib/models/DocReaderWebclient/models/process-request-image.d.ts +0 -38
  187. package/lib/models/DocReaderWebclient/models/process-request.d.ts +0 -60
  188. package/lib/models/DocReaderWebclient/models/process-response.d.ts +0 -66
  189. package/lib/models/DocReaderWebclient/models/process-system-info.d.ts +0 -30
  190. package/lib/models/DocReaderWebclient/models/processing-status.d.ts +0 -30
  191. package/lib/models/DocReaderWebclient/models/raw-image-container-list.d.ts +0 -31
  192. package/lib/models/DocReaderWebclient/models/rectangle-coordinates.d.ts +0 -42
  193. package/lib/models/DocReaderWebclient/models/result-item.d.ts +0 -48
  194. package/lib/models/DocReaderWebclient/models/result.d.ts +0 -98
  195. package/lib/models/DocReaderWebclient/models/rfid-location.d.ts +0 -30
  196. package/lib/models/DocReaderWebclient/models/rfid-origin.d.ts +0 -42
  197. package/lib/models/DocReaderWebclient/models/scenario.d.ts +0 -36
  198. package/lib/models/DocReaderWebclient/models/security-feature-result-all-of.d.ts +0 -59
  199. package/lib/models/DocReaderWebclient/models/security-feature-result.d.ts +0 -18
  200. package/lib/models/DocReaderWebclient/models/security-feature-type.d.ts +0 -49
  201. package/lib/models/DocReaderWebclient/models/source-validity.d.ts +0 -32
  202. package/lib/models/DocReaderWebclient/models/source.d.ts +0 -23
  203. package/lib/models/DocReaderWebclient/models/status-result-all-of.d.ts +0 -25
  204. package/lib/models/DocReaderWebclient/models/status-result.d.ts +0 -18
  205. package/lib/models/DocReaderWebclient/models/status.d.ts +0 -63
  206. package/lib/models/DocReaderWebclient/models/string-recognition-result.d.ts +0 -25
  207. package/lib/models/DocReaderWebclient/models/symbol-candidate.d.ts +0 -30
  208. package/lib/models/DocReaderWebclient/models/symbol-recognition-result.d.ts +0 -32
  209. package/lib/models/DocReaderWebclient/models/text-available-source.d.ts +0 -38
  210. package/lib/models/DocReaderWebclient/models/text-data-result-all-of.d.ts +0 -25
  211. package/lib/models/DocReaderWebclient/models/text-data-result.d.ts +0 -19
  212. package/lib/models/DocReaderWebclient/models/text-field-type.d.ts +0 -2386
  213. package/lib/models/DocReaderWebclient/models/text-field-value.d.ts +0 -70
  214. package/lib/models/DocReaderWebclient/models/text-field.d.ts +0 -84
  215. package/lib/models/DocReaderWebclient/models/text-post-processing.d.ts +0 -22
  216. package/lib/models/DocReaderWebclient/models/text-result-all-of.d.ts +0 -25
  217. package/lib/models/DocReaderWebclient/models/text-result.d.ts +0 -18
  218. package/lib/models/DocReaderWebclient/models/text.d.ts +0 -51
  219. package/lib/models/DocReaderWebclient/models/transaction-info.d.ts +0 -42
  220. package/lib/models/DocReaderWebclient/models/verification-result.d.ts +0 -38
  221. package/lib/models/DocReaderWebclient/models/verified-field-map.d.ts +0 -63
  222. package/lib/models/DocReaderWebclient/models/visibility.d.ts +0 -23
  223. package/lib/models/ImageModel.d.ts +0 -7
  224. package/lib/services/DebugService.d.ts +0 -17
  225. package/lib/services/DeviceOrientationService.d.ts +0 -18
  226. package/lib/services/DocumentReaderProcessor.d.ts +0 -43
  227. package/lib/services/DocumentReaderService.d.ts +0 -37
  228. package/lib/services/EventEmitter.d.ts +0 -9
  229. package/lib/services/FaceLivenessService.d.ts +0 -70
  230. package/lib/services/FaceService.d.ts +0 -39
  231. package/lib/services/StreamRecorderService.d.ts +0 -24
  232. package/lib/types.d.ts +0 -361
  233. package/lib/utils.d.ts +0 -30
  234. package/lib/web-components/CameraSnapshot.d.ts +0 -14
  235. package/lib/web-components/DocumentReader.d.ts +0 -14
  236. package/lib/web-components/FaceDetection.d.ts +0 -11
  237. package/lib/web-components/FaceLiveness.d.ts +0 -17
  238. package/lib/web-components/FullScreenContainer.d.ts +0 -4
package/README.md CHANGED
@@ -1,28 +1,46 @@
1
- # Table of contents
2
- 1. [About](#about)
3
- 1. [Compatibility](#compatibility)
4
- 1. [Install via NPM](#install-via-npm)
5
- 1. [Install via CDN](#install-via-cdn)
6
- 1. [Component settings](#component-settings)
7
- 1. [Components events](#components-events)
8
- 1. [Component response](#component-response)
9
- 1. [Component attributes](#component-attributes)
10
- 1. [Component customization](#component-customization)
11
- 1. [Examples](#examples)
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
- ## About
19
+ ## Overview
16
20
 
17
- This package contains web components for face recognition.
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 | ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_48x48.png) | ![FireFox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_48x48.png) | ![Safari](https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari/safari_48x48.png) |
22
40
  |:---------------------|:-------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------:|
23
41
  | **Mobile (iOS)** | 99 (iOS14.4+) | 99 (iOS14.4+) | 11 |
24
- | **Mobile (Android)** | 66 | 62 | - |
25
- | **Desktop** | 66 | 63 | 11 |
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 ```@regulaforensics/vp-frontend-face-components```:
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 ```index.html``` and ```index.js``` files in the root directory of the project.
66
+ Create `index.html` and `index.js` files in the root directory of the project.
49
67
 
50
- Import ```@regulaforensics/vp-frontend-face-components``` into your ```index.js```:
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 ```index.html``` connect ```index.js``` and add the name of the component you want to use. Available components:
74
+ In `index.html` connect `index.js` and add the name of the component you want to use. Available components:
57
75
 
58
- 1. ```<face-capture></face-capture>``` - for create a face snapshot;
59
- 1. ```<face-liveness></face-liveness>``` - for liveness verification.
76
+ 1. `<face-capture></face-capture>` - for creating a face snapshot;
77
+ 1. `<face-liveness></face-liveness>` - for performing liveness verification.
60
78
 
61
- Example:
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 ```.html``` file. CDN link: ```unpkg.com/:package@:version/:file```
97
+ Connect the script in your `.html` file. CDN link: `unpkg.com/:package@:version/:file`
80
98
 
81
- Example:
99
+ For example:
82
100
 
83
101
  ```html
84
- <script src="https://unpkg.com/@regulaforensics/vp-frontend-face-components@2.0.0/dist/main.js"></script>
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
- ## Component settings
90
-
91
- ### face-liveness
107
+ ## Settings
92
108
 
93
- The server generates a unique identifier for each session before starting a verification process. Using ```sessionId``` setter you can set custom value. Make sure that the ```sessionId``` is unique for each session
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
- ```javascript
113
+ ````javascript
98
114
  const component = document.getElementsByTagName('face-liveness')[0];
99
115
 
100
- component.sessionId = "ID"
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
- After passing two stages of verification, the component sends the received data for processing to the API. Using ```headers``` setter you can set HTTP POST method headers.
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.headers = {
111
- Authorization: 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
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
- ## Components events
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 ```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.
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 (```event.detail```) contains three fields that describe the event:
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 | Description of the action | In which component is present |
144
- |:--------------------------|:------------------------------------:|:---------------------------------------:|
145
- | ```ELEMENT_VISIBLE``` | Component is appended in the DOM. | ```face-liveness```, ```face-capture``` |
146
- | ```PRESS_START_BUTTON``` | The "Get started" button is pressed. | ```face-liveness```, ```face-capture``` |
147
- | ```PRESS_RETRY_BUTTON``` | The "Retry" button is pressed. | ```face-liveness```, ```face-capture``` |
148
- | ```CLOSE``` | The "Close" button is pressed. | ```face-liveness```, ```face-capture``` |
149
- | ```PROCESS_FINISHED``` | The component has finished its work. | ```face-liveness```, ```face-capture``` |
150
- | ```SERVICE_INITIALIZED``` | The component has started its work. | ```face-liveness```, ```face-capture``` |
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 ```data``` field will contain the following fields:
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 ```data``` field will contain the following fields:
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 error causes:
171
-
172
- | Reason | Description of the reason |
173
- |:--------------------------------|:--------------------------------------------:|
174
- | ```WASM_ERROR``` | Error in WASM. |
175
- | ```WASM_LICENSE``` | Missing or incorrect license. |
176
- | ```UNKNOWN_ERROR``` | Unknown error. |
177
- | ```NOT_SUPPORTED``` | The browser is not supported. |
178
- | ```CAMERA_UNKNOWN_ERROR``` | Unknown camera error. |
179
- | ```CAMERA_PERMISSION_DENIED``` | Access to the camera is prohibited. |
180
- | ```NO_CAMERA``` | There is no camera. |
181
- | ```CONNECTION_ERROR``` | Connection errors. |
182
- | ```LANDSCAPE_MODE_RESTRICTED``` | Work in landscape orientation is prohibited. |
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 ```event.detail```
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
- For face-liveness:
206
- ```face-liveness```
207
-
208
- For face-capture:
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
- Example:
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
- For face-liveness:
241
- ```face-liveness```
242
-
243
- For face-capture:
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
- For face-liveness:
265
- ```face-liveness```
266
-
267
- For face-capture:
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
- For face-liveness:
289
- ```face-liveness```
290
-
291
- For face-capture:
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
- For face-liveness:
313
- ```face-liveness```
314
-
315
- For face-capture:
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
- For face-liveness:
340
- ```face-liveness```
341
-
342
- For face-capture:
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 error has occurred",
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>Component is initialized and ready to work.</td>
490
+ <td>The work of the component finished by timeout.</td>
364
491
  <td>
365
492
 
366
- For face-liveness:
367
- ```face-liveness```
493
+ `face-liveness`
494
+ <br>
495
+ <br>
496
+ `face-capture`
497
+
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>
368
517
 
369
- For face-capture:
370
- ```face-capture```
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
- ## Component response
539
+ ## Response
390
540
 
391
- You can get the response of the component in the ```detail``` field of the event object.
541
+ You can get the response of the component in the `detail` field of the event object.
392
542
 
393
- Example:
543
+ For example:
394
544
 
395
545
  ```javascript
396
546
  const component = document.getElementsByTagName('face-capture')[0];
@@ -405,7 +555,7 @@ function listener(event) {
405
555
  component.addEventListener('face-capture', listener);
406
556
  ```
407
557
 
408
- The ```face-liveness``` response has the following structure
558
+ The `face-liveness` response has the following structure:
409
559
 
410
560
  ```javascript
411
561
  {
@@ -413,77 +563,122 @@ The ```face-liveness``` response has the following structure
413
563
  metadata: {
414
564
  [key: string]: any
415
565
  };
416
- sessionId: string
417
- status: number // liveness status
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
418
569
  transactionId: string
419
570
  images: string[] // array with the final image in base64
420
571
  }
421
572
  ````
422
573
 
423
- The ```face-capture``` response has the following structure
574
+ The `face-capture` response has the following structure:
424
575
 
425
576
  ```javascript
426
577
  {
427
578
  capture: string[] // array with the final image in base64
428
579
  }
429
- ````
580
+ ```
581
+
582
+ ## Attributes
430
583
 
431
- ## Component attributes
584
+ **Warning**. Passing parameters via attributes is deprecated. In future versions, support will be discontinued. Please use the settings.
432
585
 
433
586
  ### face-capture
434
587
 
435
- | Attribute | Info | Data type | Default value | Values |
436
- |:-----------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------:|:---------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
437
- | **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``` |
438
- | **copyright** | Show Regula copyright footer. | boolean | ```false``` | ```true```, ```false``` |
439
- | **camera-id** | Ability to select a camera. | string | ```undefined``` | ```camera id string value``` |
440
- | **change-camera** | Show the camera switch button. | boolean | ```true``` | ```true```, ```false``` |
441
- | **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``` |
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` |
442
597
 
443
598
  ### face-liveness
444
599
 
445
- | Attribute | Info | Data type | Default value | Values |
446
- |:-----------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------:|:------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
447
- | **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``` |
448
- | **url** | Backend url. | string | ```https://faceapi.regulaforensics.com/``` | any url |
449
- | **copyright** | Show Regula copyright footer. | boolean | ```false``` | ```true```, ```false``` |
450
- | **camera-id** | Ability to select a camera. | string | ```undefined``` | ```camera id string value``` |
451
- | **change-camera** | Show the camera switch button. | boolean | ```true``` | ```true```, ```false``` |
452
- | **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``` |
453
-
454
- ## Component customization
455
-
456
- Using CSS variables, you can change the font and the main colors of the components.
457
-
458
- | Variable | Info | Default value |
459
- |:-----------------------------|:----------------------------------------------------------------------------------------|:---------------------------:|
460
- | **--font-family** | Сomponent font. | ```Noto Sans, sans-serif``` |
461
- | **--font-size** | Сomponent base font size. | ```16px``` |
462
- | **--main-color** | Button and frame color. | ```#7E57C5``` |
463
- | **--hover-color** | Button hover color. | ```#7c45b4``` |
464
- | **--active-color** | Button active color. | ```#7E57C5``` |
465
- | **--plate-color** | Information plate color. | ```#E8E8E8``` |
466
- | **--target-sector-color** | Target sector color (available only in face-liveness component). | ```#BEABE2``` |
467
- | **--direction-sector-color** | Direction sector color (available only in face-liveness component). | ```#EAEAEA``` |
468
-
469
- Example:
470
-
471
- CSS:
472
-
473
- ```css
474
- .my-custom-style {
475
- --font-family: Arial, sans-serif;
476
- --main-color: green;
477
- --hover-color: red;
478
- }
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
+ };
479
625
  ```
480
626
 
481
- HTML:
627
+ **Note**. To see the changes, don't forget to set the language you changed to the `locale` attribute:
482
628
 
483
629
  ```html
484
- <face-capture class="my-custom-style"></face-capture>
630
+ <face-liveness locale="en"></face-liveness>
485
631
  ```
486
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
+
487
678
  ## Examples
488
679
 
489
- You can see the examples of using the components on the [Samples page](https://github.com/regulaforensics/face-web-components-samples).
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>.