@realeyes/verifeye-sdk 1.1.1 → 1.2.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 +28 -0
- package/dist/{faceDetectionService-D37MewxK.js → faceDetectionService-CohHJWWF.js} +6 -6
- package/dist/index-wthhhCHI.js +5163 -0
- package/dist/index.d.ts +113 -0
- package/dist/index.js +6 -4
- package/dist/livenessCheckDialog-DkmMUvjs.js +152 -0
- package/package.json +1 -1
- package/dist/index-CSa4aG_X.js +0 -2293
- package/dist/livenessCheckDialog-DymTrMxB.js +0 -82
package/README.md
CHANGED
|
@@ -29,6 +29,34 @@ The SDK handles the browser-side capture and the calls to the VerifEye Service.
|
|
|
29
29
|
npm install @realeyes/verifeye-sdk
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
## Localization
|
|
33
|
+
|
|
34
|
+
The SDK's built-in UI text — dialog titles, buttons, hints, etc. — is driven by a locale file and can be translated or overridden per key.
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
<VerifyVerifier
|
|
38
|
+
// ...session props
|
|
39
|
+
lang="en"
|
|
40
|
+
langOverrides={{
|
|
41
|
+
consent_title: "One quick check",
|
|
42
|
+
consent_continue_button: "Continue",
|
|
43
|
+
}}
|
|
44
|
+
/>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
- **`lang`** — language tag, defaults to `"en"`. Case-insensitive, and `_` is accepted for `-`. An unsupported value logs a warning and falls back to `"en"` rather than throwing.
|
|
48
|
+
- **`langOverrides`** — a flat map of per-key replacements applied on top of `lang`. Only the keys you pass are replaced. The `VerifyTextKey` type is exported, so keys autocomplete and typos fail to compile.
|
|
49
|
+
|
|
50
|
+
### Supported languages
|
|
51
|
+
|
|
52
|
+
`en` `bg` `cs` `da` `de` `el` `es` `et` `fi` `fr` `hu` `id` `it` `ja` `ko` `lt` `lv` `nb` `nl` `pl` `pt-BR` `pt-PT` `ro` `ru` `sk` `sl` `sv` `tr` `uk` `zh-Hans` `zh-Hant`
|
|
53
|
+
|
|
54
|
+
Also exported as `SUPPORTED_LANGUAGES`. Tags resolve in this order: exact match, then a known alias, then the base language. So `"de-AT"` → `de`, `"zh-TW"` → `zh-Hant`, `"zh-CN"` → `zh-Hans`, `"pt"` → `pt-PT`, `"no"` → `nb`. Portuguese and Chinese are shipped only as variants — a bare `"pt"` or `"zh"` resolves to the alias above rather than failing.
|
|
55
|
+
|
|
56
|
+
Some strings carry a small markup subset so a whole sentence stays translatable as one unit: `<b>…</b>` for emphasis, `<br/>` for a line break, and `{name}` slots (e.g. `{privacyPolicy}` in the consent notice, `{seconds}` in the timeout countdown). Anything else is rendered as literal text — override values are never interpreted as HTML.
|
|
57
|
+
|
|
58
|
+
Keys prefixed `liveness_` translate the liveness check UI shown during the liveness step.
|
|
59
|
+
|
|
32
60
|
## Privacy & data handling
|
|
33
61
|
|
|
34
62
|
This SDK captures camera images and processes facial/biometric data to perform verification. When integrating it, you are responsible for obtaining appropriate user consent and complying with applicable privacy and biometric-data regulations in your jurisdiction. See the [Realeyes Privacy Policy](https://realeyes.ai/privacy-policy/).
|
|
@@ -8,7 +8,7 @@ class f {
|
|
|
8
8
|
if (!(this.isInitialized && this.faceDetector))
|
|
9
9
|
try {
|
|
10
10
|
const e = await d.forVisionTasks(
|
|
11
|
-
"https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision
|
|
11
|
+
"https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision/wasm"
|
|
12
12
|
);
|
|
13
13
|
this.faceDetector = await m.createFromOptions(e, {
|
|
14
14
|
baseOptions: {
|
|
@@ -59,18 +59,18 @@ class f {
|
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
this.canvas.width = e.videoWidth, this.canvas.height = e.videoHeight, this.ctx.drawImage(e, 0, 0);
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
const n =
|
|
62
|
+
const h = this.faceDetector.detect(e);
|
|
63
|
+
if (h.detections.length > 0) {
|
|
64
|
+
const n = h.detections[0].categories[0].score, l = this.compressCanvasToJpeg(this.canvas);
|
|
65
65
|
if (n >= r) {
|
|
66
66
|
cancelAnimationFrame(i), a({
|
|
67
67
|
hasFace: !0,
|
|
68
|
-
base64Image:
|
|
68
|
+
base64Image: l,
|
|
69
69
|
confidence: n
|
|
70
70
|
});
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
(!t || n > t.confidence) && (t = { image:
|
|
73
|
+
(!t || n > t.confidence) && (t = { image: l, confidence: n });
|
|
74
74
|
}
|
|
75
75
|
i = requestAnimationFrame(o);
|
|
76
76
|
};
|