OtherPreloading the Models

Preloading the models

If you would like to programmatically issue a command to begin downloading and preparing the models on the client’s browser before they enter a customer flow, the following method is available:

<script type="module">
    document.addEventListener('idmission-web-sdk.ready', (e) => {
      IDmissionSDK.preloadModels()
    })
</script>

You may specify which models should be loaded and which should be skipped by supplying an object argument, like so:

IDmissionSDK.preloadModels({
  documentDetectionModel: true,
  focusModel: true,
  faceDetectionModel: false,
})

This can be useful if, for example, you know you won’t need any flows that depend on face detection.