@sekyro/web 0.1.0-rc.3 → 0.1.0-rc.30
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/CHANGELOG.md +427 -0
- package/LICENSE +25 -16
- package/README.md +150 -62
- package/THIRD-PARTY-NOTICES.txt +154 -0
- package/dist/background-monitor-A7FKJOAG.js +1 -0
- package/dist/barcode-detect-C5IOXMKI.js +1 -0
- package/dist/camera-trait-V4UAOPIQ.js +1 -0
- package/dist/capture-constraints-CVqpMNGA.d.cts +48 -0
- package/dist/capture-constraints-CVqpMNGA.d.ts +48 -0
- package/dist/capture-session-doc-ESEZJBQM.js +1 -0
- package/dist/{capture-session-v3-CvIfcwST.d.ts → capture-session-v3-CTQL6eFd.d.cts} +259 -13
- package/dist/{capture-session-v3-COIO_F2w.d.cts → capture-session-v3-DHlOE6cS.d.ts} +259 -13
- package/dist/challenge-frame-YAQJ5YMB.js +1 -0
- package/dist/chunk-2LDOXGY3.js +1 -0
- package/dist/chunk-33KKMPJ5.js +1 -0
- package/dist/chunk-3LMJ4335.js +1 -0
- package/dist/chunk-53POX7U4.js +1 -0
- package/dist/chunk-7252SFZ6.js +1 -0
- package/dist/chunk-7QZWBDI5.js +1 -0
- package/dist/chunk-A7QFTU6M.js +1 -0
- package/dist/chunk-CJHMFPL6.js +1 -0
- package/dist/chunk-CMXN4SOZ.js +1 -0
- package/dist/chunk-CPUECYAJ.js +1 -0
- package/dist/chunk-DFTCAWMP.js +1 -0
- package/dist/chunk-DK5YPBDQ.js +1 -0
- package/dist/chunk-FPXL63KZ.js +1 -0
- package/dist/chunk-FSSMUAKC.js +1 -0
- package/dist/chunk-G6LKLN4U.js +1 -0
- package/dist/chunk-GFJATPUR.js +1 -0
- package/dist/chunk-GI3UFGRQ.js +1 -0
- package/dist/chunk-JLVZ35QK.js +2 -0
- package/dist/chunk-KA43AAM7.js +1 -0
- package/dist/chunk-KXFHVAYQ.js +1 -0
- package/dist/chunk-ODI4A5K4.js +1 -0
- package/dist/chunk-OEQJ62CC.js +3 -0
- package/dist/chunk-POIQGEZM.js +1 -0
- package/dist/chunk-RI3E7GBN.js +1 -0
- package/dist/chunk-S5BUCUZ4.js +1 -0
- package/dist/chunk-SLKRT74K.js +1 -0
- package/dist/chunk-SMKCBUJL.js +1 -0
- package/dist/chunk-SX7TUC3V.js +1 -0
- package/dist/chunk-TSA6GHUG.js +1 -0
- package/dist/chunk-UTPUHE4J.js +1 -0
- package/dist/chunk-VVUQ4PFU.js +1 -0
- package/dist/chunk-VWGKUQ3C.js +1 -0
- package/dist/chunk-ZKF2XMNX.js +1 -0
- package/dist/client/index.cjs +1 -357
- package/dist/client/index.d.cts +6 -37
- package/dist/client/index.d.ts +6 -37
- package/dist/client/index.js +1 -15
- package/dist/clip-inspect-DLJXVKV6.js +1 -0
- package/dist/core/index.cjs +1 -1606
- package/dist/core/index.d.cts +5 -4
- package/dist/core/index.d.ts +5 -4
- package/dist/core/index.js +1 -139
- package/dist/core/ocr/worker.bundle.js +42 -0
- package/dist/core/ocr/worker.cjs +42 -0
- package/dist/core/ocr/worker.d.cts +84 -0
- package/dist/core/ocr/worker.d.ts +84 -0
- package/dist/core/ocr/worker.js +41 -0
- package/dist/core/v3/detect-worker.cjs +1 -392
- package/dist/core/v3/detect-worker.d.cts +1 -1
- package/dist/core/v3/detect-worker.d.ts +1 -1
- package/dist/core/v3/detect-worker.js +1 -13
- package/dist/create-document-capture-V7XCRRDV.js +1 -0
- package/dist/create-portrait-capture-5VGYZUOK.js +1 -0
- package/dist/create-verification-CGBe2yLE.d.cts +3719 -0
- package/dist/create-verification-aoY2QoRx.d.ts +3719 -0
- package/dist/{detect-worker-CKXHlXx9.d.ts → detect-worker-CHqsPJoM.d.cts} +25 -2
- package/dist/{detect-worker-CKXHlXx9.d.cts → detect-worker-CHqsPJoM.d.ts} +25 -2
- package/dist/detector-scanic-SE3CL55N.js +1 -0
- package/dist/icao-gate-DveU9Cr8.d.ts +573 -0
- package/dist/icao-gate-T3BTOKFJ.js +1 -0
- package/dist/icao-gate-xyWB7dz2.d.cts +573 -0
- package/dist/icao-policy-BWu1JLgi.d.cts +80 -0
- package/dist/icao-policy-OOEQDG9_.d.ts +80 -0
- package/dist/icao-tuning-4ETMF53W.js +1 -0
- package/dist/index.cjs +3 -2649
- package/dist/index.d.cts +138 -5
- package/dist/index.d.ts +138 -5
- package/dist/index.js +1 -28
- package/dist/internal/index.cjs +3 -4179
- package/dist/internal/index.d.cts +390 -371
- package/dist/internal/index.d.ts +390 -371
- package/dist/internal/index.js +1 -647
- package/dist/keyframe-rank-YAJLYJYF.js +1 -0
- package/dist/landmarker-KB7LVXAU.js +1 -0
- package/dist/mrz-band-VYHOTDHY.js +1 -0
- package/dist/plan-runner-IXCKR4DB.js +1 -0
- package/dist/popup/index.cjs +1 -76
- package/dist/popup/index.d.cts +9 -3
- package/dist/popup/index.d.ts +9 -3
- package/dist/popup/index.js +1 -11
- package/dist/print-SEWS3VHQ.js +1 -0
- package/dist/scanic-ml-stub-KW7IZHUT.js +1 -0
- package/dist/segmenter-USLNBX65.js +1 -0
- package/dist/types-CezFEXzl.d.cts +2103 -0
- package/dist/types-CezFEXzl.d.ts +2103 -0
- package/dist/upload-file-EGXXM6TQ.js +1 -0
- package/package.json +30 -11
- package/sbom.cdx.json +349 -0
- package/dist/capture-constraints-BujkZcfb.d.cts +0 -21
- package/dist/capture-constraints-BujkZcfb.d.ts +0 -21
- package/dist/chunk-7TC6TOZ4.js +0 -1095
- package/dist/chunk-7TC6TOZ4.js.map +0 -1
- package/dist/chunk-FIXX2AXC.js +0 -864
- package/dist/chunk-FIXX2AXC.js.map +0 -1
- package/dist/chunk-MWNFSNMP.js +0 -52
- package/dist/chunk-MWNFSNMP.js.map +0 -1
- package/dist/chunk-NILNKLK6.js +0 -50
- package/dist/chunk-NILNKLK6.js.map +0 -1
- package/dist/chunk-NWF46H7K.js +0 -359
- package/dist/chunk-NWF46H7K.js.map +0 -1
- package/dist/chunk-WY6U7AIK.js +0 -193
- package/dist/chunk-WY6U7AIK.js.map +0 -1
- package/dist/chunk-YVFF4Q4G.js +0 -327
- package/dist/chunk-YVFF4Q4G.js.map +0 -1
- package/dist/client/index.cjs.map +0 -1
- package/dist/client/index.js.map +0 -1
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/v3/detect-worker.cjs.map +0 -1
- package/dist/core/v3/detect-worker.js.map +0 -1
- package/dist/create-verification-CP18eq1Q.d.cts +0 -348
- package/dist/create-verification-CswF2As-.d.ts +0 -348
- package/dist/detector-scanic-4C6IEW2K.js +0 -787
- package/dist/detector-scanic-4C6IEW2K.js.map +0 -1
- package/dist/hosted-client-BpvBqu9f.d.cts +0 -408
- package/dist/hosted-client-BpvBqu9f.d.ts +0 -408
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/internal/index.cjs.map +0 -1
- package/dist/internal/index.js.map +0 -1
- package/dist/popup/index.cjs.map +0 -1
- package/dist/popup/index.js.map +0 -1
- package/dist/scanic-ml-stub-S2OZ6HEF.js +0 -10
- package/dist/scanic-ml-stub-S2OZ6HEF.js.map +0 -1
package/LICENSE
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
|
-
Sekyro SDK
|
|
1
|
+
Sekyro AI SDK License (proprietary)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2026 Ibtikar Technologies. All rights reserved.
|
|
3
|
+
Copyright (c) 2026 Ibtikar Technologies, Inc. All rights reserved.
|
|
4
4
|
|
|
5
|
-
This
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
This SDK is proprietary software of Ibtikar Technologies, Inc., licensed
|
|
6
|
+
only under the Sekyro AI SDK License:
|
|
7
|
+
https://sekyro.ai/en/legal/sdk-license
|
|
8
|
+
(in French: https://sekyro.ai/fr/legal/sdk-license,
|
|
9
|
+
in Arabic: https://sekyro.ai/ar/legal/sdk-license).
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
modify, reverse-engineer, redistribute, sublicense, resell or create
|
|
13
|
-
derivative works of the SDK, nor remove or alter this notice. The source
|
|
14
|
-
code is published for transparency (build provenance, security review); its
|
|
15
|
-
publication grants no additional rights.
|
|
11
|
+
In short, and subject to the full license:
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
- You may use the SDK only with a Sekyro AI account, a customer agreement
|
|
14
|
+
with Ibtikar Technologies, Inc. and valid API keys, to integrate the
|
|
15
|
+
Sekyro AI services into your own applications. You may distribute it to
|
|
16
|
+
your end users only as embedded in those applications.
|
|
17
|
+
- You may not use it with another identity verification provider, modify it
|
|
18
|
+
beyond the configuration and theming it exposes, reverse engineer,
|
|
19
|
+
decompile or disassemble it (except where the law expressly allows it),
|
|
20
|
+
circumvent its security, attestation, license checks or usage metering,
|
|
21
|
+
or distribute or sublicense it on its own.
|
|
22
|
+
- Open-source components keep their own licenses. See the third-party
|
|
23
|
+
notices shipped with this SDK.
|
|
24
|
+
- The SDK is provided "as is", without warranty, except as your customer
|
|
25
|
+
agreement provides. The license is governed by the laws of the State of
|
|
26
|
+
Delaware, USA. If this license and your customer agreement conflict,
|
|
27
|
+
the customer agreement prevails.
|
|
28
|
+
|
|
29
|
+
Questions: contact@sekyro.ai
|
package/README.md
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
# @sekyro/web
|
|
2
2
|
|
|
3
|
-
Browser SDK for [Sekyro](https://sekyro.ai) identity verification: liveness capture
|
|
4
|
-
(v3 engine), the
|
|
5
|
-
|
|
3
|
+
Browser SDK for [Sekyro AI](https://sekyro.ai) identity verification: liveness capture
|
|
4
|
+
(v3 engine), the step runner that renders any Sekyro flow headless
|
|
5
|
+
(`verification.run()`), the document scanner, the typed hosted-verification client
|
|
6
|
+
and the hosted-flow popup embed. Framework-free; pair it with `@sekyro/react` for
|
|
7
|
+
ready-made `<LivenessCapture>` and `<SekyroVerification>` components.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install @sekyro/web@next
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Use of the SDK is governed by the [Sekyro AI SDK License](https://sekyro.ai/legal/sdk-license)
|
|
14
|
+
(summarised in `LICENSE`) and your Sekyro AI customer agreement.
|
|
15
|
+
|
|
16
|
+
Sample: [`web-vanilla`](https://github.com/IBTIKAR-Technologies/sekyro-examples/tree/main/web-vanilla), every step of a flow with plain DOM.
|
|
6
17
|
|
|
7
18
|
```ts
|
|
8
19
|
import { createVerification } from "@sekyro/web";
|
|
9
20
|
|
|
10
21
|
const v = createVerification({ clientToken, locale: "ar" }); // token from your server (@sekyro/node)
|
|
11
|
-
v.on("result", ({ status, reason }) => {
|
|
12
|
-
//
|
|
13
|
-
//
|
|
22
|
+
v.on("result", ({ status, reason, reasonCode }) => {
|
|
23
|
+
// verified | not_verified | review | retry | unavailable: for display.
|
|
24
|
+
// not_verified says why in `reason` (rejected, inconclusive, unavailable, abandoned,
|
|
25
|
+
// not_opened, policy, cancelled, superseded) and the detail in `reasonCode`.
|
|
26
|
+
// The verdict that counts is read server-side (sessions.get + webhooks).
|
|
27
|
+
// In the Sandbox, the result also carries `sandbox: { simulated: true, reason }`
|
|
28
|
+
// when the session ran on test data because no enrolled tester ran it.
|
|
14
29
|
});
|
|
15
30
|
const cap = v.liveness({ video }); // your <video playsinline muted>
|
|
16
31
|
cap.on("gate", ({ progress, hint }) => {/* ring 0..1, hint code */});
|
|
@@ -19,75 +34,148 @@ void v.startRegistry();
|
|
|
19
34
|
await cap.start();
|
|
20
35
|
```
|
|
21
36
|
|
|
22
|
-
**Read the [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
37
|
+
**Read the [web SDK guide](https://docs.sekyro.ai/en/web/embedded-sdk)** for the full integration:
|
|
38
|
+
flows and session creation, every step of a flow headless (`verification.run()`),
|
|
39
|
+
results, webhooks, allowed web origins, CSP, model assets (`assetBaseUrl`), reason
|
|
40
|
+
codes, billing. Hosted-flow embed only? See *Hosted popup* below and the
|
|
41
|
+
[quickstart](https://docs.sekyro.ai/en/getting-started/quickstart).
|
|
26
42
|
|
|
27
43
|
Requirements: a secure context (HTTPS or `localhost`), self-hosted detector assets
|
|
28
|
-
under `/models-v3` (or `assetBaseUrl`), and your page origin
|
|
44
|
+
under `/models-v3` (or `assetBaseUrl`), and your page origin in the app's allowed web
|
|
45
|
+
origins (dashboard: app page → Integration → Platforms → Web).
|
|
46
|
+
|
|
47
|
+
Privacy: the SDK collects a device fingerprint for fraud prevention (browser, hardware
|
|
48
|
+
and camera traits, hashed in the browser before they are sent, plus the Chromium phone
|
|
49
|
+
model and operating system version). No permission is asked, the fingerprinting library makes no network
|
|
50
|
+
request of its own, and nothing is stored for it. Name it in your privacy notice; see
|
|
51
|
+
*Device fingerprinting* in the [web SDK guide](https://docs.sekyro.ai/en/web/embedded-sdk).
|
|
29
52
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
53
|
+
## Preload & camera probes
|
|
54
|
+
|
|
55
|
+
Warm the face detector before the user taps Start (on the step before the
|
|
56
|
+
capture, or at mount), and read the camera permission for your "get ready" UI:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import { createLivenessCapture, getLivenessAssetsStatus, hasMultipleCameras,
|
|
60
|
+
preloadLivenessAssets, subscribeCameraPermission, subscribeLivenessAssets } from "@sekyro/web";
|
|
61
|
+
|
|
62
|
+
void preloadLivenessAssets({ assetBaseUrl: "/models-v3", idle: true }); // never rejects
|
|
63
|
+
const gateStart = (s: string) => (startBtn.disabled = s === "loading");
|
|
64
|
+
gateStart(getLivenessAssetsStatus("/models-v3")); // subscribe does not emit the current status
|
|
65
|
+
subscribeLivenessAssets(gateStart, "/models-v3");
|
|
66
|
+
subscribeCameraPermission((p) => showCameraRow(p)); // granted|prompt|denied|unknown
|
|
67
|
+
const showFacingChoice = await hasMultipleCameras();
|
|
68
|
+
|
|
69
|
+
const cap = createLivenessCapture({ video, assetBaseUrl: "/models-v3" });
|
|
70
|
+
await cap.start({ facing: "user" }); // reuses the warm detector automatically
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
- `preloadLivenessAssets` is idempotent per `assetBaseUrl` and resolves the settled
|
|
74
|
+
status: `'ready'`, `'failed'` (call it again to retry), or `'idle'`: nothing was
|
|
75
|
+
preloaded (SSR, no camera API, Data Saver with `respectSaveData`), so start
|
|
76
|
+
normally. `idle: true` defers the load to browser idle time; a capture that
|
|
77
|
+
starts meanwhile begins it at once.
|
|
78
|
+
- The preload warms the blaze (MediaPipe) tier with a generous deadline. Every
|
|
79
|
+
capture created afterwards with the same `assetBaseUrl` uses it without any extra
|
|
80
|
+
wiring, and destroying a capture never frees it; call
|
|
81
|
+
`releaseLivenessAssets(assetBaseUrl)` when the user leaves the flow (never while a
|
|
82
|
+
capture is mounted). Without a preload the capture loads the detector itself.
|
|
83
|
+
- `getLivenessAssetsStatus` / `subscribeLivenessAssets` follow the
|
|
84
|
+
`useSyncExternalStore` contract (no emit on subscribe). `subscribeCameraPermission`
|
|
85
|
+
emits the current state first, then every change; `queryCameraPermission` is the
|
|
86
|
+
one-shot read. Both report `'unknown'` where the Permissions API cannot tell.
|
|
87
|
+
- The session decides who films the face (`HostedSessionView.capture.mode`, a flow
|
|
88
|
+
setting), read from `handle.captureMode`, and the mode sets the camera. A **self**
|
|
89
|
+
capture (the default, and every `createLivenessCapture()` not bound to a session)
|
|
90
|
+
uses the front camera only; an **assisted** capture (an agent films the person) the
|
|
91
|
+
back camera only. A `facing` asking for the other camera is ignored and
|
|
92
|
+
`switchCamera()` returns `false`, with a console warning; `handle.facingMode`
|
|
93
|
+
reports the camera the stream actually uses.
|
|
94
|
+
- On a phone the camera must be held upright: a landscape frame holds the gate
|
|
95
|
+
(hint `upright`), and turning the phone sideways while the clip records drops that
|
|
96
|
+
clip and goes back to positioning. Tablets and desktop webcams are not affected.
|
|
97
|
+
- `keepScreenAwake` (capture option, default `true`) holds a Screen Wake Lock while
|
|
98
|
+
the camera is live (`starting` / `gating` / `recording`), released on `captured`,
|
|
99
|
+
`error` and `destroy()`, re-taken on `retry()` and when the page is visible again.
|
|
100
|
+
Best effort: unsupported or refused requests never affect the capture. In an
|
|
101
|
+
iframe, allow it: `<iframe allow="camera; screen-wake-lock; ch-ua-model; ch-ua-platform-version">`
|
|
102
|
+
(the two `ch-ua-*` entries let the SDK read the phone model on Android Chrome). Pass `false` to
|
|
103
|
+
never request it.
|
|
104
|
+
|
|
105
|
+
## Hosted popup
|
|
106
|
+
|
|
107
|
+
`openHosted(hostedUrl, { mode, onEvent })` opens the hosted flow (the session's
|
|
108
|
+
`hostedUrl`) in a popup (`mode: "popup"`) or navigates this tab to it
|
|
109
|
+
(`mode: "redirect"`). A blocked popup returns `{ error: "popup_blocked" }`: fall back
|
|
110
|
+
to `mode: "redirect"` yourself.
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
import { openHosted } from "@sekyro/web";
|
|
114
|
+
|
|
115
|
+
const popup = openHosted(hostedUrl, {
|
|
116
|
+
mode: "popup",
|
|
117
|
+
onEvent: ({ event, sessionId }) => {
|
|
118
|
+
// session.verified | session.not_verified | session.review_pending | session.cancelled
|
|
119
|
+
// A hint only: read the session on your server (sessions.get) before deciding.
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
if ("error" in popup) window.location.assign(hostedUrl);
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Events carry `{ source: "sekyro", version: 1, event, sessionId }` and nothing else (no
|
|
126
|
+
scores, no personal data). The hosted page posts them only to the **first** allowed web
|
|
127
|
+
origin of the app (dashboard: app page → Integration → Platforms → Web), so open the
|
|
128
|
+
popup from a page on that origin. The listener accepts a message only from that popup
|
|
129
|
+
window and the hosted page's origin. Events can repeat (a reload after a terminal state posts
|
|
130
|
+
it again; closing or reloading mid-flow posts `session.cancelled`), so confirm the
|
|
131
|
+
outcome server-side. Keep one popup per page: call `close()` on the previous handle
|
|
132
|
+
before opening another.
|
|
133
|
+
|
|
134
|
+
## Attestation
|
|
135
|
+
|
|
136
|
+
Before it submits the liveness capture, `createVerification` obtains an attestation token from the
|
|
137
|
+
Sekyro security check frame: a hidden 1×1 frame served from `https://verify.sekyro.ai/challenge`
|
|
138
|
+
(`HostedSessionView.challenge.url`) that runs the challenge and answers this page only. The token is
|
|
139
|
+
bound to the session and to your page's origin. Nothing from Cloudflare loads in your page, so
|
|
140
|
+
`challenges.cloudflare.com` is no longer needed in your Content-Security-Policy. A page with a CSP
|
|
141
|
+
allows the frame:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
frame-src https://verify.sekyro.ai
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The SDK starts the challenge when consent is recorded and again when the camera starts if that one
|
|
148
|
+
failed, so the token is usually ready when the uploads finish. A challenge gets up to 120 s, since
|
|
149
|
+
entry-level phones on mobile networks can need well over 30 s; a frame that failed is retried once
|
|
150
|
+
on a fresh frame, and after the uploads the SDK waits up to 120 s for a token. Without a token the
|
|
151
|
+
capture is not submitted: the result has `reasonCode: 'attestation'` and carries `attestationError`:
|
|
152
|
+
|
|
153
|
+
| `attestationError` | What happened |
|
|
154
|
+
|---|---|
|
|
155
|
+
| `challenge_frame_blocked` | The frame did not load: add `frame-src https://verify.sekyro.ai` to your CSP (the SDK also prints this once in the console), or a browser extension or proxy blocked it. |
|
|
156
|
+
| `challenge_script_blocked` | The challenge script could not load inside the frame (a network filter between the browser and Cloudflare). |
|
|
157
|
+
| `challenge_failed` | The challenge could not clear this browser. |
|
|
158
|
+
| `timeout` | The challenge did not finish in 120 s. |
|
|
159
|
+
| `site_key_rejected` | The session and the frame disagree on the key (on our side). |
|
|
160
|
+
| `embedder_opaque` | The SDK runs in a document without an origin (a sandboxed frame or a `data:` page). |
|
|
161
|
+
|
|
162
|
+
A result with `reasonCode: 'attestation'` and no `attestationError` means the server refused the
|
|
163
|
+
token: ask the person to reload and try again.
|
|
33
164
|
|
|
34
165
|
## Entry points
|
|
35
166
|
|
|
36
167
|
| Export | Contents | Public API |
|
|
37
168
|
|---|---|---|
|
|
38
|
-
| `@sekyro/web` | **The partner API
|
|
169
|
+
| `@sekyro/web` | **The partner API**: `createVerification` (consent → early registry → liveness capture → upload → attestation (the security check frame) → `liveness` + `face_match` → `result`, and `run()`, the step runner for every step of the session's flow), `createLivenessCapture` (standalone capture handle), `createDocumentCapture` (standalone document scanner), `openHosted` (popup/redirect embed) and the contract types. Surface pinned by `etc/sekyro-web.api.md` (api-extractor) | Yes |
|
|
39
170
|
| `@sekyro/web/core` | Framework-free capture: `CaptureSessionV3`, `createDetector`, `FaceGateV3`, frame quality, device profile, `media`/`keyframe`/`messages`/`ClipRecorder` (calibration-pinned v1 port), camera constraints | Yes |
|
|
40
|
-
| `@sekyro/web/core/v3/detect-worker` | Standalone detection-worker entry
|
|
171
|
+
| `@sekyro/web/core/v3/detect-worker` | Standalone detection-worker entry: construct with `new Worker(new URL('@sekyro/web/core/v3/detect-worker', import.meta.url))` so its worker-scope auto-install never rides a main-thread bundle | Yes |
|
|
172
|
+
| `@sekyro/web/core/ocr/worker` (+ `worker.bundle.js`) | The live MRZ reader's Web Worker: pass `new URL('@sekyro/web/core/ocr/worker', import.meta.url)` as `liveMrz.workerUrl`, or copy the self-contained `dist/core/ocr/worker.bundle.js` to your static folder | Yes |
|
|
41
173
|
| `@sekyro/web/client` | Typed client for the hosted session API: `HostedClient`, error codes, check input/view types | Yes |
|
|
42
174
|
| `@sekyro/web/popup` | Partner-facing popup/redirect embed (`open`, `SekyroEvent`) | Yes |
|
|
43
|
-
| `@sekyro/web/internal` | **Not public.** Document scanner (doc catalog, `DocGateV1`, MRZ band, frame analysis, feedback aggregator, `CaptureSessionDoc`) + gate-debug geometry constants + the verification internals (`createVerificationInternal` / `createLivenessCaptureInternal` seams, `runLivenessFlow`, `runSubmission`, result mapping,
|
|
175
|
+
| `@sekyro/web/internal` | **Not public.** Document scanner (doc catalog, `DocGateV1`, MRZ band, frame analysis, feedback aggregator, `CaptureSessionDoc`) + gate-debug geometry constants + the verification internals (`createVerificationInternal` / `createLivenessCaptureInternal` seams, `runLivenessFlow`, `runSubmission`, result mapping, the security check frame client `executeChallenge`), consumed by Sekyro AI's hosted page / `@sekyro/react` only. No semver guarantees; may change in any release | No |
|
|
44
176
|
|
|
45
177
|
Every entry ships ESM + CJS + `.d.ts` (`tsup`). `./core` deliberately does **not**
|
|
46
178
|
re-export the document scanner (that lives only under `./internal`) nor the worker
|
|
47
179
|
entry.
|
|
48
180
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
`src/core/media.ts`, `keyframe.ts`, and `messages.ts` are **byte-identical ports** of
|
|
52
|
-
v1's `kyc-ibtikar/lib/faceCaptureV2/*`. The only allowed delta is the 3-line port
|
|
53
|
-
header block (two comment lines + one blank separator line) prepended to each file.
|
|
54
|
-
`src/core/clip-recorder.ts` is the de-hooked `useClipRecorder` with identical
|
|
55
|
-
constants and behavior (`CLIP_MS=2500`, `TIMESLICE_MS=1000`, `STOP_GRACE_MS=1500`,
|
|
56
|
-
`VIDEO_BPS=2_500_000`, `MAX_CLIP_BYTES=8MiB`, mime ladder, guarded double construction,
|
|
57
|
-
incremental cap enforcement, stop-grace finalize, single-settle, stop-all-tracks).
|
|
58
|
-
|
|
59
|
-
The FAS-CLIP liveness model was calibrated on clips produced by exactly this v1
|
|
60
|
-
pipeline (spec §6 / risk 1). Any drift silently invalidates the calibration.
|
|
61
|
-
`test/port-parity.test.ts` enforces this in two layers: a sha256 checksum pin against
|
|
62
|
-
the committed `test/port-manifest.json` that runs **everywhere, CI included**, and a
|
|
63
|
-
byte-level comparison against the real v1 sources that runs on every dev machine with
|
|
64
|
-
the `kyc-ibtikar/` checkout alongside (that layer self-skips in CI, where the
|
|
65
|
-
gitignored v1 checkout is absent — and it also verifies the manifest itself matches
|
|
66
|
-
header + v1 bytes, so the manifest cannot drift). Do NOT edit `src/core/` without a
|
|
67
|
-
calibration re-validation; if a re-validated change ever lands, regenerate the
|
|
68
|
-
manifest hashes alongside it.
|
|
69
|
-
|
|
70
|
-
The parity test resolves the v1 checkout as `../../kyc-ibtikar/lib/faceCaptureV2`
|
|
71
|
-
from the package root, so this package must stay **two levels below the repo root**
|
|
72
|
-
(`packages/sekyro-web`).
|
|
73
|
-
|
|
74
|
-
Note: v1's `upload.ts` is intentionally NOT ported — uploading is the typed client's
|
|
75
|
-
job in v2 (`HostedClient.uploadAndSubmit`).
|
|
76
|
-
|
|
77
|
-
## Develop
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
npm ci
|
|
81
|
-
npm run build # tsup → dist/ (ESM + CJS + d.ts per entry)
|
|
82
|
-
npm test # vitest (jsdom)
|
|
83
|
-
npm run typecheck # tsc --noEmit
|
|
84
|
-
npm run api:check # api-extractor: fails when the ROOT public surface drifts from etc/sekyro-web.api.md
|
|
85
|
-
npm run api:report # regenerate etc/sekyro-web.api.md after an intentional, reviewed API change
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
The api-extractor report covers the root `.` entry only (the partner contract); the
|
|
89
|
-
subpath entries (`./core`, `./client`, `./popup`) are not reported. `npm run build` must
|
|
90
|
-
precede `api:check` (it reads `dist/index.d.ts`).
|
|
91
|
-
|
|
92
|
-
Standalone package: own lockfile, no workspace wiring. `identity-hosted` consumes it
|
|
93
|
-
via `"@sekyro/web": "file:../packages/sekyro-web"` and needs `dist/` built first.
|
|
181
|
+
When the service is busy (503 `server_busy` or `request_timeout`), `HostedClient` retries a call that is safe to repeat once, after the `Retry-After` the service sends (2 seconds without one). When the model service is unavailable (503 `inference_unavailable`), a submission retries up to three times, after the `Retry-After` (10 seconds without one), and emits `busy` with the wait. Both waits are capped at 20 seconds and spread by ±25 % (at least 0.5 seconds) so clients do not all come back at once.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
@sekyro/web: third-party notices
|
|
2
|
+
================================
|
|
3
|
+
|
|
4
|
+
@sekyro/web is licensed under the Sekyro AI SDK License (see LICENSE). The
|
|
5
|
+
dist/ files of this package also contain the third-party components below,
|
|
6
|
+
which remain under their own licenses.
|
|
7
|
+
|
|
8
|
+
1. scanic (document edge detection, classical pipeline)
|
|
9
|
+
Bundled in dist/ (the document detector chunks).
|
|
10
|
+
Copyright (c) 2025 marquaye
|
|
11
|
+
License: MIT License (full text in section A).
|
|
12
|
+
|
|
13
|
+
2. Emscripten runtime and JavaScript glue, version 4.0.23
|
|
14
|
+
Bundled in the OCR worker (dist/core/ocr/worker.js, worker.cjs and
|
|
15
|
+
worker.bundle.js) as the loader of the on-device OCR engine.
|
|
16
|
+
Copyright (c) 2010-2014 Emscripten authors, see AUTHORS file.
|
|
17
|
+
License: MIT License or University of Illinois/NCSA Open Source License,
|
|
18
|
+
at your choice (full text in section B).
|
|
19
|
+
|
|
20
|
+
The OCR engine binary (sekyro-ocr.wasm) and its models are not part of this
|
|
21
|
+
package: they are downloaded at runtime, and their notices are published with
|
|
22
|
+
them.
|
|
23
|
+
|
|
24
|
+
-------------------------------------------------------------------------------
|
|
25
|
+
A. scanic: MIT License
|
|
26
|
+
-------------------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
MIT License
|
|
29
|
+
|
|
30
|
+
Copyright (c) 2025 marquaye
|
|
31
|
+
|
|
32
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
33
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
34
|
+
in the Software without restriction, including without limitation the rights
|
|
35
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
36
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
37
|
+
furnished to do so, subject to the following conditions:
|
|
38
|
+
|
|
39
|
+
The above copyright notice and this permission notice shall be included in all
|
|
40
|
+
copies or substantial portions of the Software.
|
|
41
|
+
|
|
42
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
43
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
44
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
45
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
46
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
47
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
48
|
+
SOFTWARE.
|
|
49
|
+
-------------------------------------------------------------------------------
|
|
50
|
+
B. Emscripten: MIT License or University of Illinois/NCSA Open Source License
|
|
51
|
+
-------------------------------------------------------------------------------
|
|
52
|
+
|
|
53
|
+
Emscripten is available under 2 licenses, the MIT license and the
|
|
54
|
+
University of Illinois/NCSA Open Source License.
|
|
55
|
+
|
|
56
|
+
Both are permissive open source licenses, with little if any
|
|
57
|
+
practical difference between them.
|
|
58
|
+
|
|
59
|
+
The reason for offering both is that (1) the MIT license is
|
|
60
|
+
well-known, while (2) the University of Illinois/NCSA Open Source
|
|
61
|
+
License allows Emscripten's code to be integrated upstream into
|
|
62
|
+
LLVM, which uses that license, should the opportunity arise.
|
|
63
|
+
|
|
64
|
+
The full text of both licenses follows.
|
|
65
|
+
|
|
66
|
+
==============================================================================
|
|
67
|
+
|
|
68
|
+
Copyright (c) 2010-2014 Emscripten authors, see AUTHORS file.
|
|
69
|
+
|
|
70
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
71
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
72
|
+
in the Software without restriction, including without limitation the rights
|
|
73
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
74
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
75
|
+
furnished to do so, subject to the following conditions:
|
|
76
|
+
|
|
77
|
+
The above copyright notice and this permission notice shall be included in
|
|
78
|
+
all copies or substantial portions of the Software.
|
|
79
|
+
|
|
80
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
81
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
82
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
83
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
84
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
85
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
86
|
+
THE SOFTWARE.
|
|
87
|
+
|
|
88
|
+
==============================================================================
|
|
89
|
+
|
|
90
|
+
Copyright (c) 2010-2014 Emscripten authors, see AUTHORS file.
|
|
91
|
+
All rights reserved.
|
|
92
|
+
|
|
93
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
94
|
+
copy of this software and associated documentation files (the
|
|
95
|
+
"Software"), to deal with the Software without restriction, including
|
|
96
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
97
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
98
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
99
|
+
the following conditions:
|
|
100
|
+
|
|
101
|
+
Redistributions of source code must retain the above copyright
|
|
102
|
+
notice, this list of conditions and the following disclaimers.
|
|
103
|
+
|
|
104
|
+
Redistributions in binary form must reproduce the above
|
|
105
|
+
copyright notice, this list of conditions and the following disclaimers
|
|
106
|
+
in the documentation and/or other materials provided with the
|
|
107
|
+
distribution.
|
|
108
|
+
|
|
109
|
+
Neither the names of Mozilla,
|
|
110
|
+
nor the names of its contributors may be used to endorse
|
|
111
|
+
or promote products derived from this Software without specific prior
|
|
112
|
+
written permission.
|
|
113
|
+
|
|
114
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
115
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
116
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
117
|
+
IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR
|
|
118
|
+
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
119
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
120
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
|
|
121
|
+
|
|
122
|
+
==============================================================================
|
|
123
|
+
|
|
124
|
+
This program uses portions of Node.js source code located in src/library_path.js,
|
|
125
|
+
in accordance with the terms of the MIT license. Node's license follows:
|
|
126
|
+
|
|
127
|
+
"""
|
|
128
|
+
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
|
129
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
130
|
+
of this software and associated documentation files (the "Software"), to
|
|
131
|
+
deal in the Software without restriction, including without limitation the
|
|
132
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
133
|
+
sell copies of the Software, and to permit persons to whom the Software is
|
|
134
|
+
furnished to do so, subject to the following conditions:
|
|
135
|
+
|
|
136
|
+
The above copyright notice and this permission notice shall be included in
|
|
137
|
+
all copies or substantial portions of the Software.
|
|
138
|
+
|
|
139
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
140
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
141
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
142
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
143
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
144
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
145
|
+
IN THE SOFTWARE.
|
|
146
|
+
"""
|
|
147
|
+
|
|
148
|
+
The musl libc project is bundled in this repo, and it has the MIT license, see
|
|
149
|
+
system/lib/libc/musl/COPYRIGHT
|
|
150
|
+
|
|
151
|
+
The third_party/ subdirectory contains code with other licenses. None of it is
|
|
152
|
+
used by default, but certain options use it (e.g., the optional closure compiler
|
|
153
|
+
flag will run closure compiler from third_party/).
|
|
154
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-RI3E7GBN.js";import"./chunk-GI3UFGRQ.js";export{a as createBackgroundMonitor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c}from"./chunk-JLVZ35QK.js";var a={name:"zxing_reader.wasm",bytes:928265,sha256:"5bb3ce7aeedc314e24afb873bebcf366a01c27a00b21cdf2fa98b819c005c16b",sha12:"5bb3ce7aeedc"};var i=["PDF417","QRCode","DataMatrix","Aztec"];function f(r){return`${r.replace(/\/+$/,"")}/${a.sha12}/${a.name}`}async function d(r,o=fetch){let t=await o(f(r),{cache:"force-cache",credentials:"omit"});if(!t.ok)throw new Error("barcode wasm download");let e=await t.arrayBuffer();if(e.byteLength!==a.bytes||await c(e)!==a.sha256)throw new Error("barcode wasm integrity");return e}async function h(r,o=fetch){let t=await d(r,o),e=await import("zxing-wasm/reader");return await e.prepareZXingModule({overrides:{wasmBinary:t},fireImmediately:!0}),async s=>(await e.readBarcodes(s,{formats:[...i],tryHarder:!0,maxNumberOfSymbols:1})).some(n=>n.isValid)}export{f as barcodeWasmUrl,d as fetchBarcodeWasm,h as loadBarcodeDetect};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d}from"./chunk-2LDOXGY3.js";export{a as bounded,c as cameraHash,b as hex16,d as noteCameraTrait};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** getUserMedia constraint tier — 720p-class on every device since 2026-07-06.
|
|
2
|
+
* The v2 FAS-CLIP liveness head loses its texture cues below ~720p: the SAME
|
|
3
|
+
* genuine clip scores heads 0.0001 at 720x1280 vs 0.355 at the old 480x360
|
|
4
|
+
* mobile tier, which pushed real users into review (first observed live on
|
|
5
|
+
* staging 2026-07-06; falsified on corpus clips the same day). Dimensions are
|
|
6
|
+
* sensor-relative (landscape); mobile browsers deliver portrait via rotation
|
|
7
|
+
* metadata, which the liveness service's decoder applies (cv2
|
|
8
|
+
* ORIENTATION_AUTO). `isMobile` is kept for call-site compat and future
|
|
9
|
+
* divergence — both tiers are 720p today. Bitrate pairs with VIDEO_BPS in
|
|
10
|
+
* clip-recorder.ts (2.5 Mbps). */
|
|
11
|
+
declare function buildCaptureConstraints(isMobile: boolean, facingMode: "user" | "environment"): MediaStreamConstraints;
|
|
12
|
+
/** The kind of device the browser runs on (spec 2026-10-28 §4.2). */
|
|
13
|
+
type FormFactor = "phone" | "tablet" | "desktop";
|
|
14
|
+
/** A touch device whose shorter screen side is below this (CSS px) is a phone; at or above it, a tablet. */
|
|
15
|
+
declare const PHONE_MAX_SHORT_SIDE = 600;
|
|
16
|
+
/**
|
|
17
|
+
* Phone, tablet or desktop:
|
|
18
|
+
* - phone: an iPhone / iPod user agent, an Android user agent with `Mobile`, a legacy mobile user agent, or a touch
|
|
19
|
+
* device with a coarse primary pointer whose shorter screen side is under {@link PHONE_MAX_SHORT_SIDE} CSS px;
|
|
20
|
+
* - tablet: iPadOS (an iPad user agent, or the desktop `Macintosh` one with touch points), Android without `Mobile`,
|
|
21
|
+
* and other touch devices with a coarse primary pointer (a Linux user agent: an Android phone in "desktop site"
|
|
22
|
+
* mode sends one);
|
|
23
|
+
* - not a desktop whenever UA-CH (`navigator.userAgentData`) says `mobile` or an Android / iOS / iPadOS platform (an
|
|
24
|
+
* Android phone in "desktop site" mode sends a Windows user agent): a phone or tablet by its screen side;
|
|
25
|
+
* - desktop: everything else, Windows and ChromeOS touch devices included (spec 2026-11-06 §9 Q1: the liveness band
|
|
26
|
+
* is calibrated on phones, and the server classifies their requests as desktops). The window width plays no part:
|
|
27
|
+
* a narrow desktop window is still a desktop.
|
|
28
|
+
* SSR-safe (`desktop` without window / navigator).
|
|
29
|
+
*/
|
|
30
|
+
declare function detectFormFactor(): FormFactor;
|
|
31
|
+
/**
|
|
32
|
+
* Whether this browser runs on a phone or tablet ({@link detectFormFactor} is not `desktop`): the capture channel,
|
|
33
|
+
* `mobile_required` and the hand-over use it. The upright guard is phones only.
|
|
34
|
+
*/
|
|
35
|
+
declare function detectIsMobile(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The facing the live video track of `stream` reports (`getSettings().facingMode`), or `null` when the track does not
|
|
38
|
+
* say (most desktop webcams) or reports something else (`left` / `right`). Never throws.
|
|
39
|
+
*/
|
|
40
|
+
declare function trackFacingMode(stream: MediaStream | null | undefined): "user" | "environment" | null;
|
|
41
|
+
/** Gate radius as a fraction of the guidance circle (v1 L501: circleSize × 0.45). */
|
|
42
|
+
declare const CIRCLE_RADIUS_FACTOR = 0.45;
|
|
43
|
+
/** `inCircle` tolerance as a fraction of the gate radius (v1 L508: r × 0.9). */
|
|
44
|
+
declare const IN_CIRCLE_FACTOR = 0.9;
|
|
45
|
+
/** `centered` tolerance as a fraction of the gate radius (v1 L509: r × 0.4). */
|
|
46
|
+
declare const CENTERED_FACTOR = 0.4;
|
|
47
|
+
|
|
48
|
+
export { CENTERED_FACTOR as C, type FormFactor as F, IN_CIRCLE_FACTOR as I, PHONE_MAX_SHORT_SIDE as P, CIRCLE_RADIUS_FACTOR as a, buildCaptureConstraints as b, detectIsMobile as c, detectFormFactor as d, trackFacingMode as t };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** getUserMedia constraint tier — 720p-class on every device since 2026-07-06.
|
|
2
|
+
* The v2 FAS-CLIP liveness head loses its texture cues below ~720p: the SAME
|
|
3
|
+
* genuine clip scores heads 0.0001 at 720x1280 vs 0.355 at the old 480x360
|
|
4
|
+
* mobile tier, which pushed real users into review (first observed live on
|
|
5
|
+
* staging 2026-07-06; falsified on corpus clips the same day). Dimensions are
|
|
6
|
+
* sensor-relative (landscape); mobile browsers deliver portrait via rotation
|
|
7
|
+
* metadata, which the liveness service's decoder applies (cv2
|
|
8
|
+
* ORIENTATION_AUTO). `isMobile` is kept for call-site compat and future
|
|
9
|
+
* divergence — both tiers are 720p today. Bitrate pairs with VIDEO_BPS in
|
|
10
|
+
* clip-recorder.ts (2.5 Mbps). */
|
|
11
|
+
declare function buildCaptureConstraints(isMobile: boolean, facingMode: "user" | "environment"): MediaStreamConstraints;
|
|
12
|
+
/** The kind of device the browser runs on (spec 2026-10-28 §4.2). */
|
|
13
|
+
type FormFactor = "phone" | "tablet" | "desktop";
|
|
14
|
+
/** A touch device whose shorter screen side is below this (CSS px) is a phone; at or above it, a tablet. */
|
|
15
|
+
declare const PHONE_MAX_SHORT_SIDE = 600;
|
|
16
|
+
/**
|
|
17
|
+
* Phone, tablet or desktop:
|
|
18
|
+
* - phone: an iPhone / iPod user agent, an Android user agent with `Mobile`, a legacy mobile user agent, or a touch
|
|
19
|
+
* device with a coarse primary pointer whose shorter screen side is under {@link PHONE_MAX_SHORT_SIDE} CSS px;
|
|
20
|
+
* - tablet: iPadOS (an iPad user agent, or the desktop `Macintosh` one with touch points), Android without `Mobile`,
|
|
21
|
+
* and other touch devices with a coarse primary pointer (a Linux user agent: an Android phone in "desktop site"
|
|
22
|
+
* mode sends one);
|
|
23
|
+
* - not a desktop whenever UA-CH (`navigator.userAgentData`) says `mobile` or an Android / iOS / iPadOS platform (an
|
|
24
|
+
* Android phone in "desktop site" mode sends a Windows user agent): a phone or tablet by its screen side;
|
|
25
|
+
* - desktop: everything else, Windows and ChromeOS touch devices included (spec 2026-11-06 §9 Q1: the liveness band
|
|
26
|
+
* is calibrated on phones, and the server classifies their requests as desktops). The window width plays no part:
|
|
27
|
+
* a narrow desktop window is still a desktop.
|
|
28
|
+
* SSR-safe (`desktop` without window / navigator).
|
|
29
|
+
*/
|
|
30
|
+
declare function detectFormFactor(): FormFactor;
|
|
31
|
+
/**
|
|
32
|
+
* Whether this browser runs on a phone or tablet ({@link detectFormFactor} is not `desktop`): the capture channel,
|
|
33
|
+
* `mobile_required` and the hand-over use it. The upright guard is phones only.
|
|
34
|
+
*/
|
|
35
|
+
declare function detectIsMobile(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The facing the live video track of `stream` reports (`getSettings().facingMode`), or `null` when the track does not
|
|
38
|
+
* say (most desktop webcams) or reports something else (`left` / `right`). Never throws.
|
|
39
|
+
*/
|
|
40
|
+
declare function trackFacingMode(stream: MediaStream | null | undefined): "user" | "environment" | null;
|
|
41
|
+
/** Gate radius as a fraction of the guidance circle (v1 L501: circleSize × 0.45). */
|
|
42
|
+
declare const CIRCLE_RADIUS_FACTOR = 0.45;
|
|
43
|
+
/** `inCircle` tolerance as a fraction of the gate radius (v1 L508: r × 0.9). */
|
|
44
|
+
declare const IN_CIRCLE_FACTOR = 0.9;
|
|
45
|
+
/** `centered` tolerance as a fraction of the gate radius (v1 L509: r × 0.4). */
|
|
46
|
+
declare const CENTERED_FACTOR = 0.4;
|
|
47
|
+
|
|
48
|
+
export { CENTERED_FACTOR as C, type FormFactor as F, IN_CIRCLE_FACTOR as I, PHONE_MAX_SHORT_SIDE as P, CIRCLE_RADIUS_FACTOR as a, buildCaptureConstraints as b, detectIsMobile as c, detectFormFactor as d, trackFacingMode as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as b,B as c,C as d,D as e,E as f,F as g,G as h,H as i,I as j,J as k,z as a}from"./chunk-3LMJ4335.js";import"./chunk-G6LKLN4U.js";import"./chunk-SMKCBUJL.js";import"./chunk-KXFHVAYQ.js";import"./chunk-VVUQ4PFU.js";import"./chunk-POIQGEZM.js";import"./chunk-CPUECYAJ.js";import"./chunk-FPXL63KZ.js";import"./chunk-A7QFTU6M.js";import"./chunk-DK5YPBDQ.js";export{k as CAPTURE_CANDIDATE_SPACING_MS,j as CAPTURE_EXTRA_CANDIDATES,h as CaptureSessionDoc,c as DOC_BLACK_FRAME_LUMA,d as DOC_BLACK_FRAME_TICKS,e as DOC_CADENCE_HZ,b as DOC_FIRST_FRAME_MS,f as DOC_SHUTTER_DEFAULTS,i as passportBandOf,g as resolveDocShutterTuning,a as warmDocDetector};
|