@sekyro/web 0.1.0-rc.4 → 0.1.0-rc.40

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 (141) hide show
  1. package/CHANGELOG.md +491 -0
  2. package/LICENSE +25 -16
  3. package/README.md +158 -62
  4. package/THIRD-PARTY-NOTICES.txt +154 -0
  5. package/dist/assets.generated-DpkbvoII.d.cts +249 -0
  6. package/dist/assets.generated-DpkbvoII.d.ts +249 -0
  7. package/dist/background-monitor-A7FKJOAG.js +1 -0
  8. package/dist/barcode-detect-C5IOXMKI.js +1 -0
  9. package/dist/camera-trait-DELAK3YN.js +1 -0
  10. package/dist/capture-constraints-CVqpMNGA.d.cts +48 -0
  11. package/dist/capture-constraints-CVqpMNGA.d.ts +48 -0
  12. package/dist/capture-session-doc-DFLSX6BB.js +1 -0
  13. package/dist/{capture-session-v3-uXJr1Wlm.d.ts → capture-session-v3-C-9FB_vX.d.cts} +232 -13
  14. package/dist/{capture-session-v3-DEInCOUg.d.cts → capture-session-v3-DEpGJ_fI.d.ts} +232 -13
  15. package/dist/challenge-frame-YBTLAQ5G.js +1 -0
  16. package/dist/chunk-22AW4NJD.js +1 -0
  17. package/dist/chunk-33KKMPJ5.js +1 -0
  18. package/dist/chunk-3WQJI7UL.js +1 -0
  19. package/dist/chunk-4NO6MQPH.js +1 -0
  20. package/dist/chunk-53POX7U4.js +1 -0
  21. package/dist/chunk-7QZWBDI5.js +1 -0
  22. package/dist/chunk-BD4KIQQD.js +1 -0
  23. package/dist/chunk-BPAGOPYL.js +1 -0
  24. package/dist/chunk-BRLQIJYF.js +1 -0
  25. package/dist/chunk-CJHMFPL6.js +1 -0
  26. package/dist/chunk-CPUECYAJ.js +1 -0
  27. package/dist/chunk-FPXL63KZ.js +1 -0
  28. package/dist/chunk-FSSMUAKC.js +1 -0
  29. package/dist/chunk-FYU7J2DC.js +1 -0
  30. package/dist/chunk-GFJATPUR.js +1 -0
  31. package/dist/chunk-GI3UFGRQ.js +1 -0
  32. package/dist/chunk-JLVZ35QK.js +2 -0
  33. package/dist/chunk-L3TNFMQK.js +1 -0
  34. package/dist/chunk-M3637QGB.js +1 -0
  35. package/dist/chunk-MQHTFHSN.js +1 -0
  36. package/dist/chunk-POIQGEZM.js +1 -0
  37. package/dist/chunk-QB62OPX5.js +1 -0
  38. package/dist/chunk-QZUFICG3.js +1 -0
  39. package/dist/chunk-RI3E7GBN.js +1 -0
  40. package/dist/chunk-SJ5OJ677.js +1 -0
  41. package/dist/chunk-SMKCBUJL.js +1 -0
  42. package/dist/chunk-SX7TUC3V.js +1 -0
  43. package/dist/chunk-TSA6GHUG.js +1 -0
  44. package/dist/chunk-U5TL63CG.js +1 -0
  45. package/dist/chunk-VSLJZ7GH.js +1 -0
  46. package/dist/chunk-VWGKUQ3C.js +1 -0
  47. package/dist/chunk-W357WDNU.js +1 -0
  48. package/dist/chunk-WNBEOK5Q.js +1 -0
  49. package/dist/chunk-Y5GRT27C.js +3 -0
  50. package/dist/chunk-ZVD6VHM2.js +1 -0
  51. package/dist/client/index.cjs +1 -357
  52. package/dist/client/index.d.cts +6 -37
  53. package/dist/client/index.d.ts +6 -37
  54. package/dist/client/index.js +1 -15
  55. package/dist/clip-inspect-DLJXVKV6.js +1 -0
  56. package/dist/core/index.cjs +1 -1634
  57. package/dist/core/index.d.cts +5 -4
  58. package/dist/core/index.d.ts +5 -4
  59. package/dist/core/index.js +1 -139
  60. package/dist/core/ocr/worker.bundle.js +41 -0
  61. package/dist/core/ocr/worker.cjs +41 -0
  62. package/dist/core/ocr/worker.d.cts +97 -0
  63. package/dist/core/ocr/worker.d.ts +97 -0
  64. package/dist/core/ocr/worker.js +40 -0
  65. package/dist/core/v3/detect-worker.cjs +1 -392
  66. package/dist/core/v3/detect-worker.d.cts +1 -1
  67. package/dist/core/v3/detect-worker.d.ts +1 -1
  68. package/dist/core/v3/detect-worker.js +1 -13
  69. package/dist/create-document-capture-4ZOSBL3Y.js +1 -0
  70. package/dist/create-portrait-capture-5VGYZUOK.js +1 -0
  71. package/dist/create-verification-B8c9xBnz.d.ts +3871 -0
  72. package/dist/create-verification-BadlGBh3.d.cts +3871 -0
  73. package/dist/{detect-worker-CKXHlXx9.d.ts → detect-worker-CHqsPJoM.d.cts} +25 -2
  74. package/dist/{detect-worker-CKXHlXx9.d.cts → detect-worker-CHqsPJoM.d.ts} +25 -2
  75. package/dist/detector-scanic-P2RTEQUV.js +1 -0
  76. package/dist/icao-gate-BqXxEAq6.d.cts +610 -0
  77. package/dist/icao-gate-C7D7Lce7.d.ts +610 -0
  78. package/dist/icao-gate-T3BTOKFJ.js +1 -0
  79. package/dist/icao-policy-Bo7TQyTd.d.ts +80 -0
  80. package/dist/icao-policy-CgSI4oFo.d.cts +80 -0
  81. package/dist/icao-tuning-4ETMF53W.js +1 -0
  82. package/dist/index.cjs +3 -2698
  83. package/dist/index.d.cts +138 -5
  84. package/dist/index.d.ts +138 -5
  85. package/dist/index.js +1 -28
  86. package/dist/internal/index.cjs +3 -4228
  87. package/dist/internal/index.d.cts +306 -371
  88. package/dist/internal/index.d.ts +306 -371
  89. package/dist/internal/index.js +1 -647
  90. package/dist/keyframe-rank-YAJLYJYF.js +1 -0
  91. package/dist/landmarker-KB7LVXAU.js +1 -0
  92. package/dist/mrz-band-VYHOTDHY.js +1 -0
  93. package/dist/plan-runner-3BLEJWHF.js +1 -0
  94. package/dist/popup/index.cjs +1 -76
  95. package/dist/popup/index.d.cts +9 -3
  96. package/dist/popup/index.d.ts +9 -3
  97. package/dist/popup/index.js +1 -11
  98. package/dist/print-DCYX3CZD.js +1 -0
  99. package/dist/scanic-ml-stub-KW7IZHUT.js +1 -0
  100. package/dist/segmenter-USLNBX65.js +1 -0
  101. package/dist/types-BAAj6TOZ.d.cts +2230 -0
  102. package/dist/types-BAAj6TOZ.d.ts +2230 -0
  103. package/dist/upload-file-EGXXM6TQ.js +1 -0
  104. package/package.json +30 -11
  105. package/sbom.cdx.json +349 -0
  106. package/dist/capture-constraints-BujkZcfb.d.cts +0 -21
  107. package/dist/capture-constraints-BujkZcfb.d.ts +0 -21
  108. package/dist/chunk-EWRNPKTR.js +0 -1123
  109. package/dist/chunk-EWRNPKTR.js.map +0 -1
  110. package/dist/chunk-MWNFSNMP.js +0 -52
  111. package/dist/chunk-MWNFSNMP.js.map +0 -1
  112. package/dist/chunk-NILNKLK6.js +0 -50
  113. package/dist/chunk-NILNKLK6.js.map +0 -1
  114. package/dist/chunk-NWF46H7K.js +0 -359
  115. package/dist/chunk-NWF46H7K.js.map +0 -1
  116. package/dist/chunk-TBANUT3X.js +0 -885
  117. package/dist/chunk-TBANUT3X.js.map +0 -1
  118. package/dist/chunk-WY6U7AIK.js +0 -193
  119. package/dist/chunk-WY6U7AIK.js.map +0 -1
  120. package/dist/chunk-YVFF4Q4G.js +0 -327
  121. package/dist/chunk-YVFF4Q4G.js.map +0 -1
  122. package/dist/client/index.cjs.map +0 -1
  123. package/dist/client/index.js.map +0 -1
  124. package/dist/core/index.cjs.map +0 -1
  125. package/dist/core/index.js.map +0 -1
  126. package/dist/core/v3/detect-worker.cjs.map +0 -1
  127. package/dist/core/v3/detect-worker.js.map +0 -1
  128. package/dist/create-verification-Ce1y5kJR.d.ts +0 -371
  129. package/dist/create-verification-Dkb2tXuY.d.cts +0 -371
  130. package/dist/detector-scanic-4C6IEW2K.js +0 -787
  131. package/dist/detector-scanic-4C6IEW2K.js.map +0 -1
  132. package/dist/hosted-client-DWzCRYJK.d.cts +0 -421
  133. package/dist/hosted-client-DWzCRYJK.d.ts +0 -421
  134. package/dist/index.cjs.map +0 -1
  135. package/dist/index.js.map +0 -1
  136. package/dist/internal/index.cjs.map +0 -1
  137. package/dist/internal/index.js.map +0 -1
  138. package/dist/popup/index.cjs.map +0 -1
  139. package/dist/popup/index.js.map +0 -1
  140. package/dist/scanic-ml-stub-S2OZ6HEF.js +0 -10
  141. package/dist/scanic-ml-stub-S2OZ6HEF.js.map +0 -1
