@veryai/react-native-sdk 1.0.47 → 1.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -211,7 +211,15 @@ Decode the `id_token` JWT to get the user's identity:
211
211
  | `userId` | String? | undefined | Undefined for enrollment, user ID for verification |
212
212
  | `language` | String? | device | Locale code (e.g. `"en"`, `"es"`, `"ja"`). 35 languages supported. |
213
213
  | `themeMode` | String | `"dark"` | `"dark"` or `"light"` |
214
- | `presentationStyle` | String | `"fullScreen"` | `"fullScreen"` or `"bottomSheet"` |
214
+ | `presentationStyle` | String | `"fullScreen"` | `"fullScreen"` or `"bottomSheet"`. iOS presents modally regardless. |
215
+ | `livenessMode` | String? | `"touch"` | `"gesture"` or `"touch"`. **iOS only** — Android always uses touch. |
216
+ | `debugLogging` | boolean | `false` | Verbose API request/response logging to the native console. |
217
+
218
+ > **Liveness-only flow not wrapped yet.** The native SDKs also ship a standalone
219
+ > liveness check (`VeryAILiveness` / `VeryLivenessConfig`) with `showError` /
220
+ > `showSuccess` options. The React Native wrapper currently exposes only the
221
+ > `authenticate` (palm-auth) flow; surfacing the liveness flow is tracked
222
+ > separately.
215
223
 
216
224
  ### VeryResult
217
225
 
@@ -83,7 +83,7 @@ dependencies {
83
83
  if (findProject(':very-sdk') != null) {
84
84
  implementation project(':very-sdk')
85
85
  } else {
86
- implementation "org.very:sdk:${project.findProperty('verySDKVersion') ?: '1.0.47'}"
86
+ implementation "org.very:sdk:${project.findProperty('verySDKVersion') ?: '1.0.49'}"
87
87
  }
88
88
  }
89
89
 
@@ -17,11 +17,15 @@ class VerySDKModuleImpl(private val reactContext: ReactApplicationContext) {
17
17
  return
18
18
  }
19
19
 
20
+ // Note: livenessMode is intentionally not read here — the native Android
21
+ // auth-flow VeryConfig has no livenessMode field (it always uses touch).
22
+ // The JS layer still accepts it for iOS parity; on Android it's a no-op.
20
23
  val config = VeryConfig(
21
24
  sdkKey = configMap.getString("sdkKey") ?: "",
22
25
  userId = if (configMap.hasKey("userId") && !configMap.isNull("userId")) configMap.getString("userId") else null,
23
26
  language = if (configMap.hasKey("language") && !configMap.isNull("language")) configMap.getString("language") else null,
24
- themeMode = configMap.getString("themeMode") ?: "dark"
27
+ themeMode = configMap.getString("themeMode") ?: "dark",
28
+ debugLogging = configMap.hasKey("debugLogging") && !configMap.isNull("debugLogging") && configMap.getBoolean("debugLogging")
25
29
  )
26
30
 
