SDK Sizes
Veryfi Lens for Browser does not add a large binary to your app. It has three parts, and only the first one ends up in your JavaScript bundle:
- SDK JavaScript: the
veryfi-lens-wasmnpm package, bundled with your app. - WASM engine: the document processing engine, downloaded at runtime from
lens.veryfi.com. - ML models: downloaded at runtime from
lens.veryfi.com. Only the models your flavor and configuration need are fetched.
The caps, code_strips, and prescription_label flavors don't use the WASM engine or ML models, so they only download the SDK JavaScript.
Sizes match version 3.5.12. 1 MB = 1,000,000 bytes. "Download" is the compressed transfer size.
SDK JavaScript (npm package)
| Artifact | Size |
|---|---|
npm package (npm pack tarball) | 149 KB |
npm package (installed in node_modules, without dependencies) | 603 KB |
npm package (installed in node_modules, with dependencies) | 3.8 MB |
| SDK code in your bundle (minified) | 296 KB |
| SDK code in your bundle (minified + gzip) | 84 KB |
| SDK code + dependencies in your bundle (minified + gzip) | 136 KB |
The SDK loads flavors and most dependencies with dynamic import(), so bundlers split them into separate chunks. Each user only downloads the chunks used by the flavor they open.
| Dependency | Minified | Minified + gzip |
|---|---|---|
jszip | 98 KB | 28 KB |
@fingerprintjs/fingerprintjs | 39 KB | 16 KB |
@fingerprintjs/fingerprintjs-pro | 12 KB | 5 KB |
Tesseract OCR is not an npm dependency. It is loaded at runtime, and only when documentFieldsToDetect is set (see Optional features). By default it comes from the jsDelivr CDN; you can also host it yourself.
WASM Engine
The SDK detects browser support and downloads one engine build (veryfi-wasm.js + veryfi-wasm.wasm):
| Build | Used by | Size | Download (gzip) |
|---|---|---|---|
| SIMD | Chrome, Edge, Firefox, Android browsers | 7.4 MB | 2.0 MB |
| Safari SIMD | Safari (macOS and iOS) | 6.1 MB | 1.8 MB |
| Non-SIMD | Browsers without WebAssembly SIMD | 5.9 MB | 1.7 MB |
The engine is served with an ETag, so on later visits the browser revalidates its cached copy instead of downloading the engine again.
Estimated Download Size by Lens Flavor
Total first-load download per flavor with the default configuration. Each total includes the SDK JavaScript, the WASM engine, and the ML models.
| Flavor | ML models | Total (Chrome / Android) | Total (Safari / iOS) |
|---|---|---|---|
document | 9.4 MB | 11.6 MB | 11.3 MB |
anydocs | 9.4 MB | 11.6 MB | 11.3 MB |
upload | 9.4 MB | 11.6 MB | 11.3 MB |
checks | 8.2 MB | 10.3 MB | 10.1 MB |
long_document | 6.9 MB | 9.1 MB | 8.8 MB |
credit_card | 10.4 MB | 12.6 MB | 12.3 MB |
caps | — | 0.14 MB | 0.14 MB |
code_strips | — | 0.14 MB | 0.14 MB |
prescription_label | — | 0.14 MB | 0.14 MB |
Optional features
These options add to the totals above:
| Feature | Option | Additional download |
|---|---|---|
| LCD detection (documents / checks) | lcdDetectionForDocuments, lcdDetectionForChecks | +0.7 MB |
| Check front/back detection | frontBackDetectionForChecks | +1.1 MB |
| Local field extraction | documentFieldsToDetect | +9.4 MB |
Local field extraction downloads two kinds of files. The field detection models (3.0 MB) come from lens.veryfi.com. Tesseract OCR (6.5 MB) comes from the jsDelivr CDN, or from your server when tesseractBaseUrl is set: its loader (0.01 MB), its worker (0.03 MB), its engine (1.4 MB), and the English (3.0 MB) and Spanish (2.1 MB) language data.