Video ID Validation
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.
Example
import React, { useState } from 'react'
import { VideoIdValidation } from 'idmission-web-sdk'
function getSessionId() {
return fetch('/api/get-session').then(resp => resp.json()).then(resp => resp.id)
}
function MyComponent() {
const [running, setRunning] = useState(false)
return (
<>
<button onClick={() => setRunning(true)}>Start Video ID Validation</button>
{running && (
<VideoIdValidation
sessionId={getSessionId}
onComplete={(submissionResponse) => {
alert('Your ID has been validated, proceed to the next checkpoint.')
}}
onDenied={(submissionResponse) => {
alert('Your ID could not be validated, you shall not pass!')
}}
/>
)}
</>
)
}Props
langLanguage code to use. Supported values: ‘auto’ (detect based on user’s OS), ‘en’ (English), ‘es’ (Spanish). Defaults to auto. |
sessionIdA session identifier generated with your IDmission credentials. |
clientRequestIDThe ClientRequestID field is typically populated with the Form ID and is used to link records together - in this case an id validation record to the original form |
submissionUrlURL to hit with all API requests. Defaults to the value specified in your decoded submissionToken. |
authUrlURL to validate session against. Defaults to https://portal-api.idmission.com. |
documentServiceUrlURL to upload captured documents to via Tus. |
companyIdCompany identifier to include with submission. |
jobIdThe ID of the job to associate with the submission. |
taskIdThe ID of the task to associate with the submission. |
needImmediateResponseBoolean flag to indicate if validation of the minimum resolution for an ID document image should be triggered. Defaults to true. |
manualReviewRequiredBoolean flag to indicate whether responses should always be reviewed by a human. If set to ‘forced’, the server will push all forms to “Review Forced” for the manual review team to work, regardless of the automated decision results. Defaults to false. |
idBackImageRequiredBoolean flag to indicate whether the back of the ID card image will be considered in processing decisions. Default is true. |
verifyIdWithExternalDatabasesBoolean flag to indicate whether ID data should be verified with government databases such as AAMVA, watch lists, etc. |
bypassAgeValidationBoolean to indicate whether end-users under the age of 18 should be allowed through validation. Defaults to false. |
bypassNameMatchingBoolean to indicate if matching the name in the request against the name extracted from the ID should be bypassed. Defaults to true. |
personalDataObject of personal data to store with the submitted ID. Valid keys: uniqueNumber, name, phone, phoneCountryCode, email, dob, gender, addressLine1, addressLine2, city, district, postalCode, country. |
cardDataObject of credit/debit card data to store with the submitted ID. Valid keys: cardToken, cardLast4, cardExpDate, nameOnCard. |
idDataObject of ID data to validate against the submitted ID. Valid keys: issueDate, expDate. |
webhooksEnabledBoolean flag to indicate whether customer-configured webhooks should be invoked after submission. |
webhooksURLURL to use when invoking customer-configured webhooks. |
webhooksClientTraceIdA customer provided trace id to use when invoking customer-configured webhooks. |
webhooksStripSpecialCharactersBoolean flag to indicate whether non-alphanumeric characters should be removed from the submission data when customer-configured webhooks are invoked. |
webhooksSendInputImagesBoolean flag to indicate whether raw user-captured images should be included in the submission data when customer-configured webhooks are invoked. |
webhooksSendProcessedImagesBoolean flag to indicate whether processed user-captured images should be included in the submission data when customer-configured webhooks are invoked. |
webhooksFireOnReviewBoolean flag to indicate whether customer-configured webhooks should be invoked upon ID being marked for manual review. |
webhooksFireOnReviewURLURL to use when invoking customer-configured webhooks when ID is marked for manual review. |
sendBase64DocumentsInSwaggerProxyBoolean flag to enable download and replace behavior for documents in the Swagger Proxy API. Defaults to false. |
customerDataMatchConfigObject of configuration flags to send for data matching on the server against the data extracted from the ID. |
useDocumentServiceForLivenessChecksBoolean flag to indicate whether the liveness check photos should be uploaded to the document service, rather than sent as base64. Defaults to false. |
onLoadingStartedCallback function that fires when the loading overlay is shown. |
onLoadingProgressCallback function that fires when the loading overlay progress changes. |
onLoadingCompletedCallback function that fires when the loading overlay is dismissed. |
onLoadingFailedCallback function that fires when the loading sequence fails. |
onBeforeDocumentUploadCallback function that fires immediately prior to each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document contents before it is exchanged for a document token. The document content and metadata are passed in as parameters and a promise resolving to void or false should be returned. If the returned promise resolves to false, the document will not be uploaded. |
onDocumentUploadProgressCallback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. |
onDocumentUploadedCallback function that fires immediately after each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document token. The document token and metadata are passed in as parameters. |
onDocumentUploadFailedCallback function that fires when a document failed to upload. The error and metadata are passed in as parameters. |
onBeforeSubmitCallback 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. |
onSubmitCallback function that fires when the user has completed the flow instead of making a call to IDmission’s servers, allowing customers to specify their own submission logic. Arguments: the request payload that would have been dispatched to IDmission’s API, which contains the images/documents/video submitted by the user. Note that when this parameter is supplied, onComplete will never fire, and the customer will need to implement their own error handling/retry logic. Use at your own risk! |
onCompleteCallback function that fires when the user has completed all flows. 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. |
onRequestFailureCallback function that fires when an error occurs during the submission process. Arguments: the Error object is passed as an argument to the customer’s application for further handling. |
onExitCaptureCallback function that fires when the user clicks the exit button during ID or selfie capture. |
onExitAfterFailureCallback function that fires when the user clicks the exit button after completing the IDValidation flow and failing the realness check. |
onUserCancelCallback function that fires when the user clicks the exit button from the loading overlay, declining to engage with IDmission. Binding this callback results in the cancel button being rendered on the loading overlay. |
onCameraAccessDeniedCallback function that fires when the camera access is denied. |
onCameraTamperingDetectedCallback function that fires when the camera tampering is detected. |
onMicrophoneAccessDeniedCallback function that fires when the microphone access is denied. |
onLoadingOverlayDismissedCallback function that fires when the continue button is clicked on the loading overlay. * |
onAuthErrorCallback function that fires when the session creation or validation fails. |
idCapturePropsObject containing any overrides for IDValidation. |
faceLivenessPropsObject containing any overrides for FaceLiveness. |
captureSignatureBoolean or async function indicating whether the user should be prompted to sign the screen before submission. Defaults to false. |
captureSignatureVideoBoolean or async function indicating whether the user should be prompted to record themselves signing the screen before submission. Defaults to false. |
captureAdditionalDocumentsArray of additional documents to be captured. Each element includes a name and description. |
idCaptureModelsEnabledBoolean indicating whether ID guided capture experience should be utilized for automatic capture. Setting to false enables the manual capture button. Defaults to true. |
videoIdCaptureThresholdsObject containing threshold overrides for ID capture. |
readTextPromptAn optional text prompt to display on screen for the user to read during video capture after the ID card has been shown. |
readTextTimeoutDurationMsThe duration of time in milliseconds that the user is allowed to spend reading the readTextPrompt. Defaults to 15000 (15 seconds). |
readTextMinReadingMsThe duration of time in milliseconds that the user is forced to spend reading the readTextPrompt before they can click the Done button. Defaults to 3000 (3 seconds). |
skipSuccessScreenBoolean 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. |
skipIdCaptureBoolean to indicate whether to skip the initial ID capture flow. Note that when this flag is set, submission to IDmission’s servers will not be attempted; it should be used in tandem with onSubmit. Defaults to false. |
skipShowIdCardBackBoolean or async function to indicate whether to instruct the user to show the back of their ID card during video capture. If an async function is supplied returning a boolean, it will be evaluated at the time of ID front video capture completion. Defaults to false. |
customOverlayContentReact component to render if the warmup overlay needs to be completely replaced. Note that 100px padding should be applied to the bottom as the loading progress will be displayed over this content. * |
idCaptureLoadingOverlayModeString indicating which ID capture loading overlay screen should be used. Supported values: ‘default’ and ‘legacy’. Defaults to ‘default’. |
idCaptureGuideTypeString to indicate what type of guides to use during capture. Using fit is highly recommended in order to capture the best quality image. Valid values: fit, overlay. Defaults to fit. |
idCaptureGuideImagesObject containing any overrides for the guide overlay images during ID capture. Images must be supplied for in both portrait and landscape orientations for both sides of the ID card. Each image must include a url, width, and height — this is due to some interesting behavior in Safari where the image measurements cannot be trusted. |
idCapturePortraitGuidesOnMobileBoolean to indicate whether guide images should be rotated on mobile. Defaults to true. |
idCaptureRotateLoadingOverlayImageWhenPortraitBoolean to indicate whether loading overlay image should be rotated on when mobile guides are rotated. Defaults to true. |
idCardForFaceMatchString containing a base64 image or document service ID pointing to an ID card front image that should be used to match the user’s face against. Leave blank to disable face matching. |
idDocumentTypeString indicating which type of ID document to guide the user to hold up during the video. Supported values: ‘idCardOrPassport’, ‘idCard’, ‘passport’. Defaults to ‘idCardOrPassport’. |
faceLivenessLoadingOverlayModeString indicating which face liveness loading overlay screen should be used. Supported values: ‘default’ and ‘legacy’. Defaults to ‘default’. |
disableFaceDetectionWhileAudioCaptureBoolean to disable face detection during audio capture after X seconds as defined by disableFaceDetectionWhileAudioCaptureMsDelay. Defaults to false. |
disableFaceDetectionWhileAudioCaptureMsDelayNumber of milliseconds after which face detection will be disabled if disableFaceDetectionWhileAudioCapture is set to true. Defaults to 2000. |
silentFallbackFlag for suppressing fallback messaging - used when models fail to load |
mergeAVStreamsBoolean flag to indicate whether recorded audio should be merged onto the recorded video stream before submission. Defaults to false. |
matchOnlyBoolean flag to indicate whether we should only attempt to match the ID and face, rather than running a validation job on the captured ID. Defaults to false. |
themeName of an included theme or object containing theme properties. * |
assetsObject containing any asset overrides. |
classNamesObject containing any classNames for inner components. * |
colorsObject containing any color overrides. |
verbiageObject containing any verbiage overrides. |
geolocationEnabledBoolean flag to indicate whether users should be prompted to share their location. Default is true. |
geolocationRequiredBoolean flag to indicate whether users should be blocked from proceeding if they block location access. Default is false. |
debugModeBoolean flag to enable on-screen prediction information output. Default is false. |
Assets
idCapture.documentDetectionModelUrlURL to the document detection model. Defaults to defaultDocumentDetectorModelPath. |
idCapture.focusModelUrlURL to the focus model. Defaults to defaultFocusModelPath. |
idCapture.loadingOverlay.instructionImageUrlURL to the instruction image on the loading overlay. Defaults to https://websdk-cdn-dev.idmission.com/assets/WebSDK-Instruction-DL-Capture-3-Portrait.png. |
idCapture.loadingOverlay.cameraAccessDenied.imageUrlURL to the image to display when camera access is denied. Defaults to https://websdk-cdn-dev.idmission.com/assets/camera-disable-icon.png. |
faceLiveness.loadingOverlay.instructionImageUrlURL to the instruction image on the loading overlay. Defaults to https://websdk-cdn-dev.idmission.com/assets/Selfie-Image-1.png. |
faceLiveness.loadingOverlay.cameraAccessDenied.imageUrlURL to the image to display when camera access is denied. Defaults to https://websdk-cdn-dev.idmission.com/assets/camera-disable-icon.png. |
faceLiveness.loadingOverlay.microphoneAccessDenied.imageUrlURL to the image to display when microphone access is denied. Defaults to https://websdk-cdn-dev.idmission.com/assets/microphone-disable-icon.svg. |
faceLiveness.failure.imageUrlURL to the image to display on the FaceLivenessFailure screen. Defaults to https://websdk-cdn-dev.idmission.com/assets/Face_Not_Detected.svg. |