idmission-web-sdk 2.0.3 → 2.0.5

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 CHANGED
@@ -84,7 +84,7 @@ Render a fullscreen ID capture component that instructs the user to photograph b
84
84
  <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>
85
85
  <tr><td><code>captureSignature</code> (optional)</td><td>boolean indicating whether the user should be prompted to sign the screen before submission. Defaults to false.</td></tr>
86
86
  <tr><td><code>captureSignatureVideo</code> (optional)</td><td>boolean indicating whether the user should be prompted to record themselves signing the screen before submission. Defaults to false.</td></tr>
87
- <tr><td><code>captureAdditionalDocuments</code> (optional)</td><td>array of additional documents to be captured. Each element includes a name and description.</td></tr>
87
+ <tr><td><code>captureAdditionalDocuments</code> (optional)</td><td>array of additional documents to be captured, for available options consult the Additional Document Properties table below.</td></tr>
88
88
  <tr><td><code>loadingOverlayMode</code> (optional)</td><td>string indicating which ID capture loading overlay screen should be used. Supported values: default and legacy. Defaults to default.</td></tr>
89
89
  <tr><td><code>idCaptureRequirement</code> (optional)</td><td>string to indicate which types of documents should be captured. Valid values: idCard, passport, idCardOrPassport, idCardAndPassport. Default is idCardOrPassport.</td></tr>
90
90
  <tr><td><code>idAutoCaptureEnabled</code> (optional)</td><td>boolean to indicate whether photos should be captured automatically when guidance conditions are met. Default is `true`.</td></tr>
@@ -364,7 +364,7 @@ Render a fullscreen capture component that performs IDValidation and FaceValidat
364
364
  <tr><td><code>onCameraAccessDenied</code> (optional)</td><td>callback function that fires when camera access is denied or lost.</td></tr>
365
365
  <tr><td><code>captureSignature</code> (optional)</td><td>boolean indicating whether the user should be prompted to sign the screen before submission. Defaults to false.</td></tr>
366
366
  <tr><td><code>captureSignatureVideo</code> (optional)</td><td>boolean indicating whether the user should be prompted to record themselves signing the screen before submission. Defaults to false.</td></tr>
367
- <tr><td><code>captureAdditionalDocuments</code> (optional)</td><td>array of additional documents to be captured. Each element includes a name and description.</td></tr>
367
+ <tr><td><code>captureAdditionalDocuments</code> (optional)</td><td>array of additional documents to be captured, for available options consult the Additional Document Properties table below.</td></tr>
368
368
  <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>
369
369
  <tr><td><code>precapturedDocuments</code> (optional)</td><td>object to allow documents that have been previously captured to be submitted. Valid keys: idCardFront, idCardBack, passport.</td></tr>
370
370
  <tr><td><code>idCaptureLoadingOverlayMode</code> (optional)</td><td>string indicating which ID capture loading overlay screen should be used. Supported values: default and legacy. Defaults to default.</td></tr>
@@ -452,7 +452,7 @@ Render a fullscreen capture component that performs IDValidation and FaceValidat
452
452
  <tr><td><code>onCameraAccessDenied</code> (optional)</td><td>callback function that fires when camera access is denied or lost.</td></tr>
453
453
  <tr><td><code>captureSignature</code> (optional)</td><td>boolean indicating whether the user should be prompted to sign the screen before submission. Defaults to false.</td></tr>
454
454
  <tr><td><code>captureSignatureVideo</code> (optional)</td><td>boolean indicating whether the user should be prompted to record themselves signing the screen before submission. Defaults to false.</td></tr>
455
- <tr><td><code>captureAdditionalDocuments</code> (optional)</td><td>array of additional documents to be captured. Each element includes a name and description.</td></tr>
455
+ <tr><td><code>captureAdditionalDocuments</code> (optional)</td><td>array of additional documents to be captured, for available options consult the Additional Document Properties table below.</td></tr>
456
456
  <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>
457
457
  <tr><td><code>idCaptureLoadingOverlayMode</code> (optional)</td><td>string indicating which ID capture loading overlay screen should be used. Supported values: default and legacy. Defaults to default.</td></tr>
458
458
  <tr><td><code>idCaptureRequirement</code> (optional)</td><td>string to indicate which types of documents should be captured. Valid values: idCard, passport, idCardOrPassport, idCardAndPassport. Default is idCardOrPassport.</td></tr>
@@ -538,7 +538,7 @@ Render a fullscreen capture component that performs FaceValidation, and then sto
538
538
  <tr><td><code>onCameraAccessDenied</code> (optional)</td><td>callback function that fires when camera access is denied or lost.</td></tr>
539
539
  <tr><td><code>captureSignature</code> (optional)</td><td>boolean indicating whether the user should be prompted to sign the screen before submission. Defaults to false.</td></tr>
540
540
  <tr><td><code>captureSignatureVideo</code> (optional)</td><td>boolean indicating whether the user should be prompted to record themselves signing the screen before submission. Defaults to false.</td></tr>
541
- <tr><td><code>captureAdditionalDocuments</code> (optional)</td><td>array of additional documents to be captured. Each element includes a name and description.</td></tr>
541
+ <tr><td><code>captureAdditionalDocuments</code> (optional)</td><td>array of additional documents to be captured, for available options consult the Additional Document Properties table below.</td></tr>
542
542
  <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>
