biometry-sdk 1.2.2 → 1.2.3
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 +52 -77
- package/dist/biometry-sdk.cjs.js +1423 -0
- package/dist/biometry-sdk.esm.js +1419 -0
- package/dist/biometry-sdk.umd.js +1429 -0
- package/dist/components/biometry-onboarding.d.ts +26 -1
- package/dist/components/process-video.d.ts +53 -0
- package/dist/index.d.ts +2 -0
- package/package.json +16 -6
- package/dist/components/biometry-onboarding.js +0 -233
- package/dist/index.js +0 -2
- package/dist/sdk.js +0 -179
- package/dist/sdk.test.js +0 -255
- package/dist/types.js +0 -14
package/README.md
CHANGED
|
@@ -1,25 +1,16 @@
|
|
|
1
1
|
# biometry-sdk
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
|
-
The **Biometry Web SDK** is a software development kit designed to
|
|
5
|
-
|
|
4
|
+
The **Biometry Web SDK** is a software development kit (SDK) designed to facilitate the integration of Biometry's API services.
|
|
6
5
|
|
|
7
6
|
## Features
|
|
8
|
-
- **Consent
|
|
9
|
-
|
|
10
|
-
- Collect user permission to store their biometric data for authentication using Biometry.
|
|
11
|
-
- Important: You must obtain consent before performing any onboarding or video processing.
|
|
12
|
-
- **Voice onboarding**:
|
|
13
|
-
- Enroll a user’s voice, creating a voice model for future authentication.
|
|
7
|
+
- **Consent management**: Ask a permission to store their biometric data for authentication using Biometry.
|
|
8
|
+
- **Voice onboarding**: Onboard voice for Voice Recognition.
|
|
14
9
|
- **Face onboarding**: Onboard face for face recognition.
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
- **
|
|
18
|
-
-
|
|
19
|
-
- **Process video**:
|
|
20
|
-
- Checks user liveness and authorizes users based on video input.
|
|
21
|
-
- **Process Video UI Component:** A ready-to-use, customizable component for capturing and processing video.
|
|
22
|
-
|
|
10
|
+
- Includes a customizable **Face Onboarding UI Component** for streamlined user interactions.
|
|
11
|
+
- **Face match**: Compares extracted image from user’s personal document with the frame from the `/process-video.`
|
|
12
|
+
- **Process video**: Process the video through Biometry services to check liveness and authorize user.
|
|
13
|
+
- (UI Component for this feature coming soon)
|
|
23
14
|
|
|
24
15
|
## Installation
|
|
25
16
|
```bash
|
|
@@ -42,30 +33,31 @@ console.log(response);
|
|
|
42
33
|
|
|
43
34
|
## Example
|
|
44
35
|
|
|
45
|
-
You can find an example in the example/ directory. The example demonstrates how
|
|
36
|
+
You can find an example in the example/ directory. The example demonstrates how to integrate the SDK into a React app.
|
|
37
|
+
|
|
46
38
|
## UI Components
|
|
47
|
-
The Biometry Web SDK includes reusable
|
|
39
|
+
The **Biometry Web SDK** includes reusable and customizable web components for key features. These components make it simple to add biometric functionalities to your application.
|
|
48
40
|
|
|
49
41
|
### Face Onboarding Component
|
|
50
|
-
|
|
42
|
+
The `Face Onboarding` component provides an intuitive interface for onboarding users with their camera. It integrates with the `BiometrySDK` to handle backend communication and error states.
|
|
51
43
|
|
|
52
44
|
### Integration
|
|
53
45
|
Here's how to integrate the `Face Onboarding` component into your application:
|
|
54
46
|
|
|
55
47
|
**Option 1: Using npm (Recommended for full SDK usage)**
|
|
56
48
|
1. Install the SDK package via **npm**:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
```bash
|
|
50
|
+
npm install biometry-sdk
|
|
51
|
+
```
|
|
60
52
|
2. Import the component in your **index.js** or equivalent JavaScript file:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
53
|
+
```javascript
|
|
54
|
+
// index.js
|
|
55
|
+
import './node_modules/biometry-sdk/dist/components/biometry-onboarding.js';
|
|
56
|
+
```
|
|
65
57
|
3. Connect the script to your **HTML file** and use the component:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
58
|
+
```html
|
|
59
|
+
<script type="module" src="./index.js"></script>
|
|
60
|
+
```
|
|
69
61
|
|
|
70
62
|
|
|
71
63
|
**Option 2: Using CDN (Quick Integration)**
|
|
@@ -74,14 +66,9 @@ Here's how to integrate the `Face Onboarding` component into your application:
|
|
|
74
66
|
```
|
|
75
67
|
|
|
76
68
|
### Usage
|
|
77
|
-
|
|
78
|
-
- `api-key`: Your Biometry API key.
|
|
79
|
-
- `user-fullname`: The user’s full name (used in data storage and consent).
|
|
69
|
+
The `api-key` and `user-fullname` attributes are required for the component to function.
|
|
80
70
|
|
|
81
|
-
|
|
82
|
-
- `video`: Your custom <video> element.
|
|
83
|
-
- `button`: Custom capture button.
|
|
84
|
-
- `loading`, `success`, `error-no-face`, `error-multiple-faces`, `error-not-centered`, `error-other`: Custom UI messages for different states.
|
|
71
|
+
Custom slots allow you to style and customize UI elements, loading, success, and error states.
|
|
85
72
|
|
|
86
73
|
**Basic Usage**
|
|
87
74
|
```html
|
|
@@ -111,31 +98,38 @@ Here's how to integrate the `Face Onboarding` component into your application:
|
|
|
111
98
|
```
|
|
112
99
|
|
|
113
100
|
### Process Video Component
|
|
114
|
-
The
|
|
101
|
+
The Process Video component allows developers to record, upload, and process video directly within their applications through Biometry services to check liveness and authorize user.
|
|
115
102
|
|
|
116
103
|
### Integration
|
|
117
104
|
**Option 1: Install via npm**
|
|
105
|
+
|
|
118
106
|
1. To include the component in your project, install the biometry-sdk package:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
107
|
+
```bash
|
|
108
|
+
npm install biometry-sdk
|
|
109
|
+
```
|
|
110
|
+
|
|
122
111
|
2. After installation, import the component into your project:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
112
|
+
```javascript
|
|
113
|
+
// index.js
|
|
114
|
+
import './node_modules/biometry-sdk/dist/components/process-video.js';
|
|
115
|
+
```
|
|
116
|
+
|
|
127
117
|
3. Include the component in your HTML:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
**Option 2:
|
|
118
|
+
```html
|
|
119
|
+
<script type="module" src="./index.js"></script>
|
|
120
|
+
<process-video ...></process-video>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Option 2: Import directly via CDN**
|
|
124
|
+
|
|
125
|
+
You can skip the npm installation and include the component directly in your HTML:
|
|
134
126
|
```html
|
|
135
127
|
<script type="module" src="https://cdn.jsdelivr.net/npm/biometry-sdk/dist/components/process-video.js"></script>
|
|
136
128
|
<process-video ...></process-video>
|
|
137
129
|
```
|
|
130
|
+
|
|
138
131
|
### Usage
|
|
132
|
+
|
|
139
133
|
**Basic Usage**
|
|
140
134
|
```html
|
|
141
135
|
<process-video
|
|
@@ -169,35 +163,16 @@ The **Process Video** component enables you to record, upload, and process a vid
|
|
|
169
163
|
<div slot="success">Video submitted successfully!</div>
|
|
170
164
|
</process-video>
|
|
171
165
|
```
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
1. **Always Acquire Consent**
|
|
179
|
-
- Before performing Face Onboarding or Process Video, you can call:
|
|
180
|
-
```javascript
|
|
181
|
-
sdk.giveConsent(true, userFullName);
|
|
182
|
-
```
|
|
183
|
-
- Or directly send a request to the `/consent` in the [official documentation](https://developer.biometrysolutions.com/overview/).
|
|
184
|
-
|
|
185
|
-
This ensures legal compliance and user awareness when storing and processing biometric data.
|
|
186
|
-
3. **Handle Errors Gracefully**
|
|
187
|
-
- The SDK methods throw errors if something goes wrong (e.g., network, permission, or detection errors). Use try/catch or .catch() to handle them.
|
|
188
|
-
4. **Security**
|
|
189
|
-
- Protect your API key. Avoid exposing it in public repositories or client-side code if possible.
|
|
190
|
-
|
|
166
|
+
|
|
167
|
+
**Notes**
|
|
168
|
+
- By default, all elements are functional without customization. Replace slots only if customization is required.
|
|
169
|
+
|
|
170
|
+
- To regenerate the video preview or handle custom actions, use JavaScript to interact with the provided slots or the component's public methods.
|
|
171
|
+
|
|
191
172
|
## License
|
|
192
173
|
|
|
193
174
|
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.
|
|
194
175
|
|
|
195
176
|
## More Information
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
## Quick Reference
|
|
199
|
-
- Install: `npm install biometry-sdk`
|
|
200
|
-
- Consent: `sdk.giveConsent(true, userFullName)` (Required before onboarding/processing)
|
|
201
|
-
- Voice Onboarding: `sdk.enrollVoice(file, userFullName)`
|
|
202
|
-
- Face Onboarding: `sdk.enrollFace(file, userFullName)`
|
|
203
|
-
- Process Video: `sdk.processVideo(file, phrase, userFullName)`
|
|
177
|
+
|
|
178
|
+
For more detailed documentation on the Biometry API, visit the [official documentation](https://developer.biometrysolutions.com/overview/).
|