Migration

This guide walks you through upgrading from the deprecated v1 SDK to v2.


1. Installation

Refer to the full install instructions:

npm

npm install @smileid/web-components@<version>
import "@smileid/web-components/smart-camera-web";

Script tag

Pin to v2.0.0:

<script src="https://cdn.smileidentity.com/js/v2.0.0/smart-camera-web.js"></script>

Or auto-update within v2:

<script src="https://cdn.smileidentity.com/js/v2/smart-camera-web.js"></script>

2. What’s Changed

  1. Initialization

    • v1 event listener imagesComputed is removed.

    • v2 uses smart-camera-web.publish for events.

  2. Event Payload

    • The event detail for smart-camera-web.publish is still the same as imagesComputed


3. Receiving Callbacks

Listen for the same smart-camera-web.publish event:

<smart-camera-web></smart-camera-web>
<script>
  const app = document.querySelector("smart-camera-web");

  app.addEventListener("smart-camera-web.publish", async (e) => {
    // e.detail partners your existing server payload
    console.log("Captured data:", e.detail);
    // send to your backend...
  });
</script>

4. New features

v2 is fully modular. You can compose your own flow—selfie only, ID document only, or any combination/order you prefer. See usage for more examples

5. Next Steps

Last updated

Was this helpful?