idmission-web-sdk 1.0.52 → 1.0.54
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 +105 -1
- package/dist/sdk2.cjs.development.js +15 -10
- 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 +15 -10
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +15 -10
- 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
|
@@ -4,6 +4,26 @@ Demo: https://websdk2demo.idmission.com
|
|
|
4
4
|
|
|
5
5
|
Storybook: https://websdk2test.idmission.com
|
|
6
6
|
|
|
7
|
+
## Getting Started
|
|
8
|
+
|
|
9
|
+
Before using the IDmission WebSDK, you should make sure you can fetch a token. New customers receive their token generation credentials via email. If you haven't received them, reach out to support@idmission.com.
|
|
10
|
+
|
|
11
|
+
To test that your credentials are valid:
|
|
12
|
+
```bash
|
|
13
|
+
curl --location --request POST 'https://auth.idmission.com/auth/realms/identity/protocol/openid-connect/token' \
|
|
14
|
+
--header 'Content-Type: application/x-www-form-urlencoded' \
|
|
15
|
+
--data-urlencode 'grant_type=password' \
|
|
16
|
+
--data-urlencode 'client_id=' \
|
|
17
|
+
--data-urlencode 'client_secret=' \
|
|
18
|
+
--data-urlencode 'username=' \
|
|
19
|
+
--data-urlencode 'password=' \
|
|
20
|
+
--data-urlencode 'scope=api_access'
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Prior to initializing the WebSDK on the client, you should generate a token on your server using these credentials. Be careful not to leak them on the client side! The generated token is safe to pass to the client, but the secrets used to generate them are not. If you have inadvertently leaked your client secret, react out to support@idmission.com to rotate your credentials.
|
|
24
|
+
|
|
25
|
+
If you are using NodeJS, check out our [auth client for server-side JavaScript](https://www.npmjs.com/package/idmission-auth-client).
|
|
26
|
+
|
|
7
27
|
## Basic Usage in Typescript/React
|
|
8
28
|
|
|
9
29
|
```bash
|
|
@@ -22,7 +42,7 @@ render(<IdValidation submissionToken={YOUR_TOKEN} />, document.getElementById('r
|
|
|
22
42
|
|
|
23
43
|
Add the following script tag to your page's `<head>`:
|
|
24
44
|
```html
|
|
25
|
-
<script type
|
|
45
|
+
<script type="module" src="https://websdk-cdn-dev.idmission.com/websdk/prod/loader.js"></script>
|
|
26
46
|
```
|
|
27
47
|
|
|
28
48
|
You may subscribe to the `idmission-web-sdk.ready` event to be notified when loading has completed.
|
|
@@ -586,6 +606,90 @@ Render a fullscreen capture component that analyzes frames from the user's front
|
|
|
586
606
|
IDmissionSDK.renderCustomerIdentification('#target-element', { submissionToken: 'my-idmission-token' });
|
|
587
607
|
```
|
|
588
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
|
+
|
|
589
693
|
## Other Functionality
|
|
590
694
|
|
|
591
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.54';
|
|
52
52
|
|
|
53
53
|
function getPlatform() {
|
|
54
54
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -14907,18 +14907,23 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
14907
14907
|
onExitAfterFailure = _a.onExitAfterFailure,
|
|
14908
14908
|
idCaptureProps = _a.idCaptureProps,
|
|
14909
14909
|
faceLivenessProps = _a.faceLivenessProps,
|
|
14910
|
-
|
|
14911
|
-
|
|
14912
|
-
|
|
14913
|
-
|
|
14910
|
+
_c = _a.idCardFrontDetectionThreshold,
|
|
14911
|
+
idCardFrontDetectionThreshold = _c === void 0 ? 0.48 : _c,
|
|
14912
|
+
_d = _a.idCardFrontFocusThreshold,
|
|
14913
|
+
idCardFrontFocusThreshold = _d === void 0 ? 0.15 : _d,
|
|
14914
|
+
_e = _a.goodIdCardFrontFramesThreshold,
|
|
14915
|
+
goodIdCardFrontFramesThreshold = _e === void 0 ? 3 : _e,
|
|
14916
|
+
_f = _a.showIdCardBackDurationMs,
|
|
14917
|
+
showIdCardBackDurationMs = _f === void 0 ? 5000 : _f,
|
|
14914
14918
|
readTextPrompt = _a.readTextPrompt,
|
|
14915
|
-
|
|
14916
|
-
|
|
14917
|
-
|
|
14919
|
+
_g = _a.readTextTimeoutDurationMs,
|
|
14920
|
+
readTextTimeoutDurationMs = _g === void 0 ? 15000 : _g,
|
|
14921
|
+
_h = _a.skipSuccessScreen,
|
|
14922
|
+
skipSuccessScreen = _h === void 0 ? false : _h,
|
|
14918
14923
|
geolocationEnabled = _a.geolocationEnabled,
|
|
14919
14924
|
geolocationRequired = _a.geolocationRequired,
|
|
14920
|
-
|
|
14921
|
-
debugMode =
|
|
14925
|
+
_j = _a.debugMode,
|
|
14926
|
+
debugMode = _j === void 0 ? false : _j;
|
|
14922
14927
|
useLanguage(lang);
|
|
14923
14928
|
return /*#__PURE__*/React__default['default'].createElement(SubmissionProvider, {
|
|
14924
14929
|
action: SubmissionAction.VALIDATE,
|