biometry-sdk 2.3.1 → 2.3.2

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.
Files changed (2) hide show
  1. package/README.md +23 -15
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -8,12 +8,15 @@ We also have UI component library for [React](https://www.npmjs.com/package/biom
8
8
  ## Table of Contents:
9
9
  - [Installation](#installation)
10
10
  - [Basic Usage (Direct SDK Methods)](#basic-usage-direct-sdk-methods)
11
- - [Consents](#1-consents)
12
- - [1.1 Give Authorization Consent](#11-give-authorization-consent)
13
- - [1.2 Give Storage Consent](#12-give-storage-consent)
14
- - [Face Enrollment](#2-face-enrollment)
15
- - [Voice Enrollment](#3-voice-enrollment)
16
- - [Process Video](#4-process-video)
11
+ - [Sessions](#1-sessions)
12
+ - [Consents](#2-consents)
13
+ - [1.1 Give Authorization Consent](#21-give-authorization-consent)
14
+ - [1.2 Give Storage Consent](#22-give-storage-consent)
15
+ - [Face Enrollment](#3-face-enrollment)
16
+ - [Voice Enrollment](#4-voice-enrollment)
17
+ - [Process Video](#5-process-video)
18
+ - [Face Match](#6-face-match)
19
+ - [DocAuth](#7-docauth)
17
20
  - [Advanced Usage And Best Practices](#advanced-usage-and-best-practices)
18
21
  - [Typical FaceMatch Flow](#typical-facematch-flow)
19
22
  - [Error Handling](#error-handling)
@@ -40,16 +43,20 @@ const sdk = new BiometrySDK('YOUR_API_KEY');
40
43
  ### Example
41
44
  You can find an example in the example/ directory. The example demonstrates how you might integrate the BiometrySDK in a React component with the state.
42
45
 
43
- ### 1. Sessions
46
+ ## 1. Sessions
44
47
  Session is a way to group transactions together. It is useful when you want to group transactions that are related to each other. For example, you can start a session and then use the session ID to link transactions within a unified group.
48
+
49
+ Note: Use sessions generated by Biometry for API calls. Biometry sessions always have `sess_` prefix. Do not use own uuids or any other values.
50
+
51
+ Example:
45
52
  ```javascript
46
- const response = await sdk.startSession();
53
+ const response = await sdk.startSession(); // returns uuid with `sess_` prefix
47
54
  const sessionId = response.data;
48
55
 
49
56
  const voiceFile = new File([/* voice audio bytes */], 'voice.wav', { type: 'audio/wav' });
50
57
  const faceFile = new File([/* face image bytes */], 'face.jpg', { type: 'image/jpeg' });
51
58
 
52
- // Use the session ID to link transactions within a unified group
59
+ // Use the session ID in X-Session-Id header to link transactions within a unified group
53
60
  await sdk.giveStorageConsent(true, 'John Doe', { sessionId });
54
61
  await sdk.enrollFace(faceFile, 'John Doe', { sessionId });
55
62
  await sdk.enrollVoice(voiceFile, 'John Doe', { sessionId });
@@ -57,8 +64,8 @@ Session is a way to group transactions together. It is useful when you want to g
57
64
  // Go to the Results page in your dashboard and see the transactions grouped by the session ID
58
65
  ```
59
66
 
60
- ### 2. Consents
61
- #### 2.1 Give Authorization Consent
67
+ ## 2. Consents
68
+ ### 2.1 Give Authorization Consent
62
69
  You **must** obtain user authorization consent before performing any biometric operations (Face Recognition, Voice Recognition, etc.):
63
70
  ```javascript
64
71
  await sdk.giveAuthorizationConsent(true, 'John Doe');
@@ -70,7 +77,7 @@ You **must** obtain user authorization consent before performing any biometric o
70
77
  - The first argument (`true`) indicates that the user has granted consent.
71
78
  - The second argument is the user's full name (used for record-keeping within Biometry).
72
79
 
73
- #### 2.2 Give Storage Consent
80
+ ### 2.2 Give Storage Consent
74
81
  You **must** obtain user consent before storing biometric data (Face Enrollment, Voice Enrollment):
75
82
  ```javascript
76
83
  await sdk.giveStorageConsent(true, 'John Doe');
@@ -82,7 +89,7 @@ You **must** obtain user consent before storing biometric data (Face Enrollment,
82
89
  - The first argument (`true`) indicates that the user has granted consent.
83
90
  - The second argument is the user's full name (used for record-keeping within Biometry).
84
91
 
85
- ### 3. Face Enrollment
92
+ ## 3. Face Enrollment
86
93
  Enroll a user's face for future recognition or matching:
87
94
  ```javascript
88
95
  const faceFile = new File([/* face image bytes */], 'face.jpg', { type: 'image/jpeg' });
@@ -92,7 +99,7 @@ Enroll a user's face for future recognition or matching:
92
99
  console.log('Face Enrollment Response:', faceResponse);
93
100
  ```
94
101
 
95
- ### 4. Voice Enrollment
102
+ ## 4. Voice Enrollment
96
103
  Enroll a user's voice for future authentication checks:
97
104
  ```javascript
98
105
  const voiceFile = new File([/* voice audio bytes */], 'voice.wav', { type: 'audio/wav' });
@@ -101,7 +108,7 @@ Enroll a user's voice for future authentication checks:
101
108
  const voiceResponse = await sdk.enrollVoice(voiceFile, 'John Doe');
102
109
  console.log('Voice Enrollment Response:', voiceResponse);
103
110
  ```
104
- ### 5. Process Video
111
+ ## 5. Process Video
105
112
  Process a user's video for liveness checks and identity authorization:
106
113
  ```javascript
107
114
  const videoFile = new File([/* file parts */], 'video.mp4', { type: 'video/mp4' });
@@ -222,6 +229,7 @@ Always wrap calls in try/catch and provide user-friendly messages or fallback lo
222
229
  console.error('Face match error:', error);
223
230
  }
224
231
  ```
232
+
225
233
  ### Security And Privacy Considerations
226
234
  1. **Protect Your API Key:** Avoid storing your API key in client-side code if possible. Use environment variables or server-side proxies.
227
235
  2. **Obtain Explicit Consent:** Ensure you have a transparent process for obtaining and storing user consent.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biometry-sdk",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "type": "module",
5
5
  "main": "dist/sdk.js",
6
6
  "module": "dist/sdk.js",