idmission-web-sdk 1.0.53 → 1.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -0
- package/dist/sdk2.cjs.development.js +26 -23
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +26 -23
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +26 -23
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -606,6 +606,90 @@ Render a fullscreen capture component that analyzes frames from the user's front
|
|
|
606
606
|
IDmissionSDK.renderCustomerIdentification('#target-element', { submissionToken: 'my-idmission-token' });
|
|
607
607
|
```
|
|
608
608
|
|
|
609
|
+
### VideoIdValidation
|
|
610
|
+
|
|
611
|
+
Render a fullscreen capture component that performs IDValidation and FaceValidation sequentially, then captures a video of the user holding their ID, and optionally speaking a prompt aloud.
|
|
612
|
+
|
|
613
|
+
**Props**
|
|
614
|
+
|
|
615
|
+
<table>
|
|
616
|
+
<tr><td><code>submissionToken</code></td><td>a token generated with your IDmission credentials.</td></tr>
|
|
617
|
+
<tr><td><code>submissionUrl</code> (optional)</td><td>URL to hit with all API requests. Default: https://api.idmission.com</td></tr>
|
|
618
|
+
<tr><td><code>onBeforeSubmit</code> (optional)</td><td>callback function that fires immediately prior to submission, giving the client application an opportunity to specify custom asynchronous logic that mutates the request before it executes. The submission request is passed in as a parameter and a promise resolving to the updated request should be returned.</td></tr>
|
|
619
|
+
<tr><td><code>onComplete</code> (optional)</td><td>callback function that fires when the user has completed the VideoIdValidation flow. Arguments: the SubmissionResponse from IDmission's API is passed as an argument to the customer's application for further handling, which indicates whether the user passed the validation check, and the request payload dispatched to IDmission's API, which contains the images submitted by the user.</td></tr>
|
|
620
|
+
<tr><td><code>onExitAfterFailure</code> (optional)</td><td>callback function that fires when the user clicks the exit button after failing the realness check.</td></tr>
|
|
621
|
+
<tr><td><code>lang</code> (optional)</td><td>language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto.</td></tr>
|
|
622
|
+
<tr><td><code>companyId</code> (optional)</td><td>company identifier to include with submission.</td></tr>
|
|
623
|
+
<tr><td><code>manualReviewRequired</code> (optional)</td><td>boolean flag to indicate whether responses should always be reviewed by a human.</td></tr>
|
|
624
|
+
<tr><td><code>idBackImageRequired</code> (optional)</td><td>boolean flag to indicate whether the back of the ID card image will be considered in processing decisions. Default is `true`.</td></tr>
|
|
625
|
+
<tr><td><code>verifyIdWithExternalDatabases</code> (optional)</td><td>boolean flag to indicate whether ID data should be verified with government databases such as AAMVA, watch lists, etc.</td></tr>
|
|
626
|
+
<tr><td><code>personalData</code> (optional)</td><td>object of personal data to store with the submitted ID. Valid keys: uniqueNumber, name, phone, phoneCountryCode, email, dob, gender, addressLine1, addressLine2, city, district, postalCode, country.</td></tr>
|
|
627
|
+
<tr><td><code>cardData</code> (optional)</td><td>object of credit/debit card data to store with the submitted ID. Valid keys: cardToken, cardLast4, cardExpDate, nameOnCard.</td></tr>
|
|
628
|
+
<tr><td><code>webhooksEnabled</code> (optional)</td><td>boolean flag to indicate whether customer-configured webhooks should be invoked after submission.</td></tr>
|
|
629
|
+
<tr><td><code>webhooksClientTraceId</code> (optional)</td><td>a customer provided trace id to use when invoking customer-configured webhooks.</td></tr>
|
|
630
|
+
<tr><td><code>webhooksStripSpecialCharacters</code> (optional)</td><td>boolean flag to indicate whether non-alphanumeric characters should be removed from the submission data when customer-configured webhooks are invoked.</td></tr>
|
|
631
|
+
<tr><td><code>idCaptureProps</code> (optional)</td><td>object containing any overrides for IDValidation.</td></tr>
|
|
632
|
+
<tr><td><code>faceLivenessProps</code> (optional)</td><td>object containing any overrides for IDValidation.</td></tr>
|
|
633
|
+
<tr><td><code>idCardFrontDetectionThreshold</code> (optional)</td><td>number between 0 and 1 at which document detection guidance score condition is considered to be met for the ID card front during video capture. Defaults to 0.48.</td></tr>
|
|
634
|
+
<tr><td><code>idCardFrontFocusThreshold</code> (optional)</td><td>number between 0 and 1 at which focus guidance score condition is considered to be met for the ID card front during video capture. Defaults to 0.15.</td></tr>
|
|
635
|
+
<tr><td><code>goodIdCardFrontFramesThreshold</code> (optional)</td><td>number of good frames of the ID card front that must be captured before moving on during video capture. Defaults to 3.</td></tr>
|
|
636
|
+
<tr><td><code>showIdCardBackDurationMs</code> (optional)</td><td>the duration of time in milliseconds that the user is instructed to show the back of their ID card during video capture. Defaults to 5000ms.</td></tr>
|
|
637
|
+
<tr><td><code>readTextPrompt</code> (optional)</td><td>an optional text prompt to display on screen for the user to read during video capture after the ID card has been shown. Leave blank to skip the read text screen.</td></tr>
|
|
638
|
+
<tr><td><code>readTextTimeoutDurationMs</code> (optional)</td><td>the duration of time in milliseconds that the user is allowed to spend reading the <code>readTextPrompt</code>. Defaults to 15000ms.</td></tr>
|
|
639
|
+
<tr><td><code>skipSuccessScreen</code> (optional)</td><td>boolean or async function to indicate whether to proceed automatically after capture guidance is satisfied. If an async function is supplied returning a boolean, it will be evaluated at the time of capture guidance satisfaction. Defaults to false.</td></tr>
|
|
640
|
+
<tr><td><code>assets</code> (optional)</td><td>object containing any asset overrides, for available options consult the Assets table below.</td></tr>
|
|
641
|
+
<tr><td><code>colors</code> (optional)</td><td>object containing any asset overrides, for available options consult the Colors table below.</td></tr>
|
|
642
|
+
<tr><td><code>verbiage</code> (optional)</td><td>object containing any verbiage overrides, for available options consult the Verbiage table below.</td></tr>
|
|
643
|
+
<tr><td><code>geolocationEnabled</code> (optional)</td><td>boolean flag to indicate whether users should be prompted to share their location. Default is `true`.</td></tr>
|
|
644
|
+
<tr><td><code>geolocationRequired</code> (optional)</td><td>boolean flag to indicate whether users should be blocked from proceeding if they block location access. Default is `false`.</td></tr>
|
|
645
|
+
<tr><td><code>debugMode</code> (optional)</td><td>boolean flag to enable on-screen prediction information output. Default is `false`.</td></tr>
|
|
646
|
+
</table>
|
|
647
|
+
|
|
648
|
+
**Video ID Validation Assets**
|
|
649
|
+
|
|
650
|
+
<table>
|
|
651
|
+
<tr><td><code>idCapture</code> (optional)</td><td>object containing any asset overrides, for available options consult the ID Capture Assets table above.</td></tr>
|
|
652
|
+
<tr><td><code>faceLiveness</code> (optional)</td><td>object containing any asset overrides, for available options consult the Face Liveness Assets table above.</td></tr>
|
|
653
|
+
<tr><td><code>videoIdCapture.guides.frontImageUrl</code></td><td>Default: https://websdk-cdn-dev.idmission.com/assets/Shieldout-IDCard-Front-SVG-Landscape-2.svg</td></tr>
|
|
654
|
+
<tr><td><code>videoIdCapture.guides.backImageUrl</code></td><td>Default: https://websdk-cdn-dev.idmission.com/assets/Shieldout-IDCard-Back-SVG-Landscape-2.svg</td></tr>
|
|
655
|
+
</table>
|
|
656
|
+
|
|
657
|
+
**Video ID Validation Colors**
|
|
658
|
+
|
|
659
|
+
<table>
|
|
660
|
+
<tr><td><code>idCapture</code> (optional)</td><td>object containing any color overrides, for available options consult the ID Capture Colors table above.</td></tr>
|
|
661
|
+
<tr><td><code>faceLiveness</code> (optional)</td><td>object containing any color overrides, for available options consult the Face Liveness Colors table above.</td></tr>
|
|
662
|
+
<tr><td><code>idVideoCapture.guidesSatisfiedColor</code></td><td>Default: green</td></tr>
|
|
663
|
+
<tr><td><code>idVideoCapture.guidesUnsatisfiedColor</code></td><td>Default: white</td></tr>
|
|
664
|
+
<tr><td><code>idVideoCapture.readTextDoneBtn.backgroundColor</code></td><td>Default: #16a085</td></tr>
|
|
665
|
+
<tr><td><code>idVideoCapture.readTextDoneBtn.textColor</code></td><td>Default: white</td></tr>
|
|
666
|
+
<tr><td><code>success.doneBtn.backgroundColor</code></td><td>Default: #16a085</td></tr>
|
|
667
|
+
<tr><td><code>success.doneBtn.textColor</code></td><td>Default: white</td></tr>
|
|
668
|
+
<tr><td><code>success.retryBtn.backgroundColor</code></td><td>Default: #ea8557</td></tr>
|
|
669
|
+
<tr><td><code>success.retryBtn.textColor</code></td><td>Default: white</td></tr>
|
|
670
|
+
</table>
|
|
671
|
+
|
|
672
|
+
**Video ID Validation Verbiage**
|
|
673
|
+
|
|
674
|
+
<table>
|
|
675
|
+
<tr><td><code>idCapture</code> (optional)</td><td>object containing any verbiage overrides, for available options consult the ID Capture Verbiage table above.</td></tr>
|
|
676
|
+
<tr><td><code>faceLiveness</code> (optional)</td><td>object containing any verbiage overrides, for available options consult the Face Liveness Verbiage table above.</td></tr>
|
|
677
|
+
<tr><td><code>idVideoCapture.guides.idFrontInstructionText</code></td><td>Default: "Display the front of your ID card..."</td></tr>
|
|
678
|
+
<tr><td><code>idVideoCapture.guides.idBackInstructionText</code></td><td>Default: "Display the back of your ID card..."</td></tr>
|
|
679
|
+
<tr><td><code>idVideoCapture.guides.flipIdInstructionText</code></td><td>Default: "Please flip your ID card..."</td></tr>
|
|
680
|
+
<tr><td><code>idVideoCapture.readTextHeading</code></td><td>Default: "Please read the following text aloud"</td></tr>
|
|
681
|
+
<tr><td><code>idVideoCapture.readTextDoneBtnText</code></td><td>Default: "Done"</td></tr>
|
|
682
|
+
<tr><td><code>success.headingText</code></td><td>Default: "Video ID has been successfully captured!"</td></tr>
|
|
683
|
+
<tr><td><code>success.retryBtnText</code></td><td>Default: "Retry"</td></tr>
|
|
684
|
+
<tr><td><code>success.doneBtnText</code></td><td>Default: "Done"</td></tr>
|
|
685
|
+
</table>
|
|
686
|
+
|
|
687
|
+
**Example**
|
|
688
|
+
|
|
689
|
+
```js
|
|
690
|
+
IDmissionSDK.renderVideoIdValidation('#target-element', { submissionToken: 'my-idmission-token' });
|
|
691
|
+
```
|
|
692
|
+
|
|
609
693
|
## Other Functionality
|
|
610
694
|
|
|
611
695
|
### Detecting the current version of the IDmission Web SDK
|
|
@@ -48,7 +48,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
|
|
|
48
48
|
var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
|
|
49
49
|
var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
|
|
50
50
|
|
|
51
|
-
var webSdkVersion = '1.0.
|
|
51
|
+
var webSdkVersion = '1.0.55';
|
|
52
52
|
|
|
53
53
|
function getPlatform() {
|
|
54
54
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -1351,7 +1351,6 @@ function listAvailableCameras(facingMode, requestMicAccess) {
|
|
|
1351
1351
|
return tslib.__generator(this, function (_a) {
|
|
1352
1352
|
switch (_a.label) {
|
|
1353
1353
|
case 0:
|
|
1354
|
-
_a.trys.push([0, 2,, 3]);
|
|
1355
1354
|
return [4 /*yield*/, navigator.mediaDevices.getUserMedia({
|
|
1356
1355
|
video: {
|
|
1357
1356
|
facingMode: {
|
|
@@ -1359,17 +1358,13 @@ function listAvailableCameras(facingMode, requestMicAccess) {
|
|
|
1359
1358
|
}
|
|
1360
1359
|
},
|
|
1361
1360
|
audio: requestMicAccess
|
|
1362
|
-
})
|
|
1361
|
+
})
|
|
1362
|
+
// This lists all available cameras attached to the user's device.
|
|
1363
|
+
];
|
|
1363
1364
|
case 1:
|
|
1364
|
-
// The first thing we need to do is call getUserMedia() so that the subsequent call to enumerateDevices() works.
|
|
1365
1365
|
cameraEnumerationStream = _a.sent();
|
|
1366
|
-
return [3 /*break*/, 3];
|
|
1367
|
-
case 2:
|
|
1368
|
-
_a.sent();
|
|
1369
|
-
return [2 /*return*/, []];
|
|
1370
|
-
case 3:
|
|
1371
1366
|
return [4 /*yield*/, navigator.mediaDevices.enumerateDevices()];
|
|
1372
|
-
case
|
|
1367
|
+
case 2:
|
|
1373
1368
|
videoDevices = _a.sent().filter(function (_a) {
|
|
1374
1369
|
var kind = _a.kind;
|
|
1375
1370
|
return kind === 'videoinput';
|
|
@@ -1531,7 +1526,10 @@ var useHighestResCaptureDevice = function useHighestResCaptureDevice(_a) {
|
|
|
1531
1526
|
if (e.name === 'NotAllowedError') {
|
|
1532
1527
|
console.error('camera access has been blocked by the user', e);
|
|
1533
1528
|
setCameraAccessDenied(true);
|
|
1534
|
-
} else
|
|
1529
|
+
} else {
|
|
1530
|
+
console.error('camera access encountered some other error', e);
|
|
1531
|
+
throw e;
|
|
1532
|
+
}
|
|
1535
1533
|
});
|
|
1536
1534
|
}, [cameraAccessDenied, iphoneContinuityCameraAllowed, iphoneContinuityCameraDenied, preferFrontFacingCamera]);
|
|
1537
1535
|
React.useEffect(function () {
|
|
@@ -1545,7 +1543,7 @@ var useHighestResCaptureDevice = function useHighestResCaptureDevice(_a) {
|
|
|
1545
1543
|
if (!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.getUserMedia)) return cleanup;
|
|
1546
1544
|
(function () {
|
|
1547
1545
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
1548
|
-
var stream,
|
|
1546
|
+
var stream, e_1, handleStreamEnded;
|
|
1549
1547
|
var _a;
|
|
1550
1548
|
return tslib.__generator(this, function (_b) {
|
|
1551
1549
|
switch (_b.label) {
|
|
@@ -1570,8 +1568,8 @@ var useHighestResCaptureDevice = function useHighestResCaptureDevice(_a) {
|
|
|
1570
1568
|
stream = _b.sent();
|
|
1571
1569
|
return [3 /*break*/, 4];
|
|
1572
1570
|
case 3:
|
|
1573
|
-
|
|
1574
|
-
if (
|
|
1571
|
+
e_1 = _b.sent();
|
|
1572
|
+
if (e_1.name === 'NotAllowedError') {
|
|
1575
1573
|
if (iphoneContinuityCameraAllowed) {
|
|
1576
1574
|
setIphoneContinuityCameraAvailable(false);
|
|
1577
1575
|
setIphoneContinuityCameraDenied(true);
|
|
@@ -14907,18 +14905,23 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
14907
14905
|
onExitAfterFailure = _a.onExitAfterFailure,
|
|
14908
14906
|
idCaptureProps = _a.idCaptureProps,
|
|
14909
14907
|
faceLivenessProps = _a.faceLivenessProps,
|
|
14910
|
-
|
|
14911
|
-
|
|
14912
|
-
|
|
14913
|
-
|
|
14908
|
+
_c = _a.idCardFrontDetectionThreshold,
|
|
14909
|
+
idCardFrontDetectionThreshold = _c === void 0 ? 0.48 : _c,
|
|
14910
|
+
_d = _a.idCardFrontFocusThreshold,
|
|
14911
|
+
idCardFrontFocusThreshold = _d === void 0 ? 0.15 : _d,
|
|
14912
|
+
_e = _a.goodIdCardFrontFramesThreshold,
|
|
14913
|
+
goodIdCardFrontFramesThreshold = _e === void 0 ? 3 : _e,
|
|
14914
|
+
_f = _a.showIdCardBackDurationMs,
|
|
14915
|
+
showIdCardBackDurationMs = _f === void 0 ? 5000 : _f,
|
|
14914
14916
|
readTextPrompt = _a.readTextPrompt,
|
|
14915
|
-
|
|
14916
|
-
|
|
14917
|
-
|
|
14917
|
+
_g = _a.readTextTimeoutDurationMs,
|
|
14918
|
+
readTextTimeoutDurationMs = _g === void 0 ? 15000 : _g,
|
|
14919
|
+
_h = _a.skipSuccessScreen,
|
|
14920
|
+
skipSuccessScreen = _h === void 0 ? false : _h,
|
|
14918
14921
|
geolocationEnabled = _a.geolocationEnabled,
|
|
14919
14922
|
geolocationRequired = _a.geolocationRequired,
|
|
14920
|
-
|
|
14921
|
-
debugMode =
|
|
14923
|
+
_j = _a.debugMode,
|
|
14924
|
+
debugMode = _j === void 0 ? false : _j;
|
|
14922
14925
|
useLanguage(lang);
|
|
14923
14926
|
return /*#__PURE__*/React__default['default'].createElement(SubmissionProvider, {
|
|
14924
14927
|
action: SubmissionAction.VALIDATE,
|