Migration Guide: KYC Documents Capture Web SDK 3.x to 4.x

Upgrading from @trulioo/kyc-documents-capture 3.x to 4.x

Version 4.0 changes how the KYC Documents Capture Web SDK stylesheet is loaded. The camera UI CSS is no longer loaded implicitly with the JavaScript runtime, so existing integrations must load it explicitly.

npm integration

Import the stylesheet once from your application's entry file, alongside the Capture API import:

import "@trulioo/kyc-documents-capture/styles";
import { initializeCapture } from "@trulioo/kyc-documents-capture/api";

Your bundler must support CSS imports. Importing the stylesheet once is sufficient, even when the application creates multiple cameras.

CDN integration

Load main.css before the Capture module, using the same SDK version for both files:

<link
  rel="stylesheet"
  href="https://cdn.trulioo.com/web/sdk/kyc-documents-capture/4.0.0/main.css"
/>
<script type="module">
  import { initializeCapture } from "https://cdn.trulioo.com/web/sdk/kyc-documents-capture/4.0.0/api.mjs";
</script>

Replace 4.0.0 with the version you deploy. Pin the JavaScript module and stylesheet to the same version in production.

Migration checklist

  • Upgrade to @trulioo/kyc-documents-capture 4.0 or later.
  • Add one @trulioo/kyc-documents-capture/styles import to an npm application's entry file, or add the matching CDN main.css link.
  • Verify the camera UI renders correctly in the production build.