543
543
  <tr><td><code>loadingOverlayMode</code> (optional)</td><td>string indicating which loading overlay screen should be used. Supported values: default and legacy. Defaults to default.</td></tr>
544
544
  <tr><td><code>timeoutDurationMs</code> (optional)</td><td>the duration of time in milliseconds that the user may try to pass the realness check. Defaults to 15000 (15 seconds).</td></tr>
@@ -764,7 +764,7 @@ Render a fullscreen capture component that performs IDValidation and FaceValidat
764
764
  <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>
765
765
  <tr><td><code>captureSignature</code> (optional)</td><td>boolean indicating whether the user should be prompted to sign the screen before submission. Defaults to false.</td></tr>
766
766
  <tr><td><code>captureSignatureVideo</code> (optional)</td><td>boolean indicating whether the user should be prompted to record themselves signing the screen before submission. Defaults to false.</td></tr>
767
- <tr><td><code>captureAdditionalDocuments</code> (optional)</td><td>array of additional documents to be captured. Each element includes a name and description.</td></tr>
767
+ <tr><td><code>captureAdditionalDocuments</code> (optional)</td><td>array of additional documents to be captured, for available options consult the Additional Document Properties table below.</td></tr>
768
768
  <tr><td><code>companyId</code> (optional)</td><td>company identifier to include with submission.</td></tr>
769
769
  <tr><td><code>needImmediateResponse</code> (optional)</td><td>boolean to indicate if validation of the minimum resolution for an ID document image should be triggered. Defaults to true.</td></tr>
770
770
  <tr><td><code>manualReviewRequired</code> (optional)</td><td>boolean flag to indicate whether responses should always be reviewed by a human. Defaults to false.</td></tr>
@@ -942,4 +942,25 @@ verbiage: {
942
942
 
943
943
  Leaving a locale out of your translation object will result in the default text being shown for that locale, with the rest of your provided translations being honored. This functionality can be leveraged to define translations for languages that the IDmission Web SDK does not yet support. If you end up creating full translations for new languages, feel free to send your translations our way at https://www.idmission.com/company/contact-us/, and we will try to get them added to the main SDK translation set!
944
944
 
945
- The full list of i18n locales can be found here: https://github.com/ladjs/i18n-locales.
945
+ The full list of i18n locales can be found here: https://github.com/ladjs/i18n-locales.
946
+
947
+ ### Specifying additional documents to be captured
948
+
949
+ Many customer flow documented above include a `captureAdditionalDocuments` property, which allows for an array of documents to be specified in the order that they will be captured in.
950
+
951
+ **Additional Document Properties**
952
+
953
+ <table>
954
+ <tr>
955
+ <td><code>name</code></td><td>string indicating the name of document to be captured</td>
956
+ </tr>
957
+ <tr>
958
+ <td><code>description</code> (optional)</td><td>string describing to the user anything extra about the document that they should know</td>
959
+ </tr>
960
+ <tr>
961
+ <td><code>skip</code> (optional)</td><td>async function that may return a boolean indicating whether this document should be skipped</td>
962
+ </tr>
963
+ <tr>
964
+ <td><code>processAsPOA</code> (optional)</td><td>boolean indicating whether the document should be treated as a proof of address -- when true, the document will be processed and validated on the server.</td>
965
+ </tr>
966
+ </table>
@@ -4,9 +4,11 @@ export type AdditionalDocument = {
4
4
  name: string;
5
5
  description?: string;
6
6
  skip?: () => Promise<boolean>;
7
+ processAsPOA?: boolean;
7
8
  };
8
9
  export type UploadedDocument = {
9
10
  documentName: string;
11
+ processAsPOA: 'Y' | 'N';
10
12
  additionalDocument: string | Record<string, string>;
11
13
  };
12
14
  export type AdditionalDocumentCaptureClassNames = {
@@ -8,6 +8,7 @@ export type CapturedDocument = {
8
8
  aspectRatio?: number;
9
9
  cameraFeedMode?: CameraFeedMode;
10
10
  instructions?: ReactNode;
11
+ processAsPOA?: boolean;
11
12
  documentId?: string;
12
13
  content?: Blob;
13
14
  contentUrl?: string;
@@ -49,7 +49,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
49
49
  var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
50
50
  var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
51
51
 
52
- var webSdkVersion = '2.0.3';
52
+ var webSdkVersion = '2.0.5';
53
53
 
54
54
  function getPlatform() {
55
55
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -9492,6 +9492,7 @@ var AdditionalDocumentCapture = function AdditionalDocumentCapture(_a) {
9492
9492
  var fileContent = fileReader.result.toString();
9493
9493
  onComplete === null || onComplete === void 0 ? void 0 : onComplete({
9494
9494
  documentName: document.name,
9495
+ processAsPOA: document.processAsPOA ? 'Y' : 'N',
9495
9496
  additionalDocument: {
9496
9497
  name: file.name,
9497
9498
  fileContent: dataUrlToBase64Sync(fileContent),
@@ -9758,7 +9759,7 @@ var useVideoRecorder = function useVideoRecorder(camera, audioStream, mergeAVStr
9758
9759
  var processAudio = React.useCallback(function () {
9759
9760
  var _a;
9760
9761
  var audioBlob = new Blob(audioChunks.current, {
9761
- type: 'audio/ogg; codecs=opus'
9762
+ type: 'audio/mp4'
9762
9763
  });
9763
9764
  audioChunks.current = [];
9764
9765
  setAudioUrl(URL.createObjectURL(audioBlob));