@getyoti/react-face-capture 2.6.2 → 2.8.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/CHANGELOG.md +51 -0
- package/README.md +77 -55
- package/index.d.ts +51 -20
- package/index.js +7 -7
- package/index.js.LICENSE.txt +0 -37
- package/package.json +1 -2
- package/vanilla/index.js +10 -10
- package/vanilla/index.js.LICENSE.txt +1 -1
- package/vanilla/index.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## v2.8.0
|
|
4
|
+
|
|
5
|
+
### New features
|
|
6
|
+
|
|
7
|
+
- Axios has been removed and now fetch is used across the app.
|
|
8
|
+
- Improve user guidance in `center` mode.
|
|
9
|
+
- Extra on-screen feedback is displayed if the user has not placed their face in the frame after a certain amount of time.
|
|
10
|
+
- Add new localisation:
|
|
11
|
+
- `ka-GE`: Georgian
|
|
12
|
+
- `sr-RS`: Serbian (Cyrillic script)
|
|
13
|
+
- `sr-Latn-RS`: Serbian (Latin script)
|
|
14
|
+
- Localisation has been revised. The following languages have been updated:
|
|
15
|
+
- `el-GR`: Greek
|
|
16
|
+
- `bs-BA`: Bosnian
|
|
17
|
+
- Improve user feedback stability.
|
|
18
|
+
- Improve documentation:
|
|
19
|
+
- `returnPreviewImage` property. Highlighting that the preview image is not signed and should only be used for user feedback.
|
|
20
|
+
- `EXCEEDED_TIME_TO_LOAD` error. Making it more straightforward.
|
|
21
|
+
|
|
22
|
+
## v2.7.0
|
|
23
|
+
|
|
24
|
+
### New features
|
|
25
|
+
|
|
26
|
+
#### Multiframe
|
|
27
|
+
|
|
28
|
+
Multiframe is a new layer of protection added on top of the curren security features that further improves virtual injection detection.
|
|
29
|
+
|
|
30
|
+
- Adds a new prop `multiframe` to enable and disable this features. (Default:false)
|
|
31
|
+
- The new `multiframe`mode, only works with the `secure` mode and needs the query param `multiframe=true` added to the prediction request.
|
|
32
|
+
- Enabling `multiframe` will increase the payload size.
|
|
33
|
+
- When enabling`multiframe`, the following property values will be ignored and handled internally for optimal performance:
|
|
34
|
+
- `format`
|
|
35
|
+
- `resolutionType`
|
|
36
|
+
- `qualityType`
|
|
37
|
+
- `imageType`
|
|
38
|
+
- `allowBackgroundFaces`
|
|
39
|
+
|
|
40
|
+
#### Others
|
|
41
|
+
|
|
42
|
+
- Adds a new prop `sessionDuration` which specifies the maximum duration of the session before it times out, regardless of number of retry attempts.
|
|
43
|
+
- The value must be within 30s and 5m (in milliseconds), and invalid values will trigger an exception.
|
|
44
|
+
- The icon for the multiple faces feedback was changed.
|
|
45
|
+
- `a11yLiveRegionMode` is now deprecated and will be removed in the next major release. Accessibility features like `aria-live` are now handled internally.
|
|
46
|
+
|
|
47
|
+
### Fixes
|
|
48
|
+
|
|
49
|
+
- The feedback message is centred so the possibility of overlap with the face layout has been reduced.
|
|
50
|
+
- Localisation has been revised. The following languages have been updated:
|
|
51
|
+
- `bs-BA`: Bosnian
|
|
52
|
+
- `sr-RS`: Serbian (Latin script)
|
|
53
|
+
|
|
3
54
|
## v2.6.2
|
|
4
55
|
|
|
5
56
|
### Fixes
|
package/README.md
CHANGED
|
@@ -22,14 +22,14 @@ The package depends on the following peer dependencies
|
|
|
22
22
|
|
|
23
23
|
<browserSupportTable>
|
|
24
24
|
|
|
25
|
-
| Browser | Versions
|
|
26
|
-
| ------- |
|
|
27
|
-
| and_chr |
|
|
28
|
-
| chrome |
|
|
29
|
-
| edge |
|
|
30
|
-
| firefox |
|
|
31
|
-
| ios_saf | 18.5,18.4,18.3 |
|
|
32
|
-
| safari | 18.5,18.4,18.3,18.2 |
|
|
25
|
+
| Browser | Versions |
|
|
26
|
+
| ------- | ------------------------ |
|
|
27
|
+
| and_chr | 139 |
|
|
28
|
+
| chrome | 140,139,138,137 |
|
|
29
|
+
| edge | 140,139 |
|
|
30
|
+
| firefox | 142,141,140,139 |
|
|
31
|
+
| ios_saf | 18.5-18.6,18.4,18.3 |
|
|
32
|
+
| safari | 18.5-18.6,18.4,18.3,18.2 |
|
|
33
33
|
|
|
34
34
|
</browserSupportTable>
|
|
35
35
|
|
|
@@ -119,35 +119,37 @@ The CSS custom properties must be defined using the `:root` CSS selector. Here i
|
|
|
119
119
|
|
|
120
120
|
### Properties
|
|
121
121
|
|
|
122
|
-
| Property name | Type | Default | Mandatory | Description
|
|
123
|
-
| ------------------------------------ | ------------------------------------- | ---------------------- | --------- |
|
|
124
|
-
| captureMethod | String `manual/auto` | `auto` | - | Capture method to take the photo: by clicking a button or auto-capture.
|
|
125
|
-
| manualCaptureFallback | Boolean | `true` | - | In `auto` capture method, allow the use of `manual` capture mode as fallback. This would be triggered only when low performance conditions are detected, usually on very old devices. NOTE: If this option is turned off, some users might not be able to successfully submit an image.
|
|
126
|
-
| secure | Boolean | `true` | - | Use the [secure mode](#secure-mode)
|
|
127
|
-
| clientSdkId | String | - | Yes\* | Identifies your Yoti Hub application. This value can be found in the Hub, within your application section, in the keys tab.
|
|
128
|
-
| onSuccess | Function(payload, base64PreviewImage) | - | Yes | Callback called once the result (payload) is complete. The content of capture will vary when using secure or non-secure mode (See [secure mode section](#secure-mode)). The second argument `base64PreviewImage` will only be provided if `returnPreviewImage` is set to `true`.
|
|
129
|
-
| onError | Function | - | - | Callback called when there is an error. See Appendix for the list of error codes we currently support.
|
|
130
|
-
| onReadyForCapture | Function | - | - | Callback called when the Face Capture is ready to take images (camera feed and face scan are ready).
|
|
131
|
-
| showOverlay | Boolean | `true` | - | Optional use of the face overlay.
|
|
132
|
-
| resolutionType | String `hd/full_hd` | `hd` | - | Image resolution constraints passed to `getUserMedia`.
|
|
133
|
-
| format | String `jpeg/png` | `jpeg` | - | Image format type.
|
|
134
|
-
| imageType | String `original/cropped` | `original` | - | Selects if the image will be the original or it will be cropped in order to improve the timing response when processing the image in the API call.
|
|
135
|
-
| qualityType | String `high/medium/low` | `high` | - | Sets the image quality of jpeg format images only. High (1) - Medium (0.96) - Low (0.90).
|
|
136
|
-
| language | Language code \*\* | `en` | - | The language code to set the Face Capture language.
|
|
137
|
-
| a11yLiveRegionMode | String `assertive/polite` | `polite` | - | Determines the [politeness setting of the live region](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions#live_regions) used to read out prompts for screen reader users
|
|
138
|
-
| showInitialGuidance | Boolean | `true` | - | Show the initial help guidance.
|
|
139
|
-
| faceCaptureAssetsRootUrl | String | `assets/face-capture/` | - | Root url where the face detection assets are located. See [copy assets](#copy-assets) section for assets configuration.
|
|
140
|
-
| loadTimeout | Number | 60000 milliseconds | - | Sets the time (in ms) the Face Capture will use to notify through the `onError` callback if the module takes too long to download and load the module. The Face Capture will keep loading after the notification.
|
|
141
|
-
| showGetHelpButton | Boolean | `true` | - | Show the Get Help button.
|
|
142
|
-
| autoSessionReload | Boolean | `true` | - | Automatically renews sessions after they expire.
|
|
143
|
-
| userRetryError | Boolean | `true` | - | Gives the possibility to users to retry several times when an error occurs.
|
|
144
|
-
| returnPreviewImage | Boolean | `false` | - | Provide the image captured (`base64PreviewImage`) in the `onSuccess` callback.
|
|
145
|
-
| encryptImage | Boolean | `true` | - | Encrypt the image inside the payload argument on the `onSuccess` callback when it runs the secure mode.
|
|
146
|
-
| allowBackgroundFaces | Boolean | `false` | - | Allows faces to be present in the background when the image is being captured. The
|
|
147
|
-
| faceSelectionMethod | String `center/area` | `center` | - | Defines where the main face can be placed, in the center or anywhere in the image. Note: This feature is designed for retail terminals and unsuitable for online user's face capture. It is recommend to enable `allowBackgroundFaces` when `faceSelectionMethod` is set to `area`.
|
|
148
|
-
| numStableFrames | Number | 4 | - | Determines how many frames are used for the stability check. The minimum value is 3 and the maximum is 6.
|
|
149
|
-
|
|
|
150
|
-
|
|
|
122
|
+
| Property name | Type | Default | Mandatory | Description |
|
|
123
|
+
| ------------------------------------ | ------------------------------------- | ---------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
124
|
+
| captureMethod | String `manual/auto` | `auto` | - | Capture method to take the photo: by clicking a button or auto-capture. |
|
|
125
|
+
| manualCaptureFallback | Boolean | `true` | - | In `auto` capture method, allow the use of `manual` capture mode as fallback. This would be triggered only when low performance conditions are detected, usually on very old devices. NOTE: If this option is turned off, some users might not be able to successfully submit an image. |
|
|
126
|
+
| secure | Boolean | `true` | - | Use the [secure mode](#secure-mode) |
|
|
127
|
+
| clientSdkId | String | - | Yes\* | Identifies your Yoti Hub application. This value can be found in the Hub, within your application section, in the keys tab. |
|
|
128
|
+
| onSuccess | Function(payload, base64PreviewImage) | - | Yes | Callback called once the result (payload) is complete. The content of capture will vary when using secure or non-secure mode (See [secure mode section](#secure-mode)). The second argument `base64PreviewImage` will only be provided if `returnPreviewImage` is set to `true`. |
|
|
129
|
+
| onError | Function | - | - | Callback called when there is an error. See Appendix for the list of error codes we currently support. |
|
|
130
|
+
| onReadyForCapture | Function | - | - | Callback called when the Face Capture is ready to take images (camera feed and face scan are ready). |
|
|
131
|
+
| showOverlay | Boolean | `true` | - | Optional use of the face overlay. |
|
|
132
|
+
| resolutionType | String `hd/full_hd` | `hd` | - | Image resolution constraints passed to `getUserMedia`. If `multiframe` is `true`, the resolution of the captured image will be `HD` and this field will be ignored. |
|
|
133
|
+
| format | String `jpeg/png` | `jpeg` | - | Image format type. If `multiframe` is `true`, the format of the captured image will be `jpeg` and this field will be ignored. |
|
|
134
|
+
| imageType | String `original/cropped` | `original` | - | Selects if the image will be the original or it will be cropped in order to improve the timing response when processing the image in the API call. If `multiframe` is `true`, the image type will be `original` and this field will be ignored. |
|
|
135
|
+
| qualityType | String `high/medium/low` | `high` | - | Sets the image quality of jpeg format images only. High (1) - Medium (0.96) - Low (0.90). If `multiframe` is `true`, the quality of the captured image will be `high` and this field will be ignored. |
|
|
136
|
+
| language | Language code \*\* | `en` | - | The language code to set the Face Capture language. |
|
|
137
|
+
| a11yLiveRegionMode | String `assertive/polite` | `polite` | - | **DEPRECATED: will be removed in the next major release.** Determines the [politeness setting of the live region](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions#live_regions) used to read out prompts for screen reader users |
|
|
138
|
+
| showInitialGuidance | Boolean | `true` | - | Show the initial help guidance. |
|
|
139
|
+
| faceCaptureAssetsRootUrl | String | `assets/face-capture/` | - | Root url where the face detection assets are located. See [copy assets](#copy-assets) section for assets configuration. |
|
|
140
|
+
| loadTimeout | Number | 60000 milliseconds | - | Sets the time (in ms) the Face Capture will use to notify through the `onError` callback if the module takes too long to download and load the module. The Face Capture will keep loading after the notification. |
|
|
141
|
+
| showGetHelpButton | Boolean | `true` | - | Show the Get Help button. |
|
|
142
|
+
| autoSessionReload | Boolean | `true` | - | Automatically renews sessions after they expire. |
|
|
143
|
+
| userRetryError | Boolean | `true` | - | Gives the possibility to users to retry several times when an error occurs. |
|
|
144
|
+
| returnPreviewImage | Boolean | `false` | - | Provide the image captured (`base64PreviewImage`) in the `onSuccess` callback. Please note that the preview image is not signed, so it should only be used for user feedback. For applications that need to store or use the actual image, we recommend setting `encryptImage` to false. |
|
|
145
|
+
| encryptImage | Boolean | `true` | - | Encrypt the image inside the payload argument on the `onSuccess` callback when it runs the secure mode. |
|
|
146
|
+
| allowBackgroundFaces | Boolean | `false` | - | Allows faces to be present in the background when the image is being captured. The Face Capture will return a cropped image with the main face when set to `true`. If `multiframe` is `true`, this field will be ignored and treated as `false`. Note: This feature is designed for retail terminals and is unsuitable for online users' face capture. |
|
|
147
|
+
| faceSelectionMethod | String `center/area` | `center` | - | Defines where the main face can be placed, in the center or anywhere in the image. Note: This feature is designed for retail terminals and unsuitable for online user's face capture. It is recommend to enable `allowBackgroundFaces` when `faceSelectionMethod` is set to `area`. |
|
|
148
|
+
| numStableFrames | Number | 4 | - | Determines how many frames are used for the stability check. The minimum value is 3 and the maximum is 6. |
|
|
149
|
+
| sessionDuration | Number | - | - | Causes the session to time out after the specified number of milliseconds, regardless of number of retry attempts taken. Must be at least 30,000 (30s) and at most 300,000 (5m). |
|
|
150
|
+
| isScoPortraitCamera _(experimental)_ | Boolean | `false` | - | Defines if the FCM should adapt to a camera stream with portrait resolution in a SCO (self-checkout) machine. This property won't rotate your camera stream but adapt the module to a portrait resolution. This property is meant for SCO machines only and shouldn't be used on mobile phone integrations. |
|
|
151
|
+
| luminosityCheckLevel | String `default/low/disabled` | `default` | - | Specify how strict the luminosity check should be for the FCM to capture an image. May be helpful to ease the capture process in challenging lighting conditions but could increase the rejection rate in the service. Note: This feature is designed for retail terminals and unsuitable for online user's face capture. |
|
|
152
|
+
| multiframe | Boolean | `false` | - | Causes the FCM to collect more than one image, providing more security. This feature only works when secure is active, if not it will be ignored. |
|
|
151
153
|
|
|
152
154
|
**(\*)**
|
|
153
155
|
This field is only mandatory when using the secure mode. (secure = true)
|
|
@@ -191,7 +193,8 @@ Current languages supported:
|
|
|
191
193
|
- `ro-RO`: Romanian
|
|
192
194
|
- `ru-RU`: Russian
|
|
193
195
|
- `sk-SK`: Slovak
|
|
194
|
-
- `sr-RS`: Serbian (
|
|
196
|
+
- `sr-RS`: Serbian (Cyrillic script)
|
|
197
|
+
- `sr-Latn-RS`: Serbian (Latin script)
|
|
195
198
|
- `sv-SE`: Swedish
|
|
196
199
|
- `th-TH`: Thai
|
|
197
200
|
- `tl-PH`: Tagalog
|
|
@@ -214,21 +217,21 @@ A mechanism used for the property `language` to avoid issues when the value pass
|
|
|
214
217
|
|
|
215
218
|
#### Error codes
|
|
216
219
|
|
|
217
|
-
| Error code | Description
|
|
218
|
-
| ------------------------------ |
|
|
219
|
-
| `NO_CAMERA` | No camera detected on the user’s device.
|
|
220
|
-
| `GENERIC_CAMERA_ERROR` | Undefined camera error. The reasons can be [various](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia) and inconsistent across browsers.
|
|
221
|
-
| `UNSUPPORTED_BROWSER` | The user’s browser is not supported. This could be because the API needed for the camera interaction is missing. `Note: Older Non-Safari browsers on iOS fall into this category.`
|
|
222
|
-
| `NO_CAMERA_PERMISSION` | The user rejected the camera permission.
|
|
223
|
-
| `OVERCONSTRAINED` | The camera constraints are not compatible with available camera devices. `Note: One recovery option could be to use hd resolution.`
|
|
224
|
-
| `FACE_DETECTION_INIT_ERROR` | The face detection has failed to initialise. This usually means the required model assets are missing from the host application.
|
|
225
|
-
| `INTERNAL_ERROR` | This can be due to a programming error, or the user using an old unsupported browser.
|
|
226
|
-
| `CAPTURE_LOAD_ERROR` | The secure module could not be loaded. This usually means your token is not updated, or there is an error on the module provider.
|
|
227
|
-
| `VIDEO_STREAM_INTERRUPTED` | The camera stream has stopped unexpectedly.
|
|
228
|
-
| `SECURE_SESSION_EXPIRED` | The secure session has expired (the token expire field is older than the current time).
|
|
229
|
-
| `EXCEEDED_TIME_TO_LOAD` | The module is taking
|
|
230
|
-
| `VERSION_NO_LONGER_AVAILABLE` | The requested Face Capture secure module is no longer available. Note that the FCM will log a warning in the console if the module was deprecated.
|
|
231
|
-
| `INVALID_SECURE_CLIENT_SDK_ID` | The client SDK ID has a wrong format, it isn't included on the internal product mapping or there is a mismatch between the SDK from the JWT and the one related to the internal product contained in the BE request.
|
|
220
|
+
| Error code | Description |
|
|
221
|
+
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
222
|
+
| `NO_CAMERA` | No camera detected on the user’s device. |
|
|
223
|
+
| `GENERIC_CAMERA_ERROR` | Undefined camera error. The reasons can be [various](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia) and inconsistent across browsers. |
|
|
224
|
+
| `UNSUPPORTED_BROWSER` | The user’s browser is not supported. This could be because the API needed for the camera interaction is missing. `Note: Older Non-Safari browsers on iOS fall into this category.` |
|
|
225
|
+
| `NO_CAMERA_PERMISSION` | The user rejected the camera permission. |
|
|
226
|
+
| `OVERCONSTRAINED` | The camera constraints are not compatible with available camera devices. `Note: One recovery option could be to use hd resolution.` |
|
|
227
|
+
| `FACE_DETECTION_INIT_ERROR` | The face detection has failed to initialise. This usually means the required model assets are missing from the host application. |
|
|
228
|
+
| `INTERNAL_ERROR` | This can be due to a programming error, or the user using an old unsupported browser. |
|
|
229
|
+
| `CAPTURE_LOAD_ERROR` | The secure module could not be loaded. This usually means your token is not updated, or there is an error on the module provider. |
|
|
230
|
+
| `VIDEO_STREAM_INTERRUPTED` | The camera stream has stopped unexpectedly. |
|
|
231
|
+
| `SECURE_SESSION_EXPIRED` | The secure session has expired (the token expire field is older than the current time). |
|
|
232
|
+
| `EXCEEDED_TIME_TO_LOAD` | The module is taking longer than the time set in the FaceCapture component to load. _This error does not prevent the module from continuing to load_. It alerts the integrator so they can decide to give additional reassurance to their users. The timeout value can be changed by updating the `loadTimeout` option, which defaults to 60 seconds (60000ms). |
|
|
233
|
+
| `VERSION_NO_LONGER_AVAILABLE` | The requested Face Capture secure module is no longer available. Note that the FCM will log a warning in the console if the module was deprecated. |
|
|
234
|
+
| `INVALID_SECURE_CLIENT_SDK_ID` | The client SDK ID has a wrong format, it isn't included on the internal product mapping or there is a mismatch between the SDK from the JWT and the one related to the internal product contained in the BE request. |
|
|
232
235
|
|
|
233
236
|
The error codes can be imported as follow:
|
|
234
237
|
|
|
@@ -240,8 +243,10 @@ import { ERROR_CODE } from '@getyoti/react-face-capture';
|
|
|
240
243
|
|
|
241
244
|
The Secure mode allows [Yoti back-end
|
|
242
245
|
service](https://developers.yoti.com/age-estimation/integration-guide)
|
|
243
|
-
to verify that the image captured on the client-side browser
|
|
244
|
-
modified in any form.
|
|
246
|
+
to verify that the image captured on the client-side browser using the Face Capture hasn't been
|
|
247
|
+
modified in any form.
|
|
248
|
+
|
|
249
|
+
Note, the secure mode of Yoti Face Capture makes a request to Yoti
|
|
245
250
|
back-end to download the encrypted capture package that takes the
|
|
246
251
|
photo and create the secure result request. The secure result information will
|
|
247
252
|
be returned in `onSuccess` callback (`payload` argument). It is the information
|
|
@@ -263,6 +268,9 @@ return an error if the `payload` is modified:
|
|
|
263
268
|
`<fcm_version>` is the current version of FCM (embedded in the
|
|
264
269
|
module) and `<session_token>` is the session token generated from the request.
|
|
265
270
|
|
|
271
|
+
For more detailed information on how the secure mode interacts with the server, see the
|
|
272
|
+
[Secure image capture](https://developers.yoti.com/age-estimation/secure-image-capture) page.
|
|
273
|
+
|
|
266
274
|
> Added a 20-second timeout to avoid long wait times when the network connection is poor or unavailable.
|
|
267
275
|
|
|
268
276
|
##### Possible issues
|
|
@@ -276,6 +284,10 @@ cross-site scripting like CSP you will need to allow the FCM requests.
|
|
|
276
284
|
|
|
277
285
|
The secure mode detects modifications on the camera stream source and fraudulent camera hardware. In these scenarios, it will return an `UNTRUSTED_SECURE_SESSION` error code when calling the Yoti BE services.
|
|
278
286
|
|
|
287
|
+
##### Multiframe
|
|
288
|
+
|
|
289
|
+
The `multiframe` mode adds an extra layer of security to improve the prevention of injection attacks and other forms of image manipulation. It operates seamlessly, ensuring the user experience remains unaffected. It requires `secure` mode to be enabled and increases the size of the generated payload.
|
|
290
|
+
|
|
279
291
|
### Example
|
|
280
292
|
|
|
281
293
|
```js
|
|
@@ -379,3 +391,13 @@ application.
|
|
|
379
391
|
### iOS distorted layout (version < 2.4.0)
|
|
380
392
|
|
|
381
393
|
We are aware of a rare display issue on iOS devices which can make the video element appear distorted in versions prior to 2.4.0. Refreshing or reloading will resolve this, and it should not happen often.
|
|
394
|
+
|
|
395
|
+
### Virtual backgrounds
|
|
396
|
+
|
|
397
|
+
Modifications over the original image captured by the camera, like virtual background or other kinds of filters, are also considered manipulations. Pictures taken using these kinds of features will be rejected as `UNTRUSTED_SECURE_SESSION`.
|
|
398
|
+
|
|
399
|
+
### Multiframe Mode Usage
|
|
400
|
+
|
|
401
|
+
When using multiframe mode, the prediction request must include the query parameter `multiframe=true`. This is required for the service to process the request correctly. If there is a mismatch between the Face Capture's multiframe setting and the multiframe query parameter in the request, the response will always be `UNTRUSTED_SECURE_SESSION`.
|
|
402
|
+
|
|
403
|
+
When enabling this mode, ensure both the Face Capture configuration and the prediction request are aligned to avoid this error.
|
package/index.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ declare module '@getyoti/react-face-capture' {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
+
* @deprecated will be remove in next major release
|
|
57
58
|
* Politeness setting of the live region supported by the Face Capture.
|
|
58
59
|
*/
|
|
59
60
|
export enum A11Y_LIVE_REGION_MODE {
|
|
@@ -148,6 +149,8 @@ declare module '@getyoti/react-face-capture' {
|
|
|
148
149
|
IT_IT = 'it-IT',
|
|
149
150
|
JA = 'ja',
|
|
150
151
|
JA_JP = 'ja-JP',
|
|
152
|
+
KA = 'ka',
|
|
153
|
+
KA_GE = 'ka-GE',
|
|
151
154
|
KO = 'ko',
|
|
152
155
|
KO_KR = 'ko-KR',
|
|
153
156
|
LT = 'lt',
|
|
@@ -173,6 +176,8 @@ declare module '@getyoti/react-face-capture' {
|
|
|
173
176
|
SK_SK = 'sk-SK',
|
|
174
177
|
SR = 'sr',
|
|
175
178
|
SR_RS = 'sr-RS',
|
|
179
|
+
SR_LATN = 'sr-Latn',
|
|
180
|
+
SR_LATN_RS = 'sr-Latn-RS',
|
|
176
181
|
SV = 'sv',
|
|
177
182
|
SV_SE = 'sv-SE',
|
|
178
183
|
TH = 'th',
|
|
@@ -219,7 +224,7 @@ declare module '@getyoti/react-face-capture' {
|
|
|
219
224
|
faceCaptureAssetsRootUrl?: string;
|
|
220
225
|
/** Capture method to take the photo: by clicking a button or auto-capture. (default:auto) */
|
|
221
226
|
captureMethod?: CAPTURE_METHOD;
|
|
222
|
-
/** Use the secure mode. (default:true) */
|
|
227
|
+
/** Use the secure mode. (default: true) */
|
|
223
228
|
secure?: boolean;
|
|
224
229
|
/** Callback called once the result (capture) is complete. */
|
|
225
230
|
onSuccess: (payload: FCMPayload, base64PreviewImage?: string) => void;
|
|
@@ -229,65 +234,91 @@ declare module '@getyoti/react-face-capture' {
|
|
|
229
234
|
onReadyForCapture?: () => void;
|
|
230
235
|
/** Optional use of the face overlay (default: true) */
|
|
231
236
|
showOverlay?: boolean;
|
|
232
|
-
/** Image resolution constraints passed to getUserMedia.
|
|
237
|
+
/** Image resolution constraints passed to getUserMedia.
|
|
238
|
+
*
|
|
239
|
+
* This property will be ignored if the `multiframe` property has the value
|
|
240
|
+
* `true`. The image resolution will be `HD` when multiframe is `true`.
|
|
241
|
+
*
|
|
242
|
+
* (default: HD) */
|
|
233
243
|
resolutionType?: RESOLUTION_TYPE;
|
|
234
|
-
/** Image format type.
|
|
244
|
+
/** Image format type.
|
|
245
|
+
*
|
|
246
|
+
* This property will be ignored if the `multiframe` property has the value
|
|
247
|
+
* `true`. The image format will be `jpeg` when `multiframe` is `true`.
|
|
248
|
+
*
|
|
249
|
+
* (default: jpeg) */
|
|
235
250
|
format?: FORMAT_TYPE;
|
|
236
|
-
/** imageType select if the image will be the original or it will be cropped in order to improve the timing
|
|
237
|
-
response when processing the image in the API call. (default:original) */
|
|
251
|
+
/** imageType select if the image will be the original or it will be cropped in order to improve the timing
|
|
252
|
+
response when processing the image in the API call. (default: original) */
|
|
238
253
|
imageType?: IMAGE_TYPE;
|
|
239
|
-
/** Sets the image quality of jpeg format images only.
|
|
254
|
+
/** Sets the image quality of jpeg format images only.
|
|
255
|
+
*
|
|
256
|
+
* High (1) - Medium (0.96) - Low (0.90).
|
|
257
|
+
*
|
|
258
|
+
* This property will be ignored if the `multiframe` property has the value
|
|
259
|
+
* `true`. The image quality type will be `high` when `multiframe` is
|
|
260
|
+
* `true`.
|
|
261
|
+
*
|
|
262
|
+
* (default: high) */
|
|
240
263
|
qualityType?: QUALITY_TYPE;
|
|
241
|
-
/** The language code to set the language of the feedback messages. (default:en) */
|
|
264
|
+
/** The language code to set the language of the feedback messages. (default: en) */
|
|
242
265
|
language?: LANGUAGE_CODE;
|
|
243
|
-
/** Determines the politeness setting of the live region used to read out prompts for screen reader users. (default:polite)
|
|
266
|
+
/** Determines the politeness setting of the live region used to read out prompts for screen reader users. (default: polite)
|
|
267
|
+
* @deprecated will be remove in next major release
|
|
268
|
+
*/
|
|
244
269
|
a11yLiveRegionMode?: A11Y_LIVE_REGION_MODE;
|
|
245
|
-
/** Show the initial help guidance. (default:true) */
|
|
270
|
+
/** Show the initial help guidance. (default: true) */
|
|
246
271
|
showInitialGuidance?: boolean;
|
|
247
|
-
/** Indicates if the face capture will use the manual capture method because of slow performance. (default:true) */
|
|
272
|
+
/** Indicates if the face capture will use the manual capture method because of slow performance. (default: true) */
|
|
248
273
|
manualCaptureFallback?: boolean;
|
|
249
274
|
/** Indicates the time (in milliseconds) to call the onError callback if the
|
|
250
275
|
* module takes that time to load (default: 60000) */
|
|
251
276
|
loadTimeout?: number;
|
|
252
277
|
/** Identifies your Yoti Hub application. */
|
|
253
278
|
clientSdkId?: string;
|
|
254
|
-
/** Show the Get Help button. (default:true) */
|
|
279
|
+
/** Show the Get Help button. (default: true) */
|
|
255
280
|
showGetHelpButton?: boolean;
|
|
256
|
-
/** Automatically renews sessions after they expire. (default:true) */
|
|
281
|
+
/** Automatically renews sessions after they expire. (default: true) */
|
|
257
282
|
autoSessionReload?: boolean;
|
|
258
283
|
/** Gives the possibility to users to retry several times when an error
|
|
259
|
-
* occurs. (default:true) */
|
|
284
|
+
* occurs. (default: true) */
|
|
260
285
|
userRetryError?: boolean;
|
|
261
286
|
/** Provide the image captured ('base64PreviewImage') in the 'onSuccess'
|
|
262
|
-
* callback. (default:false) */
|
|
287
|
+
* callback. (default: false) */
|
|
263
288
|
returnPreviewImage?: boolean;
|
|
264
289
|
/** Encrypt the image inside the payload argument on the 'onSuccess'
|
|
265
|
-
* callback when it runs the secure mode. (default:true) */
|
|
290
|
+
* callback when it runs the secure mode. (default: true) */
|
|
266
291
|
encryptImage?: boolean;
|
|
267
292
|
/** Allows faces to be present in the background when the image is being
|
|
268
293
|
* captured. The face capture will return a cropped image with the main face
|
|
269
294
|
* when set to 'true'. Note: This feature is designed for retail terminals
|
|
270
|
-
* and unsuitable for online user's face capture. (default:false) */
|
|
295
|
+
* and unsuitable for online user's face capture. (default: false) */
|
|
271
296
|
allowBackgroundFaces?: boolean;
|
|
272
297
|
/** Defines where the main face can be placed, in the center or anywhere in
|
|
273
298
|
* the image. Note: This feature is designed for retail terminals and
|
|
274
299
|
* unsuitable for online user's face capture. It is recommend to enable
|
|
275
300
|
* 'allowBackgroundFaces' when 'faceSelectionMethod' is set to 'area'.
|
|
276
|
-
* (default:center) */
|
|
301
|
+
* (default: center) */
|
|
277
302
|
faceSelectionMethod?: FACE_SELECTION_METHOD;
|
|
278
303
|
/** Determines how many frames are used for the stability check.
|
|
279
|
-
* The minimum value is 3 and the maximum is 6. (default:4) */
|
|
304
|
+
* The minimum value is 3 and the maximum is 6. (default: 4) */
|
|
280
305
|
numStableFrames?: number;
|
|
306
|
+
/** Determines the session timeout period, in milliseconds.
|
|
307
|
+
* The minimum value is 30,000 (30s), maxium 300,000 (5m). */
|
|
308
|
+
sessionDuration?: number;
|
|
281
309
|
/** Defines if the FCM should adapt to a camera stream with portrait
|
|
282
|
-
* resolution in a SCO (self-checkout) machine. (default:false)
|
|
310
|
+
* resolution in a SCO (self-checkout) machine. (default: false)
|
|
283
311
|
* @experimental*/
|
|
284
312
|
isScoPortraitCamera?: boolean;
|
|
285
313
|
/**
|
|
286
314
|
* Specify how strict the luminosity check should be for the FCM to capture an image.
|
|
287
315
|
* May be helpful to ease the capture process in challenging lighting conditions but
|
|
288
316
|
* could increase the rejection rate in the service. Note: This feature is designed
|
|
289
|
-
* for retail terminals and unsuitable for online user's face capture.(default:default) */
|
|
317
|
+
* for retail terminals and unsuitable for online user's face capture. (default: default) */
|
|
290
318
|
luminosityCheckLevel?: LUMINOSITY_CHECK_LEVEL;
|
|
319
|
+
/**
|
|
320
|
+
* Makes the FCM collecting more than one image, providing more security (default: false) */
|
|
321
|
+
multiframe?: boolean;
|
|
291
322
|
}
|
|
292
323
|
|
|
293
324
|
/**
|