veryfi-lens-wasm 1.2.7 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,54 +2,15 @@
2
2
 
3
3
  <img src="https://user-images.githubusercontent.com/30125790/212157486-bfd08c5d-9337-4b78-be6f-230dc63838ba.png#gh-light-mode-only" width="200">
4
4
 
5
- # Veryfi Lens for Web WASM SDK
6
5
 
6
+ # Lens for Browser socket version has been moved to a separate package https://github.com/veryfi/veryfi-lens-socket
7
+
8
+ # Veryfi Lens for Browser WASM SDK
7
9
  Veryfi Lens for Web SDK is a framework for your web app to give it document capture superpowers in minutes.
8
10
 
9
11
  Lens follows a client-server architecture where the server is for validating your client and getting session key and the client side is for displaying and showing Lens components for capturing documents.
10
12
 
11
13
 
12
- There are two ways of using Lens for Web:
13
- 1. WebSocket (Only usual receipts, easy to install, slower than WASM)
14
- 2. WASM (Usual and Long Receipts, very fast, some devices are not supported)
15
-
16
- # WebSocket
17
- 1. Import package `import VeryfiLens from 'veryfi-lens-wasm'`
18
- or `const lens = require('veryfi-lens-wasm').default` inside `useEffect` for next.js
19
- 2. Add `id='veryfi-container'` to a div you want lens to appear (it should have full height and hidden overflow)
20
-
21
- For usual receipt (Next.Js example)
22
- ```
23
- const [veryfiLens, setVeryfiLens] = useState<VeryfiLens | null>(null);
24
-
25
- useEffect(() => {
26
- let intervalRef: number | undefined;
27
- if (typeof window !== 'undefined') {
28
- const startLens = async () => {
29
- const lens = require('../../utils/lens-web-sdk/veryfi-lens').default;
30
- lens.init(sessionToken);
31
- setVeryfiLens(lens);
32
- intervalRef = window.setInterval(() => {
33
- setSocketStatusColor(lens.getSocketStatusColor());
34
- }, SOCKET_STATUS_UPDATE_INTERVAL);
35
- }
36
- startLens();
37
- }
38
- return () => {
39
- clearInterval(intervalRef);
40
- };
41
- }, [sessionToken]);
42
-
43
- const takePhoto = () => {
44
- if (veryfiLens) {
45
- veryfiLens.capture(setImage, setIsEditing)
46
- } else {
47
- setError('veryfiLens is not initialized');
48
- }
49
- };
50
- ```
51
-
52
- # WASM
53
14
  **_You can skip first step and copy wasm folder from package directory manually if you want to do so_.**
54
15
 
55
16
  1. run `npm exec veryfi-lens-wasm-setup` and provide it with path to directory where
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "veryfi-lens-wasm",
3
- "version": "1.2.7",
4
- "description": "Lens For Web SDK with WASM",
3
+ "version": "1.3.0",
4
+ "description": "Lens For Browser WASM SDK",
5
5
  "main": "veryfi-lens.js",
6
6
  "type": "module",
7
7
  "repository": {
@@ -17,6 +17,8 @@
17
17
  "author": "George Veryfi",
18
18
  "license": "ISC",
19
19
  "dependencies": {
20
+ "@fingerprintjs/fingerprintjs": "^4.5.1",
21
+ "@fingerprintjs/fingerprintjs-pro": "^3.11.5",
20
22
  "fs-extra": "^11.1.1",
21
23
  "inquirer": "^8.0.0",
22
24
  "path": "^0.12.7"