@sekyro/react 0.0.0-stage → 0.1.0-rc.1
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 +12 -0
- package/LICENSE +20 -0
- package/README.md +109 -2
- package/dist/index.cjs +901 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +242 -0
- package/dist/index.d.ts +242 -0
- package/dist/index.js +880 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +400 -0
- package/package.json +86 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# @sekyro/react
|
|
2
|
+
|
|
3
|
+
## 0.1.0-rc.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 466d3e1: Initial release line of the Sekyro SDKs: `@sekyro/web` (browser liveness capture, hosted-verification client and popup embed), `@sekyro/react` (the themeable, accessible `<LivenessCapture />` component over `@sekyro/web`, ar/fr/en, RTL-safe) and `@sekyro/node` (server-side sessions client and signed-webhook verification, zero runtime dependencies). Pre-releases ship as `0.1.0-rc.N` under the `next` dist-tag from `develop`; the first stable `0.1.0` ships from `main`. All three packages are proprietary (`UNLICENSED` — see each package's LICENSE).
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [466d3e1]
|
|
12
|
+
- @sekyro/web@0.1.0-rc.1
|
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Sekyro SDK — Proprietary License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ibtikar Technologies. All rights reserved.
|
|
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.
|
|
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.
|
|
16
|
+
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,3 +1,110 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @sekyro/react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React component for [Sekyro](https://sekyro.ai) liveness capture: the hosted page's
|
|
4
|
+
capture UI (`<LivenessCapture />`), extracted onto the public `@sekyro/web` API with
|
|
5
|
+
no private design-system or framework dependency. Themeable through CSS variables,
|
|
6
|
+
ar / fr / en built in, RTL-safe (logical CSS only), WCAG AAA defaults.
|
|
7
|
+
|
|
8
|
+
> Status: `0.1.0-rc.0`, still `private` — the public npm release is wired in a later
|
|
9
|
+
> task (Changesets + Trusted Publishing). Sekyro's own hosted page dogfoods it via a
|
|
10
|
+
> `file:` link.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install @sekyro/react @sekyro/web react react-dom
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Peer dependencies: `react >=18.2`, `react-dom >=18.2`, `@sekyro/web ^0.1.0-rc.0`.
|
|
19
|
+
No other runtime dependencies.
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { createVerification } from "@sekyro/web";
|
|
25
|
+
import { LivenessCapture, SekyroThemeProvider } from "@sekyro/react";
|
|
26
|
+
import "@sekyro/react/styles.css";
|
|
27
|
+
|
|
28
|
+
const verification = createVerification({ clientToken, locale: "ar" });
|
|
29
|
+
|
|
30
|
+
<SekyroThemeProvider theme={{ colors: { brand: "#0c7a3d", ring: "#0c7a3d" }, radius: "8px" }}>
|
|
31
|
+
<LivenessCapture
|
|
32
|
+
verification={verification}
|
|
33
|
+
locale="ar"
|
|
34
|
+
onResult={(r) => console.log(r.status, r.reason)}
|
|
35
|
+
/>
|
|
36
|
+
</SekyroThemeProvider>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- **Verification mode** (`verification` set): the handle comes from
|
|
40
|
+
`verification.liveness()`; after `captured` the SDK uploads, attests and submits the
|
|
41
|
+
`liveness` + `face_match` checks and the verdict arrives via `onResult`
|
|
42
|
+
(`approved | rejected | review | retry | unavailable`). On `retry` the SDK re-arms
|
|
43
|
+
the camera by itself (`rearm: 'auto'`) while the component shows the reason, the
|
|
44
|
+
retry coaching and the remaining attempts; with `createVerification({ rearm: 'manual' })`
|
|
45
|
+
the component instead offers a focused "Start a new attempt" button.
|
|
46
|
+
- The still freezes the stage the instant recording stops (the handle's `frozen`
|
|
47
|
+
event) — before the clip finalizes; the "camera off" pill only appears once the
|
|
48
|
+
tracks are actually stopped (`captured`). A LOW device profile (`profile` event)
|
|
49
|
+
drops the decorative animations.
|
|
50
|
+
- **Capture-only mode** (no `verification`): `createLivenessCapture()`; the component
|
|
51
|
+
emits `onCaptured(artifacts)` (keyframe + clip blobs) and offers a retake. You own
|
|
52
|
+
the upload.
|
|
53
|
+
|
|
54
|
+
### Props
|
|
55
|
+
|
|
56
|
+
| Prop | Type | Notes |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| `verification?` | `Verification` | From `createVerification()`. Absent → capture-only. |
|
|
59
|
+
| `locale` | `"ar" \| "fr" \| "en"` | Built-in dictionary. |
|
|
60
|
+
| `dir?` | `"ltr" \| "rtl"` | Defaults to `rtl` for `ar`. |
|
|
61
|
+
| `strings?` | `Partial<Strings>` | Per-key overrides on top of the built-ins. |
|
|
62
|
+
| `slots?` | `{ header, footer, intro(start), stageOverlay(videoRef), voicePrompt(hint, text, key), errorPanel(err, retry) }` | `intro` replaces the built-in intro (permission rows, loaders, settings); `stageOverlay` renders inside the stage box above the ring (overlays, debug HUDs); `voicePrompt` renders in the stage's start corner (audio / TTS — `key` selects the clip); `errorPanel` replaces the camera-error notice. |
|
|
63
|
+
| `autoStart?` | `boolean` | Start the camera instead of showing the intro — once, the first time it is `true` while idle (flip it when your own preconditions are met). |
|
|
64
|
+
| `onStateChange?` | `(state) => void` | Every capture-state transition, for host chrome (hide a description while the stage is live, telemetry). |
|
|
65
|
+
| `onCaptured?` | `(artifacts) => void` | Fires before any upload. |
|
|
66
|
+
| `onResult?` | `(result) => void` | Verification mode only. |
|
|
67
|
+
| `onError?` | `(error) => void` | Camera / engine failure (`permission \| notfound \| inuse \| insecure \| unsupported \| generic`). |
|
|
68
|
+
| `assetBaseUrl?` | `string` | Detector assets base (default `/models-v3`). |
|
|
69
|
+
|
|
70
|
+
### Theme
|
|
71
|
+
|
|
72
|
+
`SekyroThemeProvider` writes CSS variables on a `.sekyro-root` wrapper:
|
|
73
|
+
`--sekyro-color-{brand,brand-fg,fg,fg-muted,bg,surface,ring,danger,success,warning}`,
|
|
74
|
+
`--sekyro-radius`, `--sekyro-font`. Without a provider the stylesheet's `:root`
|
|
75
|
+
defaults apply (`DEFAULT_THEME`). You can also set the variables yourself on any
|
|
76
|
+
ancestor.
|
|
77
|
+
|
|
78
|
+
Contrast rules the component relies on (checked for the default theme in
|
|
79
|
+
`test/contrast.test.ts`):
|
|
80
|
+
|
|
81
|
+
- `fg` on `surface` / `bg`, `brandFg` on `brand`: text → 7:1 (AAA);
|
|
82
|
+
- `surface` on `fg`: the stage scrim is `fg` and the guidance line is `surface`, so the
|
|
83
|
+
on-camera text inherits the same ratio;
|
|
84
|
+
- `fgMuted` on `surface`: secondary text only (security note, checking hint) — AA
|
|
85
|
+
(4.5:1) is the floor, AAA recommended;
|
|
86
|
+
- `brand`, `ring`, `danger`, `warning`, `success` on `surface`: non-text UI → 3:1.
|
|
87
|
+
|
|
88
|
+
### Strings
|
|
89
|
+
|
|
90
|
+
Keys follow the hosted message catalog (`capture.*`, `fcv2.err.*`, `fcv3.*`,
|
|
91
|
+
`reasons.*`, `errors.attestation_invalid`, `errors.network_error`, `common.retry`).
|
|
92
|
+
`hintStringKey(hint)` maps a `GateHint` code to its guidance key;
|
|
93
|
+
`reasonStringKey(reason)` maps a result reason to its copy key.
|
|
94
|
+
|
|
95
|
+
### Accessibility
|
|
96
|
+
|
|
97
|
+
- One always-mounted `aria-live="polite"` guidance line is the sole announcement
|
|
98
|
+
channel during capture; failures use `role="alert"`.
|
|
99
|
+
- Every interactive element is ≥ 48 px with a 3 px `--sekyro-color-ring` focus ring.
|
|
100
|
+
- `prefers-reduced-motion` disables all stage animations; the `sekyro-capture-reduce`
|
|
101
|
+
class forces the same for low-end devices.
|
|
102
|
+
- Inline SVG icons only; no emoji; logical CSS properties only (`scripts/check-css.mjs`
|
|
103
|
+
fails the build on any physical `left`/`right`).
|
|
104
|
+
|
|
105
|
+
## Scripts
|
|
106
|
+
|
|
107
|
+
`npm test` (CSS lint + vitest: behaviour, jest-axe per state × ar/fr, contrast, RTL
|
|
108
|
+
snapshot) · `npm run typecheck` · `npm run build` (tsup ESM + CJS + d.ts +
|
|
109
|
+
`dist/styles.css`) · `npm run api:check` (api-extractor against
|
|
110
|
+
`etc/sekyro-react.api.md`).
|