Skip to main content

Veryfi Lens Settings

setLensSessionKey(session)Set Lens session key which is acquired from the Client ID, passed from the server side.
initWasm(session, client_id) (asynchronous)Initialize and render the Mobile Capture SDK using WASM with all necessary HTML, CSS, JS components inside your app.
captureWasm() (asynchronous)Capture and crop the document if it exists in the frame. If there’s no document present, it will capture the whole frame. This method returns the cropped image as a string in base64 format that you can now use later in your app. If using react you can pass following useState setters to the method:setImage - sets Image to image stringsetIsEditing - sets isEditing to true
stopWasm()Stop camera and exit Lens.

Other related methods include

getBoxColor()Get the RGBA color of the current bounding boxes for cropped documents. The default value is “rgba(84, 192, 139, 0.6)”
setBoxColor(color)Set the bounding boxes color.
getCroppedImage()Get the cropped image from the above capture() method.
getCoordinates()Get the coordinates of the cropped document.
getIsDocument()Check if the original image contains a document.
getBlurStatus()Get blur status of a cropped image (make sure to run after image is set)
setUserAgent()Set userAgent, pass navigator.useAgent to it if SDK loads faster than user agent
cleanCanvases()Cleans up all SDK’s canvases
getDeviceData()Get an object containing device uuid