package/LICENSE CHANGED
@@ -1,20 +1,29 @@
1
- Sekyro SDK — Proprietary License
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 software (the "SDK") is proprietary to Ibtikar Technologies. Use is
6
- permitted only under a Sekyro customer agreement with Ibtikar Technologies, and
7
- only to integrate the customer's own applications with the Sekyro
8
- identity-verification service. For that purpose you may install the SDK
9
- from the public npm registry and run it unmodified.
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
- No other right or license, express or implied, is granted. You may not
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
- THE SDK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- IMPLIED. TO THE EXTENT PERMITTED BY LAW, IBTIKAR TECHNOLOGIES SHALL NOT BE
19
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM THE USE OF THE
20
- SDK, EXCEPT AS PROVIDED IN THE APPLICABLE CUSTOMER AGREEMENT.
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 typed hosted-verification client, and the partner popup embed.
5
- Framework-free; pair it with `@sekyro/react` for a ready-made `<LivenessCapture>`.
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
- // approved | rejected | review | retry | unavailable — for display;
13
- // the verdict that counts is read server-side (sessions.get + webhooks).
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,156 @@ void v.startRegistry();
19
34
  await cap.start();
20
35
  ```
21
36
 
22
- **Read the [Web SDK guide](../../docs/partner/web-sdk.md)** for the full integration:
23
- server-bound NNI, results, webhooks, registered origins, CSP, model assets
24
- (`assetBaseUrl`), reason codes, billing. Hosted-flow embed only? The
25
- [quickstart](../../docs/partner/quickstart.md) covers `openHosted`.
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 registered with Sekyro.
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).
52
+
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:
29
57
 
30
- > Status: `0.1.0-rc.0`, still `private` — the public npm release is wired in a later
31
- > task (Changesets + Trusted Publishing). Sekyro's own hosted page consumes it via a
32
- > `file:` link today. Formerly `@ibtikar/identity-web-sdk` (internal).
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
+ ## Browser check
135
+
136
+ `createVerification` runs a browser check, which proves to Sekyro AI that a real browser runs the
137
+ session. It runs in a hidden 1×1 frame served from `https://verify.sekyro.ai/challenge`
138
+ (`HostedSessionView.challenge.url`), which answers your page only. Its token is bound to the session
139
+ and to your page's origin, and nothing else loads in your page. A page with a Content-Security-Policy
140
+ allows the frame:
141
+
142
+ ```
143
+ frame-src https://verify.sekyro.ai
144
+ ```
145
+
146
+ The check is needed once per session, plus once for every code sent by SMS, WhatsApp or email:
147
+
148
+ - The check starts as soon as the session loads, so it is usually done before the person's first
149
+ step. The session's first submission carries its token. That proves the session for 30 minutes
150
+ on this page and this device, and the steps after it (document sides, the selfie video, retakes)
151
+ need no check.
152
+ - A code send always carries a fresh token. The SDK keeps a check running while a code step is
153
+ ahead.
154
+ - A check gets up to 120 s, since entry-level phones on mobile networks can need well over 30 s. A
155
+ check that failed is retried once on a fresh frame, and a submission waits up to 90 s for a token.
156
+ - Without a token nothing is submitted. When that happens on the selfie video, the result has
157
+ `reasonCode: 'attestation'` and carries `attestationError`. Calling `retry()` on the capture
158
+ handle submits the same video again with a fresh check, so the person does not film again.
159
+
160
+ | `attestationError` | What happened |
161
+ |---|---|
162
+ | `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. |
163
+ | `challenge_script_blocked` | The check's script could not load inside the frame (a network filter on the person's connection). |
164
+ | `challenge_failed` | The check could not clear this browser. |
165
+ | `clock_wrong` | The phone's date and time are wrong. The person sets them to automatic and tries again; `retry()` checks again with the same video. |
166
+ | `timeout` | The check did not finish in 120 s. |
167
+ | `site_key_rejected` | The session and the frame disagree on the key (on our side). |
168
+ | `embedder_opaque` | The SDK runs in a document without an origin (a sandboxed frame or a `data:` page). |
169
+
170
+ A result with `reasonCode: 'attestation'` and no `attestationError` means the server refused the
171
+ token: ask the person to try again (`retry()` keeps the video).
33
172
 
34
173
  ## Entry points
35
174
 
36
175
  | Export | Contents | Public API |
37
176
  |---|---|---|
38
- | `@sekyro/web` | **The partner API** (spec §3.1): `createVerification` (consent → early registry → liveness capture → upload → Turnstile attestation → `liveness` + `face_match` → `result`), `createLivenessCapture` (standalone capture handle), `openHosted` (popup/redirect embed) + the contract types. Surface pinned by `etc/sekyro-web.api.md` (api-extractor) | Yes |
177
+ | `@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
178
  | `@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 — 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 |
179
+ | `@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 |
180
+ | `@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
181
  | `@sekyro/web/client` | Typed client for the hosted session API: `HostedClient`, error codes, check input/view types | Yes |
42
182
  | `@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, Turnstile loader), consumed by Sekyro's hosted page / `@sekyro/react` only. No semver guarantees; may change in any release | No |
183
+ | `@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
184
 
45
185
  Every entry ships ESM + CJS + `.d.ts` (`tsup`). `./core` deliberately does **not**
46
186
  re-export the document scanner (that lives only under `./internal`) nor the worker
47
187
  entry.
48
188
 
49
- ## Calibration pin — do not "improve" `src/core/`
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.
189
+ 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
+