veryfi-lens-sdk
v1.1.2
Published
Veryfi Lens web sdk
Downloads
5
Readme
- Import package
- Add id='veryfi-container' to container you want lens to appear
- Add id='blur-detector' to edit screen if you want to use it's logic
- Create following function
const startLens = async () => {
veryfiLens.setUserAgent(navigator.userAgent); //might not be needed if navigator is availible before the sdk
veryfiLens.setLocation('US') // 'US' or 'Brazil' to choose servers
veryfiLens.init(sessionToken);
veryfiLens.startCamera();
intervalRef = window.setInterval(() => {
setSocketStatusColor(veryfiLens.getSocketStatusColor()); //if you want to see socket status
}, INTERVAL);
};
- Call it
- Use the following on capture button
const takePhoto = () => {
veryfiLens.capture(setImage, setIsEditing);
};
where setImage is a setter for cropped image that you will use further and setIsEdiditing is a setter for isEditing that would typically be used to change from camera screen to editing(screen with cropped image)