From 215876cf76ccb634e1fd804820c403ca6aa79d93 Mon Sep 17 00:00:00 2001 From: Amir Reavis-Bey Date: Tue, 20 Feb 2024 17:12:12 -0500 Subject: [PATCH 1/2] provide imageAnalyticsPayload for selfie capture changelog: Internal, Document Authentication, Selfie image provides metadata upon submission to image uploader --- .../document-capture/components/acuant-capture.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/javascript/packages/document-capture/components/acuant-capture.tsx b/app/javascript/packages/document-capture/components/acuant-capture.tsx index a004e9e83f4..ff492847317 100644 --- a/app/javascript/packages/document-capture/components/acuant-capture.tsx +++ b/app/javascript/packages/document-capture/components/acuant-capture.tsx @@ -512,9 +512,19 @@ function AcuantCapture( } function onSelfieCaptureSuccess({ image }: { image: string }) { + const analyticsPayload: ImageAnalyticsPayload = getAddAttemptAnalyticsPayload({ + width: null, + height: null, + fingerprint: null, + mimeType: 'image/jpeg', // Acuant Web SDK currently encodes all images as JPEG + source: 'acuant', + size: getDecodedBase64ByteSize(image), + failedImageResubmission: false, + }); + trackEvent('idv_sdk_selfie_image_added', { captureAttempts }); - onChangeAndResetError(image); + onChangeAndResetError(image, analyticsPayload); onResetFailedCaptureAttempts(); setIsCapturingEnvironment(false); } From 5644f353381f03f1462738c8699833460b529452 Mon Sep 17 00:00:00 2001 From: Amir Reavis-Bey Date: Fri, 23 Feb 2024 16:50:25 -0500 Subject: [PATCH 2/2] make width, height and fingerprint optional --- .../document-capture/components/acuant-capture.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/javascript/packages/document-capture/components/acuant-capture.tsx b/app/javascript/packages/document-capture/components/acuant-capture.tsx index ff492847317..3478f75ab8c 100644 --- a/app/javascript/packages/document-capture/components/acuant-capture.tsx +++ b/app/javascript/packages/document-capture/components/acuant-capture.tsx @@ -35,11 +35,11 @@ interface ImageAnalyticsPayload { /** * Image width, or null if unknown */ - width: number | null; + width?: number | null; /** * Image height, or null if unknown */ - height: number | null; + height?: number | null; /** * Mime type, or null if unknown */ @@ -65,7 +65,7 @@ interface ImageAnalyticsPayload { /** * Fingerprint of the image, base64 encoded SHA-256 digest */ - fingerprint: string | null; + fingerprint?: string | null; /** * @@ -513,9 +513,6 @@ function AcuantCapture( function onSelfieCaptureSuccess({ image }: { image: string }) { const analyticsPayload: ImageAnalyticsPayload = getAddAttemptAnalyticsPayload({ - width: null, - height: null, - fingerprint: null, mimeType: 'image/jpeg', // Acuant Web SDK currently encodes all images as JPEG source: 'acuant', size: getDecodedBase64ByteSize(image),