27
31
  val style = when (configMap.getString("presentationStyle")) {
@@ -29,7 +33,14 @@ class VerySDKModuleImpl(private val reactContext: ReactApplicationContext) {
29
33
  else -> VeryPresentationStyle.FULL_SCREEN
30
34
  }
31
35
 
36
+ // SDK can fire its completion twice in edge cases (timeout clearing
37
+ // currentCallback then a late real result). RN promises throw on a
38
+ // second resolve, so guard with a one-shot lock (mirrors the Flutter
39
+ // Android plugin).
40
+ val didReport = java.util.concurrent.atomic.AtomicBoolean(false)
41
+
32
42
  VerySDK.authenticate(activity, config, style) { result ->
43
+ if (!didReport.compareAndSet(false, true)) return@authenticate
33
44
  val map = Arguments.createMap().apply {
34
45
  putString("code", result.code)
35
46
  putString("userId", result.userId)
@@ -28,12 +28,21 @@ class VerySDKRN: NSObject {
28
28
  userId: config["userId"] as? String,
29
29
  language: config["language"] as? String,
30
30
  themeMode: config["themeMode"] as? String ?? "dark",
31
- livenessMode: livenessMode
31
+ livenessMode: livenessMode,
32
+ debugLogging: config["debugLogging"] as? Bool ?? false
32
33
  )
33
34
 
34
35
  let style: VeryPresentationStyle = .modal
35
36
 
37
+ // SDK can fire its completion twice in edge cases (timeout clearing
38
+ // currentCallback then a late real result). A second resolve is a
39
+ // no-op/warning in RN, so guard with a one-shot flag. Safe as a
40
+ // plain Bool because everything here runs on the main queue
41
+ // (mirrors the Flutter iOS plugin).
42
+ var didReport = false
36
43
  VerySDK.authenticate(from: rootVC, config: veryConfig, presentationStyle: style) { result in
44
+ guard !didReport else { return }
45
+ didReport = true
37
46
  var dict: [String: Any] = [
38
47
  "code": result.code,
39
48
  "userId": result.userId ?? "",
@@ -13,7 +13,9 @@ const VerySDK = exports.VerySDK = {
13
13
  userId: config.userId ?? null,
14
14
  language: config.language ?? null,
15
15
  themeMode: config.themeMode ?? 'dark',
16
- presentationStyle: config.presentationStyle ?? 'fullScreen'
16
+ presentationStyle: config.presentationStyle ?? 'fullScreen',
17
+ livenessMode: config.livenessMode ?? null,
18
+ debugLogging: config.debugLogging ?? false
17
19
  });
18
20
  return {
19
21
  code: raw.code,
@@ -1 +1 @@
1
- {"version":3,"names":["_NativeVerySDK","_interopRequireDefault","require","e","__esModule","default","VerySDK","exports","authenticate","config","raw","NativeModule","sdkKey","userId","language","themeMode","presentationStyle","code","signedToken","undefined","error","errorMessage","isSuccess","isSupported"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAKpC,MAAMG,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG;EACrB,MAAME,YAAYA,CAACC,MAAkB,EAAuB;IAC1D,MAAMC,GAAG,GAAI,MAAMC,sBAAY,CAACH,YAAY,CAAC;MAC3CI,MAAM,EAAEH,MAAM,CAACG,MAAM;MACrBC,MAAM,EAAEJ,MAAM,CAACI,MAAM,IAAI,IAAI;MAC7BC,QAAQ,EAAEL,MAAM,CAACK,QAAQ,IAAI,IAAI;MACjCC,SAAS,EAAEN,MAAM,CAACM,SAAS,IAAI,MAAM;MACrCC,iBAAiB,EAAEP,MAAM,CAACO,iBAAiB,IAAI;IACjD,CAAC,CAA6B;IAC9B,OAAO;MACLC,IAAI,EAAEP,GAAG,CAACO,IAAc;MACxBJ,MAAM,EAAEH,GAAG,CAACG,MAAgB;MAC5BK,WAAW,EAAGR,GAAG,CAACQ,WAAW,IAAeC,SAAS;MACrDC,KAAK,EAAGV,GAAG,CAACU,KAAK,IAAeD,SAAS;MACzCE,YAAY,EAAGX,GAAG,CAACW,YAAY,IAAeF,SAAS;MACvDG,SAAS,EAAEZ,GAAG,CAACY;IACjB,CAAC;EACH,CAAC;EAED,MAAMC,WAAWA,CAAA,EAAqB;IACpC,OAAOZ,sBAAY,CAACY,WAAW,CAAC,CAAC;EACnC;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_NativeVerySDK","_interopRequireDefault","require","e","__esModule","default","VerySDK","exports","authenticate","config","raw","NativeModule","sdkKey","userId","language","themeMode","presentationStyle","livenessMode","debugLogging","code","signedToken","undefined","error","errorMessage","isSuccess","isSupported"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAKpC,MAAMG,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG;EACrB,MAAME,YAAYA,CAACC,MAAkB,EAAuB;IAC1D,MAAMC,GAAG,GAAI,MAAMC,sBAAY,CAACH,YAAY,CAAC;MAC3CI,MAAM,EAAEH,MAAM,CAACG,MAAM;MACrBC,MAAM,EAAEJ,MAAM,CAACI,MAAM,IAAI,IAAI;MAC7BC,QAAQ,EAAEL,MAAM,CAACK,QAAQ,IAAI,IAAI;MACjCC,SAAS,EAAEN,MAAM,CAACM,SAAS,IAAI,MAAM;MACrCC,iBAAiB,EAAEP,MAAM,CAACO,iBAAiB,IAAI,YAAY;MAC3DC,YAAY,EAAER,MAAM,CAACQ,YAAY,IAAI,IAAI;MACzCC,YAAY,EAAET,MAAM,CAACS,YAAY,IAAI;IACvC,CAAC,CAA6B;IAC9B,OAAO;MACLC,IAAI,EAAET,GAAG,CAACS,IAAc;MACxBN,MAAM,EAAEH,GAAG,CAACG,MAAgB;MAC5BO,WAAW,EAAGV,GAAG,CAACU,WAAW,IAAeC,SAAS;MACrDC,KAAK,EAAGZ,GAAG,CAACY,KAAK,IAAeD,SAAS;MACzCE,YAAY,EAAGb,GAAG,CAACa,YAAY,IAAeF,SAAS;MACvDG,SAAS,EAAEd,GAAG,CAACc;IACjB,CAAC;EACH,CAAC;EAED,MAAMC,WAAWA,CAAA,EAAqB;IACpC,OAAOd,sBAAY,CAACc,WAAW,CAAC,CAAC;EACnC;AACF,CAAC","ignoreList":[]}
@@ -8,7 +8,9 @@ export const VerySDK = {
8
8
  userId: config.userId ?? null,
9
9
  language: config.language ?? null,
10
10
  themeMode: config.themeMode ?? 'dark',
11
- presentationStyle: config.presentationStyle ?? 'fullScreen'
11
+ presentationStyle: config.presentationStyle ?? 'fullScreen',
12
+ livenessMode: config.livenessMode ?? null,
13
+ debugLogging: config.debugLogging ?? false
12
14
  });
13
15
  return {
14
16
  code: raw.code,
@@ -1 +1 @@
1
- {"version":3,"names":["NativeModule","VerySDK","authenticate","config","raw","sdkKey","userId","language","themeMode","presentationStyle","code","signedToken","undefined","error","errorMessage","isSuccess","isSupported"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,OAAOA,YAAY,MAAM,iBAAiB;AAK1C,OAAO,MAAMC,OAAO,GAAG;EACrB,MAAMC,YAAYA,CAACC,MAAkB,EAAuB;IAC1D,MAAMC,GAAG,GAAI,MAAMJ,YAAY,CAACE,YAAY,CAAC;MAC3CG,MAAM,EAAEF,MAAM,CAACE,MAAM;MACrBC,MAAM,EAAEH,MAAM,CAACG,MAAM,IAAI,IAAI;MAC7BC,QAAQ,EAAEJ,MAAM,CAACI,QAAQ,IAAI,IAAI;MACjCC,SAAS,EAAEL,MAAM,CAACK,SAAS,IAAI,MAAM;MACrCC,iBAAiB,EAAEN,MAAM,CAACM,iBAAiB,IAAI;IACjD,CAAC,CAA6B;IAC9B,OAAO;MACLC,IAAI,EAAEN,GAAG,CAACM,IAAc;MACxBJ,MAAM,EAAEF,GAAG,CAACE,MAAgB;MAC5BK,WAAW,EAAGP,GAAG,CAACO,WAAW,IAAeC,SAAS;MACrDC,KAAK,EAAGT,GAAG,CAACS,KAAK,IAAeD,SAAS;MACzCE,YAAY,EAAGV,GAAG,CAACU,YAAY,IAAeF,SAAS;MACvDG,SAAS,EAAEX,GAAG,CAACW;IACjB,CAAC;EACH,CAAC;EAED,MAAMC,WAAWA,CAAA,EAAqB;IACpC,OAAOhB,YAAY,CAACgB,WAAW,CAAC,CAAC;EACnC;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["NativeModule","VerySDK","authenticate","config","raw","sdkKey","userId","language","themeMode","presentationStyle","livenessMode","debugLogging","code","signedToken","undefined","error","errorMessage","isSuccess","isSupported"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,OAAOA,YAAY,MAAM,iBAAiB;AAK1C,OAAO,MAAMC,OAAO,GAAG;EACrB,MAAMC,YAAYA,CAACC,MAAkB,EAAuB;IAC1D,MAAMC,GAAG,GAAI,MAAMJ,YAAY,CAACE,YAAY,CAAC;MAC3CG,MAAM,EAAEF,MAAM,CAACE,MAAM;MACrBC,MAAM,EAAEH,MAAM,CAACG,MAAM,IAAI,IAAI;MAC7BC,QAAQ,EAAEJ,MAAM,CAACI,QAAQ,IAAI,IAAI;MACjCC,SAAS,EAAEL,MAAM,CAACK,SAAS,IAAI,MAAM;MACrCC,iBAAiB,EAAEN,MAAM,CAACM,iBAAiB,IAAI,YAAY;MAC3DC,YAAY,EAAEP,MAAM,CAACO,YAAY,IAAI,IAAI;MACzCC,YAAY,EAAER,MAAM,CAACQ,YAAY,IAAI;IACvC,CAAC,CAA6B;IAC9B,OAAO;MACLC,IAAI,EAAER,GAAG,CAACQ,IAAc;MACxBN,MAAM,EAAEF,GAAG,CAACE,MAAgB;MAC5BO,WAAW,EAAGT,GAAG,CAACS,WAAW,IAAeC,SAAS;MACrDC,KAAK,EAAGX,GAAG,CAACW,KAAK,IAAeD,SAAS;MACzCE,YAAY,EAAGZ,GAAG,CAACY,YAAY,IAAeF,SAAS;MACvDG,SAAS,EAAEb,GAAG,CAACa;IACjB,CAAC;EACH,CAAC;EAED,MAAMC,WAAWA,CAAA,EAAqB;IACpC,OAAOlB,YAAY,CAACkB,WAAW,CAAC,CAAC;EACnC;AACF,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEtD,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AAEvC,eAAO,MAAM,OAAO;yBACS,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;mBAkBtC,OAAO,CAAC,OAAO,CAAC;CAGtC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEtD,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AAEvC,eAAO,MAAM,OAAO;yBACS,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;mBAoBtC,OAAO,CAAC,OAAO,CAAC;CAGtC,CAAC"}
@@ -4,6 +4,17 @@ export interface VeryConfig {
4
4
  language?: string;
5
5
  themeMode?: 'dark' | 'light';
6
6
  presentationStyle?: 'fullScreen' | 'bottomSheet';
7
+ /**
8
+ * Liveness detection mode for the palm scan. iOS only — the native
9
+ * Android auth flow always uses touch and ignores this field.
10
+ */
11
+ livenessMode?: 'gesture' | 'touch';
12
+ /**
13
+ * Enable verbose SDK logging. Off by default — turning it on prints API
14
+ * request/response bodies (session tokens, emails, etc.) to the native
15
+ * console. Errors always log regardless of this flag.
16
+ */
17
+ debugLogging?: boolean;
7
18
  }
8
19
  export interface VeryResult {
9
20
  code: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,iBAAiB,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC;CAClD;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;CACpB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,iBAAiB,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC;IACjD;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACnC;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;CACpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veryai/react-native-sdk",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "description": "React Native wrapper for Very SDK - Palm biometrics verification",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
package/src/index.tsx CHANGED
@@ -11,6 +11,8 @@ export const VerySDK = {
11
11
  language: config.language ?? null,
12
12
  themeMode: config.themeMode ?? 'dark',
13
13
  presentationStyle: config.presentationStyle ?? 'fullScreen',
14
+ livenessMode: config.livenessMode ?? null,
15
+ debugLogging: config.debugLogging ?? false,
14
16
  })) as Record<string, unknown>;
15
17
  return {
16
18
  code: raw.code as string,
package/src/types.ts CHANGED
@@ -4,6 +4,17 @@ export interface VeryConfig {
4
4
  language?: string;
5
5
  themeMode?: 'dark' | 'light';
6
6
  presentationStyle?: 'fullScreen' | 'bottomSheet';
7
+ /**
8
+ * Liveness detection mode for the palm scan. iOS only — the native
9
+ * Android auth flow always uses touch and ignores this field.
10
+ */
11
+ livenessMode?: 'gesture' | 'touch';
12
+ /**
13
+ * Enable verbose SDK logging. Off by default — turning it on prints API
14
+ * request/response bodies (session tokens, emails, etc.) to the native
15
+ * console. Errors always log regardless of this flag.
16
+ */
17
+ debugLogging?: boolean;
7
18
  }
8
19
 
9
20
  export interface VeryResult {
@@ -29,7 +29,7 @@ Pod::Spec.new do |s|
29
29
  # CI sed in .github/workflows/release.yml can rewrite the version
30
30
  # on each release. The two forms are functionally similar within
31
31
  # a minor: `~> 1.0.39` ≡ `>= 1.0.39, < 1.1.0`.
32
- core.dependency "VerySDK/Core", "1.0.47"
32
+ core.dependency "VerySDK/Core", "1.0.49"
33
33
 
34
34
  if respond_to?(:install_modules_dependencies, true)
35
35
  install_modules_dependencies(core)
@@ -40,6 +40,6 @@ Pod::Spec.new do |s|
40
40
 
41
41
  s.subspec 'Bundled' do |bundled|
42
42
  bundled.dependency 'veryai-react-native-sdk/Core'
43
- bundled.dependency 'VerySDK/Bundled', "1.0.47"
43
+ bundled.dependency 'VerySDK/Bundled', "1.0.49"
44
44
  end
45
45
  end