Skip to main content

Installation

There are 2 ways of using Lens For Web SDK:

  1. Web Assembly (WASM) - Recommended
  • Fast
  • Accurate
  • Frames are processed on a client
  • Requires extra steps in installation and usage
  1. Web Socket
  • Easy to install and use
  • Frames are sent via socket to our endpoint and processed there
info

WASM Lens utilize SharedArrayBuffer, which requires cross-origin isolation.

To enable it your top level document must include following headers:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

Please read more here

Prerequisites

  1. Install Node.js https://nodejs.org
  2. If you don’t have an existing project - create one
  3. Download veryfi-lens-wasm package

Please check out our demo example for Vanilla JS on https://github.com/veryfi/veryfi-lens-demo-vanillajs

  1. If you dont have it - create index.html file, add basic layout
  2. Copy wasm directory from SDK folder to the root of your project (or next to index.html if it's not on the root level)
  3. Add <div id='veryfi-container'></div> (might require to have height: 100% and overflow: hidden depending on your layout)
info

If you are not using bundlers, you might get ua-parser error. To fix it add export default UAParser to ua-parser.cjs file in sdk/wasm folder.