@regulaforensics/vp-frontend-face-components 1.0.0 → 1.1.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 +11 -16
- package/dist/main.js +1 -1
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -46,8 +46,8 @@ import './node_modules/@regulaforensics/vp-frontend-face-components/dist/main.js
|
|
|
46
46
|
|
|
47
47
|
In ```index.html``` connect ```index.js``` and add the name of the component you want to use. Available components:
|
|
48
48
|
|
|
49
|
-
1. ```<face-capture
|
|
50
|
-
1. ```<face-liveness
|
|
49
|
+
1. ```<face-capture></face-capture>``` - for create a face snapshot;
|
|
50
|
+
1. ```<face-liveness></face-liveness>``` - for liveness verification.
|
|
51
51
|
|
|
52
52
|
Example:
|
|
53
53
|
|
|
@@ -59,7 +59,7 @@ Example:
|
|
|
59
59
|
<title>My app</title>
|
|
60
60
|
</head>
|
|
61
61
|
<body>
|
|
62
|
-
<face-capture
|
|
62
|
+
<face-capture></face-capture>
|
|
63
63
|
<script type="module" src="index.js"></script>
|
|
64
64
|
</body>
|
|
65
65
|
</html>
|
|
@@ -73,7 +73,7 @@ Connect the script in your ```.html``` file. CDN link: ```unpkg.com/:package@:ve
|
|
|
73
73
|
Example:
|
|
74
74
|
|
|
75
75
|
```html
|
|
76
|
-
<script src="https://unpkg.com/@regulaforensics/vp-frontend-face-components@
|
|
76
|
+
<script src="https://unpkg.com/@regulaforensics/vp-frontend-face-components@1.1.0/dist/main.js"></script>
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
Add the name of the component to the html, as in the example above.
|
|
@@ -83,13 +83,13 @@ Add the name of the component to the html, as in the example above.
|
|
|
83
83
|
|
|
84
84
|
You can subscribe to component events. In cases of successful and unsuccessful work, the following events will be triggered:
|
|
85
85
|
|
|
86
|
-
For the ```face-capture
|
|
87
|
-
For the ```face-liveness
|
|
86
|
+
For the ```face-capture``` component - ```face-capture```
|
|
87
|
+
For the ```face-liveness``` component - ```face-liveness```
|
|
88
88
|
|
|
89
89
|
Example:
|
|
90
90
|
|
|
91
91
|
```javascript
|
|
92
|
-
const component = document.getElementsByTagName('face-capture
|
|
92
|
+
const component = document.getElementsByTagName('face-capture')[0];
|
|
93
93
|
|
|
94
94
|
component.addEventListener('face-capture', () => alert('Event!'));
|
|
95
95
|
```
|
|
@@ -102,7 +102,7 @@ You can get the response of the component in the ```detail``` field of the event
|
|
|
102
102
|
Example:
|
|
103
103
|
|
|
104
104
|
```javascript
|
|
105
|
-
const component = document.getElementsByTagName('face-capture
|
|
105
|
+
const component = document.getElementsByTagName('face-capture')[0];
|
|
106
106
|
|
|
107
107
|
function listener(event) {
|
|
108
108
|
if (event.detail) {
|
|
@@ -117,23 +117,18 @@ component.addEventListener('face-capture', listener);
|
|
|
117
117
|
<a name="attributes"></a>
|
|
118
118
|
## Component attributes
|
|
119
119
|
|
|
120
|
-
### face-capture
|
|
120
|
+
### face-capture
|
|
121
121
|
|
|
122
122
|
| Attribute | Info | Default value | Values |
|
|
123
123
|
|:----------|:-----|:-------------:|:------:|
|
|
124
124
|
| **locale** | the language of the component | ```en``` | ```en```, ```ru``` |
|
|
125
|
-
| **start-scale** | frame scale multiplier | ```1``` | ```number > 0``` |
|
|
126
|
-
| **oval-offset** | offset of the frame from the center along the Y axis (works only on mobile devices) | ```0``` | ```any number``` |
|
|
127
125
|
|
|
128
|
-
### face-liveness
|
|
126
|
+
### face-liveness
|
|
129
127
|
|
|
130
128
|
| Attribute | Info | Default value | Values |
|
|
131
129
|
|:----------|:-----|:-------------:|:------:|
|
|
132
130
|
| **locale** | the language of the component | ```en``` | ```en```, ```ru``` |
|
|
133
|
-
| **url** | backend url | ```https://
|
|
134
|
-
| **start-scale** | start frame scale multiplier | ```1``` | ```number > 0``` |
|
|
135
|
-
| **end-scale** | second frame scale multiplier | ```1.35``` | ```number > 0``` |
|
|
136
|
-
| **oval-offset** | offset of the frame from the center along the Y axis (works only on mobile devices) | ```0``` | ```any number``` |
|
|
131
|
+
| **url** | backend url | ```https://faceapi.regulaforensics.com/``` | any url |
|
|
137
132
|
|
|
138
133
|
<a name="examples"></a>
|
|
139
134
|
## Examples
|