Migration
This guide walks you through upgrading from the deprecated v1 SDK to v2.
1. Installation
Refer to the full install instructions:
New SDK v2: Installation
Deprecated v1: Deprecated Installation
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
Initialization
v1 event listener
imagesComputed
is removed.v2 uses
smart-camera-web.publish
for events.
Event Payload
The event detail for
smart-camera-web.publish
is still the same asimagesComputed
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
Review the v2 Installation
Explore more v2 examples in Usage
Last updated
Was this helpful?