@sekyro/react-native 0.1.0-rc.1 → 0.1.0-rc.11

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 CHANGED
@@ -1,5 +1,65 @@
1
1
  # @sekyro/react-native
2
2
 
3
+ ## 0.1.0-rc.11
4
+
5
+ ### Patch Changes
6
+
7
+ - 6f9b59c: Pins the native SDKs 0.1.0-rc.10 (Android `ai.sekyro:sekyro-bom`, iOS `sekyro-ios-dist`): the phone step offers the countries your flow accepts and follows the server's rules for each one (length, grouping, national prefix), the Mauritanian default is gone, and the new retryable reasons `otp_number_invalid` and `otp_number_not_mobile` have their own message.
8
+
9
+ ## 0.1.0-rc.10
10
+
11
+ ### Patch Changes
12
+
13
+ - 0a5440e: Pins the native SDKs 0.1.0-rc.9 (Android `ai.sekyro:sekyro-bom`, iOS `sekyro-ios-dist`): status colours are standard on every partner page (the theme's `danger`, `success` and `warning` are ignored), and on Android the theme's `border` and `fontFamily` now reach the flow.
14
+
15
+ ## 0.1.0-rc.9
16
+
17
+ ### Patch Changes
18
+
19
+ - 244e4e1: Status colours are standard. `theme.colors.danger`, `success` and `warning` are deprecated and ignored (one warning in development builds); they are no longer passed to the native SDKs and will be removed in 1.0.
20
+
21
+ ## 0.1.0-rc.8
22
+
23
+ ### Patch Changes
24
+
25
+ - a23b2fb: Pins the native SDKs 0.1.0-rc.8 (Android `ai.sekyro:sekyro-bom`, iOS `sekyro-ios-dist`): verification copy without long dashes in every language, and the new `insufficient_balance` reason (a prepaid organization's balance cannot pay for a step, such as a phone code) says the method is not available right now and offers another way when the flow has one.
26
+
27
+ ## 0.1.0-rc.7
28
+
29
+ ### Patch Changes
30
+
31
+ - 745ca13: Pins the native SDKs 0.1.0-rc.7 (Android `ai.sekyro:sekyro-bom`, iOS `sekyro-ios-dist`). Person data: the native SDKs read the hosted view's new ID number field names with the former ones as fallback, send `x-sekyro-sdk`, post the typed number as `idNumber`, and show the same screen for either name of a renamed reason.
32
+
33
+ ## 0.1.0-rc.6
34
+
35
+ ### Patch Changes
36
+
37
+ - ce9875f: Pins the native SDKs 0.1.0-rc.6 (Android `ai.sekyro:sekyro-bom`, iOS `sekyro-ios-dist`). Adds the Age check (selfie) processing step on Android and iOS and renders any future server step as processing. Deploy this version before turning on the age check for your organization.
38
+
39
+ ## 0.1.0-rc.5
40
+
41
+ ### Patch Changes
42
+
43
+ - 0ef2f1a: Pins the native SDKs 0.1.0-rc.5 (Android `ai.sekyro:sekyro-bom`, iOS `sekyro-ios-dist`). Android: the document step lists only the countries the session accepts and skips the country step when there is only one, as on the web and iOS.
44
+
45
+ ## 0.1.0-rc.4
46
+
47
+ ### Patch Changes
48
+
49
+ - e914cee: Pins the native SDKs 0.1.0-rc.4 (Android `ai.sekyro:sekyro-bom`, iOS `sekyro-ios-dist`). Android: the liveness clip falls back through simpler video formats and every encoder on the phone before failing, a clip that is too large or a phone that cannot record shows its own message instead of "camera unavailable", and a failed liveness capture is reported to the backend (no image, no personal data). Both platforms: es, pt and de for Human sessions, the Human session copy and attribution link, the no-camera path with a permission-specific message when camera access is refused, the step-up face match latch, and the daily code limit notice.
50
+
51
+ ## 0.1.0-rc.3
52
+
53
+ ### Patch Changes
54
+
55
+ - b474b43: Pins the native SDKs 0.1.0-rc.3 (Android `ai.sekyro:sekyro-bom`, iOS `sekyro-ios-dist`): the session's capture mode decides the camera (front only for a self capture, the back camera with a flip control for an assisted one), the liveness screen is portrait-locked on phones with a hold-upright guard, and the capture reports `mode`, `facingMode` and `formFactor`.
56
+
57
+ ## 0.1.0-rc.2
58
+
59
+ ### Minor Changes
60
+
61
+ - dd1af94: An expired session now resolves `{ status: 'finished', sessionId, displayStatus: 'expired' }`, as on the native Android and iOS SDKs, instead of `{ status: 'failed', code: 'session_expired' }`. `SekyroDisplayStatus` gains `'expired'`. On Android, `theme.colors.border` and `theme.fontFamily` (a `res/font` resource name or a system family) are now applied (they were validated and ignored); this needs the native Android SDK release after `0.1.0-rc.2`. **Migration:** code that handled `code: 'session_expired'` on `failed` should handle `displayStatus: 'expired'` on `finished`; TypeScript code that switches exhaustively over `SekyroDisplayStatus` must add an `'expired'` branch.
62
+
3
63
  ## 0.1.0-rc.1
4
64
 
5
65
  ### Minor Changes
@@ -30,7 +30,8 @@ internal object ConfigMapper {
30
30
  val radius = if (m.hasKey("radius") && !m.isNull("radius")) m.getDouble("radius") else null
31
31
  require(radius == null || radius in 0.0..32.0) { "invalid_config" }
32
32
  val darkMode = m.str("darkMode")
33
- val hasTheme = colors != null || radius != null || darkMode != null
33
+ val fontFamily = m.str("fontFamily")
34
+ val hasTheme = colors != null || radius != null || darkMode != null || fontFamily != null
34
35
  val theme = if (!hasTheme) null else SekyroTheme(
35
36
  brand = color(colors, "brand"), brandFg = color(colors, "brandFg"),
36
37
  radiusDp = radius?.toInt(),
@@ -38,9 +39,10 @@ internal object ConfigMapper {
38
39
  "light" -> SekyroTheme.DarkMode.LIGHT; "dark" -> SekyroTheme.DarkMode.DARK; else -> SekyroTheme.DarkMode.SYSTEM
39
40
  },
40
41
  bg = color(colors, "bg"), surface = color(colors, "surface"), fg = color(colors, "fg"),
41
- fgMuted = color(colors, "fgMuted"), danger = color(colors, "danger"),
42
- success = color(colors, "success"), warning = color(colors, "warning"),
43
- ).also { color(colors, "border") } // `border` (validated) and `fontFamily`: not themable on Android in 0.1 (README).
42
+ fgMuted = color(colors, "fgMuted"),
43
+ // danger / success / warning are not read: status colours are standard (deprecated no-ops, removed in 1.0).
44
+ border = color(colors, "border"), fontFamily = fontFamily,
45
+ )
44
46
  val strings = if (m.hasKey("strings") && !m.isNull("strings")) {
45
47
  m.getMap("strings")?.toHashMap().orEmpty().mapNotNull { (k, v) -> (v as? String)?.let { k to it } }.toMap()
46
48
  } else emptyMap()
@@ -48,7 +50,9 @@ internal object ConfigMapper {
48
50
  clientToken = token,
49
51
  apiOrigin = m.str("apiOrigin"),
50
52
  locale = when (m.str("locale")) {
51
- "ar" -> SekyroLocale.AR; "fr" -> SekyroLocale.FR; "en" -> SekyroLocale.EN; else -> null
53
+ "ar" -> SekyroLocale.AR; "fr" -> SekyroLocale.FR; "en" -> SekyroLocale.EN
54
+ "es" -> SekyroLocale.ES; "pt" -> SekyroLocale.PT; "de" -> SekyroLocale.DE
55
+ else -> null
52
56
  },
53
57
  theme = theme,
54
58
  strings = strings,
@@ -60,7 +64,7 @@ internal object ConfigMapper {
60
64
  when (r) {
61
65
  is SekyroResult.Finished -> {
62
66
  putString("status", "finished"); putString("sessionId", r.sessionId)
63
- // EXPIRED stays on the wire; the JS layer maps it to { status: 'failed', code: 'session_expired' } (iOS parity).
67
+ // EXPIRED is a display status in JS too ({ status: 'finished', displayStatus: 'expired' }), as on iOS.
64
68
  putString("displayStatus", when (r.displayStatus) {
65
69
  DisplayStatus.APPROVED -> "approved"; DisplayStatus.REVIEW_PENDING -> "review_pending"
66
70
  DisplayStatus.REJECTED -> "rejected"; DisplayStatus.EXPIRED -> "expired"
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var u=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var C=(e,r)=>{for(var t in r)u(e,t,{get:r[t],enumerable:!0})},O=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of w(r))!h.call(e,i)&&i!==t&&u(e,i,{get:()=>r[i],enumerable:!(n=N(r,i))||n.enumerable});return e};var x=e=>O(u({},"__esModule",{value:!0}),e);var A={};C(A,{SDK_VERSION:()=>R,SekyroError:()=>l,SekyroFlow:()=>E,nativeVersion:()=>_,startSekyro:()=>f});module.exports=x(A);var S=require("react-native"),d=S.TurboModuleRegistry.get("SekyroReactNative");var l=class extends Error{code;constructor(r,t=r){super(t),this.name="SekyroError",this.code=r}};var b=500,T=new Set(["ar","fr","en"]),F=["brand","brandFg","bg","surface","fg","fgMuted","border","danger","success","warning"],I=new Set(["clientToken","apiOrigin","locale","theme","strings","onEvent"]),D=/^#[0-9a-fA-F]{6}$/,V=/^http:\/\/(localhost|127\.0\.0\.1|10\.0\.2\.2)(:\d+)?$/,a=e=>{throw new l("invalid_config",`invalid config: ${e}`)};function k(e){(typeof e!="object"||e===null)&&a("config");for(let n of Object.keys(e))I.has(n)||a(`unknown key "${n.slice(0,32)}"`);(typeof e.clientToken!="string"||e.clientToken.length===0)&&a("clientToken");let r={clientToken:e.clientToken};e.apiOrigin!==void 0&&(typeof e.apiOrigin=="string"&&(/^https:\/\/[a-z0-9.-]+(:\d+)?$/i.test(e.apiOrigin)||__DEV__&&V.test(e.apiOrigin))||a("apiOrigin"),r.apiOrigin=e.apiOrigin),e.locale!==void 0&&(T.has(e.locale)||a("locale"),r.locale=e.locale);let t=e.theme;if(t){if(t.colors){let n={};for(let[i,s]of Object.entries(t.colors))s!==void 0&&((!F.includes(i)||typeof s!="string"||!D.test(s))&&a(`theme.colors.${i.slice(0,32)}`),n[i]=s);r.colors=n}t.radius!==void 0&&((typeof t.radius!="number"||!Number.isFinite(t.radius)||t.radius<0||t.radius>32)&&a("theme.radius"),r.radius=t.radius),t.fontFamily!==void 0&&((typeof t.fontFamily!="string"||!/^[\w .-]{1,64}$/.test(t.fontFamily))&&a("theme.fontFamily"),r.fontFamily=t.fontFamily),t.darkMode!==void 0&&(["system","light","dark"].includes(t.darkMode)||a("theme.darkMode"),r.darkMode=t.darkMode)}if(e.strings){e.locale||a("strings need locale");let n=e.strings[e.locale]??{},i={},s=Object.entries(n).filter(([,o])=>o!==void 0);s.length>b&&a("strings (too many overrides)");for(let[o,y]of s)/^[a-zA-Z0-9_.]{1,96}$/.test(o)||a("strings key"),(typeof y!="string"||y.length>2e3)&&a(`strings.${o}`),i[o]=y;r.strings=i}return r}var M=new Set(["method","phone_otp","email_otp","registry","document","nfc","liveness","processing","result","update_required","eid","contact_choice","identity_summary","portrait"]);function g(e){if(e.type==="waiting_for_network")return{type:"waiting_for_network"};if(e.type!=="step"||!M.has(e.step))return null;let r=e.step,t=typeof e.retryReason=="string"&&/^[a-z0-9_]{1,64}$/.test(e.retryReason)?e.retryReason:void 0;return t?{type:"step",step:r,retryReason:t}:{type:"step",step:r}}var $=new Set(["approved","review_pending","rejected"]);function m(e){if(e.status==="cancelled")return{status:"cancelled"};if(e.status==="failed")return{status:"failed",code:e.code||"unknown_error"};if(e.status==="finished"&&e.sessionId){if(e.displayStatus==="expired")return{status:"failed",code:"session_expired"};if($.has(e.displayStatus))return{status:"finished",sessionId:e.sessionId,displayStatus:e.displayStatus}}return{status:"failed",code:"unknown_error"}}function v(){if(!d)throw new l("unsupported_platform","the SekyroReactNative native module is not linked (New Architecture app, pod install / Gradle sync)");return d}var c=!1,j=new Set(["no_activity","unsupported_platform","flow_in_progress","invalid_config"]);async function f(e){let r=k(e),t=v();if(c)throw new l("flow_in_progress");c=!0;let n=e.onEvent,i=n?t.onEvent(s=>{let o=g(s);o&&n(o)}):void 0;try{return m(await t.start(r))}catch(s){let o=s?.code;if(typeof o=="string"&&j.has(o))throw new l(o);return{status:"failed",code:"unknown_error"}}finally{i?.remove(),c=!1}}function _(){return v().nativeVersion()}var p=require("react");function E(e){let r=(0,p.useRef)(null),t=(0,p.useRef)(e);return t.current=e,(0,p.useEffect)(()=>{if(r.current===e.clientToken)return;r.current=e.clientToken;let{onResult:n,onEvent:i,...s}=t.current;f({...s,onEvent:o=>t.current.onEvent?.(o)}).then(o=>t.current.onResult(o),o=>t.current.onResult({status:"failed",code:o instanceof l?o.code:"unknown_error"}))},[e.clientToken]),null}var R="0.1.0-rc.1";0&&(module.exports={SDK_VERSION,SekyroError,SekyroFlow,nativeVersion,startSekyro});
1
+ "use strict";var f=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var O=(e,r)=>{for(var t in r)f(e,t,{get:r[t],enumerable:!0})},x=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of h(r))!C.call(e,n)&&n!==t&&f(e,n,{get:()=>r[n],enumerable:!(i=w(r,n))||i.enumerable});return e};var b=e=>x(f({},"__esModule",{value:!0}),e);var L={};O(L,{SDK_VERSION:()=>N,SekyroError:()=>l,SekyroFlow:()=>R,nativeVersion:()=>E,startSekyro:()=>u});module.exports=b(L);var S=require("react-native"),d=S.TurboModuleRegistry.get("SekyroReactNative");var l=class extends Error{code;constructor(r,t=r){super(t),this.name="SekyroError",this.code=r}};var T=500,I=new Set(["ar","fr","en","es","pt","de"]),D=["brand","brandFg","bg","surface","fg","fgMuted","border"],F=["danger","success","warning"],k=!1,V=new Set(["clientToken","apiOrigin","locale","theme","strings","onEvent"]),M=/^#[0-9a-fA-F]{6}$/,$=/^http:\/\/(localhost|127\.0\.0\.1|10\.0\.2\.2)(:\d+)?$/,a=e=>{throw new l("invalid_config",`invalid config: ${e}`)};function g(e){(typeof e!="object"||e===null)&&a("config");for(let i of Object.keys(e))V.has(i)||a(`unknown key "${i.slice(0,32)}"`);(typeof e.clientToken!="string"||e.clientToken.length===0)&&a("clientToken");let r={clientToken:e.clientToken};e.apiOrigin!==void 0&&(typeof e.apiOrigin=="string"&&(/^https:\/\/[a-z0-9.-]+(:\d+)?$/i.test(e.apiOrigin)||__DEV__&&$.test(e.apiOrigin))||a("apiOrigin"),r.apiOrigin=e.apiOrigin),e.locale!==void 0&&(I.has(e.locale)||a("locale"),r.locale=e.locale);let t=e.theme;if(t){if(t.colors){let i={};for(let[n,s]of Object.entries(t.colors))if(s!==void 0){if(F.includes(n)){__DEV__&&!k&&(k=!0,console.warn("[sekyro] theme.colors.danger/success/warning are ignored: status colours are standard (removed in 1.0)"));continue}(!D.includes(n)||typeof s!="string"||!M.test(s))&&a(`theme.colors.${n.slice(0,32)}`),i[n]=s}r.colors=i}t.radius!==void 0&&((typeof t.radius!="number"||!Number.isFinite(t.radius)||t.radius<0||t.radius>32)&&a("theme.radius"),r.radius=t.radius),t.fontFamily!==void 0&&((typeof t.fontFamily!="string"||!/^[\w .-]{1,64}$/.test(t.fontFamily))&&a("theme.fontFamily"),r.fontFamily=t.fontFamily),t.darkMode!==void 0&&(["system","light","dark"].includes(t.darkMode)||a("theme.darkMode"),r.darkMode=t.darkMode)}if(e.strings){e.locale||a("strings need locale");let i=e.strings[e.locale]??{},n={},s=Object.entries(i).filter(([,o])=>o!==void 0);s.length>T&&a("strings (too many overrides)");for(let[o,y]of s)/^[a-zA-Z0-9_.]{1,96}$/.test(o)||a("strings key"),(typeof y!="string"||y.length>2e3)&&a(`strings.${o}`),n[o]=y;r.strings=n}return r}var A=new Set(["method","phone_otp","email_otp","registry","document","nfc","liveness","processing","result","update_required","eid","contact_choice","identity_summary","portrait"]);function m(e){if(e.type==="waiting_for_network")return{type:"waiting_for_network"};if(e.type!=="step"||!A.has(e.step))return null;let r=e.step,t=typeof e.retryReason=="string"&&/^[a-z0-9_]{1,64}$/.test(e.retryReason)?e.retryReason:void 0;return t?{type:"step",step:r,retryReason:t}:{type:"step",step:r}}var P=new Set(["approved","review_pending","rejected","expired"]);function v(e){return e.status==="cancelled"?{status:"cancelled"}:e.status==="failed"?{status:"failed",code:e.code||"unknown_error"}:e.status==="finished"&&e.sessionId&&P.has(e.displayStatus)?{status:"finished",sessionId:e.sessionId,displayStatus:e.displayStatus}:{status:"failed",code:"unknown_error"}}function _(){if(!d)throw new l("unsupported_platform","the SekyroReactNative native module is not linked (New Architecture app, pod install / Gradle sync)");return d}var c=!1,j=new Set(["no_activity","unsupported_platform","flow_in_progress","invalid_config"]);async function u(e){let r=g(e),t=_();if(c)throw new l("flow_in_progress");c=!0;let i=e.onEvent,n=i?t.onEvent(s=>{let o=m(s);o&&i(o)}):void 0;try{return v(await t.start(r))}catch(s){let o=s?.code;if(typeof o=="string"&&j.has(o))throw new l(o);return{status:"failed",code:"unknown_error"}}finally{n?.remove(),c=!1}}function E(){return _().nativeVersion()}var p=require("react");function R(e){let r=(0,p.useRef)(null),t=(0,p.useRef)(e);return t.current=e,(0,p.useEffect)(()=>{if(r.current===e.clientToken)return;r.current=e.clientToken;let{onResult:i,onEvent:n,...s}=t.current;u({...s,onEvent:o=>t.current.onEvent?.(o)}).then(o=>t.current.onResult(o),o=>t.current.onResult({status:"failed",code:o instanceof l?o.code:"unknown_error"}))},[e.clientToken]),null}var N="0.1.0-rc.11";0&&(module.exports={SDK_VERSION,SekyroError,SekyroFlow,nativeVersion,startSekyro});
package/dist/index.d.cts CHANGED
@@ -1,14 +1,28 @@
1
- /** UI language of the native flow. @public */
2
- type SekyroLocale = 'ar' | 'fr' | 'en';
3
- /** Themeable colour roles, shared by the Android and iOS cores. @public */
1
+ /** UI language of the native flow. es, pt and de carry the Human copy set and fall back to English elsewhere (spec 2026-10-29 §9). @public */
2
+ type SekyroLocale = 'ar' | 'fr' | 'en' | 'es' | 'pt' | 'de';
3
+ /**
4
+ * Themeable colour roles, shared by the Android and iOS cores. `danger`, `success` and `warning` are deprecated: status
5
+ * colours are standard since 0.1.0-rc.9, the SDK ignores them and they will be removed in 1.0. @public
6
+ */
4
7
  type SekyroColorRole = 'brand' | 'brandFg' | 'bg' | 'surface' | 'fg' | 'fgMuted' | 'border' | 'danger' | 'success' | 'warning';
5
8
  /** Runtime theme applied over the native defaults. @public */
6
9
  interface SekyroTheme {
7
10
  /** `'#RRGGBB'` per role. */
8
- colors?: Partial<Record<SekyroColorRole, string>>;
11
+ colors?: Partial<Record<Exclude<SekyroColorRole, 'danger' | 'success' | 'warning'>, string>> & {
12
+ /** @deprecated Status colours are standard since 0.1.0-rc.9; this key is ignored and will be removed in 1.0. */
13
+ danger?: string;
14
+ /** @deprecated Status colours are standard since 0.1.0-rc.9; this key is ignored and will be removed in 1.0. */
15
+ success?: string;
16
+ /** @deprecated Status colours are standard since 0.1.0-rc.9; this key is ignored and will be removed in 1.0. */
17
+ warning?: string;
18
+ };
9
19
  /** Corner radius in dp / pt, 0–32. */
10
20
  radius?: number;
11
- /** iOS only in 0.1 (Android ignores it). */
21
+ /**
22
+ * Font family of every text role. iOS: a font registered in your app (`UIAppFonts`). Android: a font resource
23
+ * your app bundles (`res/font/<name>`) or a system family (`'sans-serif'`, `'serif'`, `'monospace'`). An unknown
24
+ * name falls back to the Sekyro faces.
25
+ */
12
26
  fontFamily?: string;
13
27
  /** Colour scheme; `'system'` follows the device. */
14
28
  darkMode?: 'system' | 'light' | 'dark';
@@ -34,7 +48,10 @@ interface SekyroConfig {
34
48
  clientToken: string;
35
49
  /** e.g. `'https://api-staging.sekyro.ai'`; defaults to production. */
36
50
  apiOrigin?: string;
37
- /** UI language of the flow; required when `strings` is set. */
51
+ /**
52
+ * UI language of the flow; required when `strings` is set. `es`, `pt` and `de` carry the Human copy set and fall back
53
+ * to English elsewhere.
54
+ */
38
55
  locale?: SekyroLocale;
39
56
  /** Colours, radius, font and colour scheme. */
40
57
  theme?: SekyroTheme;
@@ -43,8 +60,11 @@ interface SekyroConfig {
43
60
  /** Step telemetry of this flow only (no personal data). */
44
61
  onEvent?: (event: SekyroEvent) => void;
45
62
  }
46
- /** What the end user was shown; not the decision. @public */
47
- type SekyroDisplayStatus = 'approved' | 'review_pending' | 'rejected';
63
+ /**
64
+ * What the end user was shown; not the decision. `expired`: the session expired before it finished (the person was
65
+ * asked to start again from your app), as on the native SDKs. @public
66
+ */
67
+ type SekyroDisplayStatus = 'approved' | 'review_pending' | 'rejected' | 'expired';
48
68
  /** Display-only outcome; read the decision server-side (webhooks / `sessions.get`). @public */
49
69
  type SekyroResult = {
50
70
  status: 'finished';
@@ -64,7 +84,7 @@ type SekyroResult = {
64
84
  */
65
85
  declare function startSekyro(config: SekyroConfig): Promise<SekyroResult>;
66
86
  /**
67
- * Version of the bundled native core: `'android 0.1.0-rc.2'` / `'ios 0.1.0-rc.2'`.
87
+ * Version of the bundled native core: `'android 0.1.0-rc.10'` / `'ios 0.1.0-rc.10'`.
68
88
  * @public
69
89
  */
70
90
  declare function nativeVersion(): string;
package/dist/index.d.ts CHANGED
@@ -1,14 +1,28 @@
1
- /** UI language of the native flow. @public */
2
- type SekyroLocale = 'ar' | 'fr' | 'en';
3
- /** Themeable colour roles, shared by the Android and iOS cores. @public */
1
+ /** UI language of the native flow. es, pt and de carry the Human copy set and fall back to English elsewhere (spec 2026-10-29 §9). @public */
2
+ type SekyroLocale = 'ar' | 'fr' | 'en' | 'es' | 'pt' | 'de';
3
+ /**
4
+ * Themeable colour roles, shared by the Android and iOS cores. `danger`, `success` and `warning` are deprecated: status
5
+ * colours are standard since 0.1.0-rc.9, the SDK ignores them and they will be removed in 1.0. @public
6
+ */
4
7
  type SekyroColorRole = 'brand' | 'brandFg' | 'bg' | 'surface' | 'fg' | 'fgMuted' | 'border' | 'danger' | 'success' | 'warning';
5
8
  /** Runtime theme applied over the native defaults. @public */
6
9
  interface SekyroTheme {
7
10
  /** `'#RRGGBB'` per role. */
8
- colors?: Partial<Record<SekyroColorRole, string>>;
11
+ colors?: Partial<Record<Exclude<SekyroColorRole, 'danger' | 'success' | 'warning'>, string>> & {
12
+ /** @deprecated Status colours are standard since 0.1.0-rc.9; this key is ignored and will be removed in 1.0. */
13
+ danger?: string;
14
+ /** @deprecated Status colours are standard since 0.1.0-rc.9; this key is ignored and will be removed in 1.0. */
15
+ success?: string;
16
+ /** @deprecated Status colours are standard since 0.1.0-rc.9; this key is ignored and will be removed in 1.0. */
17
+ warning?: string;
18
+ };
9
19
  /** Corner radius in dp / pt, 0–32. */
10
20
  radius?: number;
11
- /** iOS only in 0.1 (Android ignores it). */
21
+ /**
22
+ * Font family of every text role. iOS: a font registered in your app (`UIAppFonts`). Android: a font resource
23
+ * your app bundles (`res/font/<name>`) or a system family (`'sans-serif'`, `'serif'`, `'monospace'`). An unknown
24
+ * name falls back to the Sekyro faces.
25
+ */
12
26
  fontFamily?: string;
13
27
  /** Colour scheme; `'system'` follows the device. */
14
28
  darkMode?: 'system' | 'light' | 'dark';
@@ -34,7 +48,10 @@ interface SekyroConfig {
34
48
  clientToken: string;
35
49
  /** e.g. `'https://api-staging.sekyro.ai'`; defaults to production. */
36
50
  apiOrigin?: string;
37
- /** UI language of the flow; required when `strings` is set. */
51
+ /**
52
+ * UI language of the flow; required when `strings` is set. `es`, `pt` and `de` carry the Human copy set and fall back
53
+ * to English elsewhere.
54
+ */
38
55
  locale?: SekyroLocale;
39
56
  /** Colours, radius, font and colour scheme. */
40
57
  theme?: SekyroTheme;
@@ -43,8 +60,11 @@ interface SekyroConfig {
43
60
  /** Step telemetry of this flow only (no personal data). */
44
61
  onEvent?: (event: SekyroEvent) => void;
45
62
  }
46
- /** What the end user was shown; not the decision. @public */
47
- type SekyroDisplayStatus = 'approved' | 'review_pending' | 'rejected';
63
+ /**
64
+ * What the end user was shown; not the decision. `expired`: the session expired before it finished (the person was
65
+ * asked to start again from your app), as on the native SDKs. @public
66
+ */
67
+ type SekyroDisplayStatus = 'approved' | 'review_pending' | 'rejected' | 'expired';
48
68
  /** Display-only outcome; read the decision server-side (webhooks / `sessions.get`). @public */
49
69
  type SekyroResult = {
50
70
  status: 'finished';
@@ -64,7 +84,7 @@ type SekyroResult = {
64
84
  */
65
85
  declare function startSekyro(config: SekyroConfig): Promise<SekyroResult>;
66
86
  /**
67
- * Version of the bundled native core: `'android 0.1.0-rc.2'` / `'ios 0.1.0-rc.2'`.
87
+ * Version of the bundled native core: `'android 0.1.0-rc.10'` / `'ios 0.1.0-rc.10'`.
68
88
  * @public
69
89
  */
70
90
  declare function nativeVersion(): string;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{TurboModuleRegistry as m}from"react-native";var f=m.get("SekyroReactNative");var a=class extends Error{code;constructor(r,t=r){super(t),this.name="SekyroError",this.code=r}};var v=500,_=new Set(["ar","fr","en"]),E=["brand","brandFg","bg","surface","fg","fgMuted","border","danger","success","warning"],R=new Set(["clientToken","apiOrigin","locale","theme","strings","onEvent"]),N=/^#[0-9a-fA-F]{6}$/,w=/^http:\/\/(localhost|127\.0\.0\.1|10\.0\.2\.2)(:\d+)?$/,i=e=>{throw new a("invalid_config",`invalid config: ${e}`)};function d(e){(typeof e!="object"||e===null)&&i("config");for(let s of Object.keys(e))R.has(s)||i(`unknown key "${s.slice(0,32)}"`);(typeof e.clientToken!="string"||e.clientToken.length===0)&&i("clientToken");let r={clientToken:e.clientToken};e.apiOrigin!==void 0&&(typeof e.apiOrigin=="string"&&(/^https:\/\/[a-z0-9.-]+(:\d+)?$/i.test(e.apiOrigin)||__DEV__&&w.test(e.apiOrigin))||i("apiOrigin"),r.apiOrigin=e.apiOrigin),e.locale!==void 0&&(_.has(e.locale)||i("locale"),r.locale=e.locale);let t=e.theme;if(t){if(t.colors){let s={};for(let[l,n]of Object.entries(t.colors))n!==void 0&&((!E.includes(l)||typeof n!="string"||!N.test(n))&&i(`theme.colors.${l.slice(0,32)}`),s[l]=n);r.colors=s}t.radius!==void 0&&((typeof t.radius!="number"||!Number.isFinite(t.radius)||t.radius<0||t.radius>32)&&i("theme.radius"),r.radius=t.radius),t.fontFamily!==void 0&&((typeof t.fontFamily!="string"||!/^[\w .-]{1,64}$/.test(t.fontFamily))&&i("theme.fontFamily"),r.fontFamily=t.fontFamily),t.darkMode!==void 0&&(["system","light","dark"].includes(t.darkMode)||i("theme.darkMode"),r.darkMode=t.darkMode)}if(e.strings){e.locale||i("strings need locale");let s=e.strings[e.locale]??{},l={},n=Object.entries(s).filter(([,o])=>o!==void 0);n.length>v&&i("strings (too many overrides)");for(let[o,p]of n)/^[a-zA-Z0-9_.]{1,96}$/.test(o)||i("strings key"),(typeof p!="string"||p.length>2e3)&&i(`strings.${o}`),l[o]=p;r.strings=l}return r}var h=new Set(["method","phone_otp","email_otp","registry","document","nfc","liveness","processing","result","update_required","eid","contact_choice","identity_summary","portrait"]);function c(e){if(e.type==="waiting_for_network")return{type:"waiting_for_network"};if(e.type!=="step"||!h.has(e.step))return null;let r=e.step,t=typeof e.retryReason=="string"&&/^[a-z0-9_]{1,64}$/.test(e.retryReason)?e.retryReason:void 0;return t?{type:"step",step:r,retryReason:t}:{type:"step",step:r}}var C=new Set(["approved","review_pending","rejected"]);function S(e){if(e.status==="cancelled")return{status:"cancelled"};if(e.status==="failed")return{status:"failed",code:e.code||"unknown_error"};if(e.status==="finished"&&e.sessionId){if(e.displayStatus==="expired")return{status:"failed",code:"session_expired"};if(C.has(e.displayStatus))return{status:"finished",sessionId:e.sessionId,displayStatus:e.displayStatus}}return{status:"failed",code:"unknown_error"}}function k(){if(!f)throw new a("unsupported_platform","the SekyroReactNative native module is not linked (New Architecture app, pod install / Gradle sync)");return f}var y=!1,O=new Set(["no_activity","unsupported_platform","flow_in_progress","invalid_config"]);async function u(e){let r=d(e),t=k();if(y)throw new a("flow_in_progress");y=!0;let s=e.onEvent,l=s?t.onEvent(n=>{let o=c(n);o&&s(o)}):void 0;try{return S(await t.start(r))}catch(n){let o=n?.code;if(typeof o=="string"&&O.has(o))throw new a(o);return{status:"failed",code:"unknown_error"}}finally{l?.remove(),y=!1}}function x(){return k().nativeVersion()}import{useEffect as b,useRef as g}from"react";function T(e){let r=g(null),t=g(e);return t.current=e,b(()=>{if(r.current===e.clientToken)return;r.current=e.clientToken;let{onResult:s,onEvent:l,...n}=t.current;u({...n,onEvent:o=>t.current.onEvent?.(o)}).then(o=>t.current.onResult(o),o=>t.current.onResult({status:"failed",code:o instanceof a?o.code:"unknown_error"}))},[e.clientToken]),null}var F="0.1.0-rc.1";export{F as SDK_VERSION,a as SekyroError,T as SekyroFlow,x as nativeVersion,u as startSekyro};
1
+ import{TurboModuleRegistry as v}from"react-native";var u=v.get("SekyroReactNative");var a=class extends Error{code;constructor(r,t=r){super(t),this.name="SekyroError",this.code=r}};var _=500,E=new Set(["ar","fr","en","es","pt","de"]),R=["brand","brandFg","bg","surface","fg","fgMuted","border"],N=["danger","success","warning"],d=!1,w=new Set(["clientToken","apiOrigin","locale","theme","strings","onEvent"]),h=/^#[0-9a-fA-F]{6}$/,C=/^http:\/\/(localhost|127\.0\.0\.1|10\.0\.2\.2)(:\d+)?$/,i=e=>{throw new a("invalid_config",`invalid config: ${e}`)};function c(e){(typeof e!="object"||e===null)&&i("config");for(let s of Object.keys(e))w.has(s)||i(`unknown key "${s.slice(0,32)}"`);(typeof e.clientToken!="string"||e.clientToken.length===0)&&i("clientToken");let r={clientToken:e.clientToken};e.apiOrigin!==void 0&&(typeof e.apiOrigin=="string"&&(/^https:\/\/[a-z0-9.-]+(:\d+)?$/i.test(e.apiOrigin)||__DEV__&&C.test(e.apiOrigin))||i("apiOrigin"),r.apiOrigin=e.apiOrigin),e.locale!==void 0&&(E.has(e.locale)||i("locale"),r.locale=e.locale);let t=e.theme;if(t){if(t.colors){let s={};for(let[l,n]of Object.entries(t.colors))if(n!==void 0){if(N.includes(l)){__DEV__&&!d&&(d=!0,console.warn("[sekyro] theme.colors.danger/success/warning are ignored: status colours are standard (removed in 1.0)"));continue}(!R.includes(l)||typeof n!="string"||!h.test(n))&&i(`theme.colors.${l.slice(0,32)}`),s[l]=n}r.colors=s}t.radius!==void 0&&((typeof t.radius!="number"||!Number.isFinite(t.radius)||t.radius<0||t.radius>32)&&i("theme.radius"),r.radius=t.radius),t.fontFamily!==void 0&&((typeof t.fontFamily!="string"||!/^[\w .-]{1,64}$/.test(t.fontFamily))&&i("theme.fontFamily"),r.fontFamily=t.fontFamily),t.darkMode!==void 0&&(["system","light","dark"].includes(t.darkMode)||i("theme.darkMode"),r.darkMode=t.darkMode)}if(e.strings){e.locale||i("strings need locale");let s=e.strings[e.locale]??{},l={},n=Object.entries(s).filter(([,o])=>o!==void 0);n.length>_&&i("strings (too many overrides)");for(let[o,p]of n)/^[a-zA-Z0-9_.]{1,96}$/.test(o)||i("strings key"),(typeof p!="string"||p.length>2e3)&&i(`strings.${o}`),l[o]=p;r.strings=l}return r}var O=new Set(["method","phone_otp","email_otp","registry","document","nfc","liveness","processing","result","update_required","eid","contact_choice","identity_summary","portrait"]);function S(e){if(e.type==="waiting_for_network")return{type:"waiting_for_network"};if(e.type!=="step"||!O.has(e.step))return null;let r=e.step,t=typeof e.retryReason=="string"&&/^[a-z0-9_]{1,64}$/.test(e.retryReason)?e.retryReason:void 0;return t?{type:"step",step:r,retryReason:t}:{type:"step",step:r}}var x=new Set(["approved","review_pending","rejected","expired"]);function k(e){return e.status==="cancelled"?{status:"cancelled"}:e.status==="failed"?{status:"failed",code:e.code||"unknown_error"}:e.status==="finished"&&e.sessionId&&x.has(e.displayStatus)?{status:"finished",sessionId:e.sessionId,displayStatus:e.displayStatus}:{status:"failed",code:"unknown_error"}}function g(){if(!u)throw new a("unsupported_platform","the SekyroReactNative native module is not linked (New Architecture app, pod install / Gradle sync)");return u}var y=!1,b=new Set(["no_activity","unsupported_platform","flow_in_progress","invalid_config"]);async function f(e){let r=c(e),t=g();if(y)throw new a("flow_in_progress");y=!0;let s=e.onEvent,l=s?t.onEvent(n=>{let o=S(n);o&&s(o)}):void 0;try{return k(await t.start(r))}catch(n){let o=n?.code;if(typeof o=="string"&&b.has(o))throw new a(o);return{status:"failed",code:"unknown_error"}}finally{l?.remove(),y=!1}}function T(){return g().nativeVersion()}import{useEffect as I,useRef as m}from"react";function D(e){let r=m(null),t=m(e);return t.current=e,I(()=>{if(r.current===e.clientToken)return;r.current=e.clientToken;let{onResult:s,onEvent:l,...n}=t.current;f({...n,onEvent:o=>t.current.onEvent?.(o)}).then(o=>t.current.onResult(o),o=>t.current.onResult({status:"failed",code:o instanceof a?o.code:"unknown_error"}))},[e.clientToken]),null}var F="0.1.0-rc.11";export{F as SDK_VERSION,a as SekyroError,D as SekyroFlow,T as nativeVersion,f as startSekyro};
@@ -12,6 +12,12 @@ public final class SekyroRNBridge: NSObject {
12
12
 
13
13
  struct InvalidConfig: Error {}
14
14
 
15
+ /// No `locale` passed: the device language, among ar, fr and en only (as before Plan C), so an existing partner's
16
+ /// screens keep their language. es, pt and de apply only when the partner passes them.
17
+ static func deviceLocale(_ preferred: [String]) -> String? {
18
+ preferred.lazy.map { String($0.prefix(2)).lowercased() }.first { ["ar", "fr", "en"].contains($0) }
19
+ }
20
+
15
21
  /// The JS layer validated the config; this re-checks the shape. Never logs it (the token is a bearer credential).
16
22
  static func parse(_ d: NSDictionary) throws -> SekyroConfig {
17
23
  guard let token = d["clientToken"] as? String, !token.isEmpty else { throw InvalidConfig() }
@@ -20,8 +26,7 @@ public final class SekyroRNBridge: NSObject {
20
26
  guard let url = URL(string: raw), url.scheme == "https" || url.host == "localhost" || url.host == "127.0.0.1" else { throw InvalidConfig() }
21
27
  origin = url
22
28
  }
23
- let preferred = Locale.preferredLanguages.lazy.map { String($0.prefix(2)) }.first { ["ar", "fr", "en"].contains($0) }
24
- let locale = SekyroLocale(rawValue: (d["locale"] as? String) ?? preferred ?? "fr") ?? .fr
29
+ let locale = SekyroLocale(rawValue: (d["locale"] as? String) ?? deviceLocale(Locale.preferredLanguages) ?? "fr") ?? .fr
25
30
  let colors = d["colors"] as? [String: Any] ?? [:]
26
31
  func color(_ key: String) throws -> SekyroColor? {
27
32
  guard let value = colors[key] else { return nil }
@@ -43,7 +48,7 @@ public final class SekyroRNBridge: NSObject {
43
48
  let theme = SekyroTheme(
44
49
  brand: try color("brand"), brandFg: try color("brandFg"), background: try color("bg"), surface: try color("surface"),
45
50
  foreground: try color("fg"), foregroundMuted: try color("fgMuted"), border: try color("border"),
46
- danger: try color("danger"), success: try color("success"), warning: try color("warning"),
51
+ // danger / success / warning are not read: status colours are standard (deprecated no-ops, removed in 1.0).
47
52
  cornerRadius: radius, fontFamily: d["fontFamily"] as? String, darkMode: mode, strings: strings)
48
53
  return SekyroConfig(clientToken: token, apiOrigin: origin, locale: locale, theme: theme)
49
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sekyro/react-native",
3
- "version": "0.1.0-rc.1",
3
+ "version": "0.1.0-rc.11",
4
4
  "private": false,
5
5
  "description": "Sekyro AI eKYC for React Native — glue over the binary Android and iOS SDKs (New Architecture)",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -99,7 +99,7 @@
99
99
  }
100
100
  },
101
101
  "sekyro": {
102
- "android": "0.1.0-rc.2",
103
- "ios": "0.1.0-rc.2"
102
+ "android": "0.1.0-rc.10",
103
+ "ios": "0.1.0-rc.10"
104
104
  }
105
105
  }
package/sbom.cdx.json CHANGED
@@ -97,8 +97,8 @@
97
97
  "type": "application",
98
98
  "name": "react-native",
99
99
  "group": "@sekyro",
100
- "version": "0.1.0-rc.1",
101
- "bom-ref": "@sekyro/react-native@0.1.0-rc.1",
100
+ "version": "0.1.0-rc.11",
101
+ "bom-ref": "@sekyro/react-native@0.1.0-rc.11",
102
102
  "description": "Sekyro AI eKYC for React Native — glue over the binary Android and iOS SDKs (New Architecture)",
103
103
  "licenses": [
104
104
  {
@@ -108,7 +108,7 @@
108
108
  }
109
109
  }
110
110
  ],
111
- "purl": "pkg:npm/%40sekyro/react-native@0.1.0-rc.1?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23sekyro-mobile%2Freact-native",
111
+ "purl": "pkg:npm/%40sekyro/react-native@0.1.0-rc.11?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23sekyro-mobile%2Freact-native",
112
112
  "externalReferences": [
113
113
  {
114
114
  "url": "https://github.com/IBTIKAR-Technologies/ibtikar-identity/issues",
@@ -147,7 +147,7 @@
147
147
  "components": [],
148
148
  "dependencies": [
149
149
  {
150
- "ref": "@sekyro/react-native@0.1.0-rc.1"
150
+ "ref": "@sekyro/react-native@0.1.0-rc.11"
151
151
  }
152
152
  ]
153
153
  }