Migration Guide - KYC Documents Web SDK 3.x to 4.x

Version 4.0 changes how the KYC Documents Web SDK stylesheet is loaded. The SDK 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 SDK import:

import "@trulioo/kyc-documents/styles";
import { Trulioo } from "@trulioo/kyc-documents";

Your bundler must support CSS imports. Importing the stylesheet once is sufficient; do not import it for every SDK launch.

CDN integration

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

<link
  rel="stylesheet"
  href="https://cdn.trulioo.com/web/sdk/kyc-documents/4.0.0/main.css"
/>
<script type="module">
  import { Trulioo } from "https://cdn.trulioo.com/web/sdk/kyc-documents/4.0.0/kyc-documents.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 4.0 or later.
  • Add one @trulioo/kyc-documents/styles import to an npm application's entry file, or add the matching CDN main.css link.
  • Verify the SDK UI renders correctly in the production build.