Use the new javascript sdk. Migration guide found here After installing, and importing if required, you can use the web-component by following these steps:
Steps
1. Insert the following markup in your page / component
For Selfie Capture / Liveness Images only
<smart-camera-web>
</smart-camera-web>
For Selfie Capture / Liveness Images, and ID images
<smart-camera-webcapture-id> </smart-camera-web>
For Selfie Capture / Liveness Images, and ID images (front and back)
To Select the Document Capture Mode for ID images add the document-capture-modes attribute with one of camera, upload, or a comma separated combination like camera,upload.
2. The following image should show up on your web page, if installation, and import, was successful.
3. After granting access by clicking the button, you start by capturing a selfie and liveness images. You should see the capture screen below
Click on Take a Selfie and follow the prompts on the screen to take both the Selfie and Liveness images.
At the end of the selfie capture process, you should see the Selfie review screen.
If the Selfie you took is satisfactory, select "Yes, use this one" or select "Re-take selfie" the selfie again running through steps 3 to 5.
4. If you intend to also capture the ID card image and added the capture-id attribute, additional screens related to ID card capture are displayed in addition to the Selfie related screens
Capture your ID card photo
After taking the ID card photo, you should see the review screen
5. Handle the imagesComputed event in your page / component
On clicking the "Yes, use this one" button for the selfie / liveness images flow, or the "Approve" icon on the capture-id flow, an imagesComputed event will be published.
imagesComputed is a CustomEvent returning data — in e.detail — of the shape:
{
partner_params: {
libraryVersion: String,
permissionGranted: Boolean, // expected to be `true`
},
images: [
{
file: '',
image_type_id: Number, // as recommended here: https://docs.usesmileid.com/products/core-libraries#images-required
image: String // base64 encoded string of image
}
]
}