Veryfi Lens Settings
- WASM Receipt
- WASM Long Receipt
- Upload Document/Drag and Drop
- WebSocket
Method | Description |
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. |
Method | Description |
setLensSessionKey(session) | Set Lens session key which is acquired from the Client ID, passed from the server side. |
initWasmLong(session, client_id) (asynchronous) | Initialize and render the Mobile Capture SDK using WASM with all necessary HTML, CSS, JS components inside your app. |
startStitching() (asynchronous) | Start long receipt stitching process |
captureLong() (asynchronous) | This method returns a stitched 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. |
Method | Description |
initUploadWasm(session, client_id) (asynchronous) | Initialize WASM module that can process single image from file system (Takes ~1-2 seconds to start working, you will seeINFO: Created TensorFlow Lite XNNPACK delegate for CPU. in the console when it is ready) |
captureUploaded(blob) (asynchronous) | Send an image frominput tag to WASM for crop and blur/document detection |
Method | Description |
setLensSessionKey(session) | Set Lens session key which is acquired from the Client ID, passed from the server side. |
init() (asynchronous) | Initialize and render the Mobile Capture SDK with all necessary HTML, CSS, JS components inside your app. |
capture() (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 string setIsEditing - sets isEditing to true |
stopCamera() | Stop camera and exit Lens. |
Other related methods include
Method | Description |
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 |