@veryai/react-native-sdk 1.0.30 → 1.0.34

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
@@ -23,6 +23,92 @@ Add camera permission to `Info.plist`:
23
23
 
24
24
  Published on [npm](https://www.npmjs.com/package/@veryai/react-native-sdk).
25
25
 
26
+ ## Asset Loading: Bundled vs Slim
27
+
28
+ The SDK ships with the palm-recognition native asset bundled inside it by default — your app works offline, no first-scan download wait. If you'd rather keep your binary small and have the SDK fetch the asset from CDN on first scan, you can opt into slim mode per platform.
29
+
30
+ | Mode | Adds to app size | First-scan UX | Works offline |
31
+ | ------ | ----------------------------------------- | ---------------------------- | ------------- |
32
+ | Bundled (default) | ~18 MB per ABI (Android), ~8 MB (iOS) | instant | yes |
33
+ | Slim | nothing | one-time download (5–15 s) | no (first scan only) |
34
+
35
+ Cached assets persist across app launches; the download only happens once.
36
+
37
+ ### iOS — switching to slim
38
+
39
+ Step 1 — disable RN auto-linking for this package only. Add or edit `react-native.config.js` at your project root:
40
+
41
+ ```js
42
+ module.exports = {
43
+ dependencies: {
44
+ '@veryai/react-native-sdk': {
45
+ platforms: { ios: null },
46
+ },
47
+ },
48
+ };
49
+ ```
50
+
51
+ Step 2 — declare the slim subspec explicitly in `ios/Podfile` inside your app target:
52
+
53
+ ```ruby
54
+ target 'YourApp' do
55
+ config = use_native_modules!
56
+ use_react_native!(...)
57
+
58
+ pod 'veryai-react-native-sdk/Core',
59
+ :path => '../node_modules/@veryai/react-native-sdk'
60
+ end
61
+ ```
62
+
63
+ Step 3:
64
+
65
+ ```bash
66
+ cd ios && pod install
67
+ ```
68
+
69
+ To go back to bundled, delete the `react-native.config.js` entry and the `pod 'veryai-react-native-sdk/Core'` line, then `pod install` again.
70
+
71
+ ### Android — switching to slim
72
+
73
+ In `android/app/build.gradle` (the **app** module, not the project root), add:
74
+
75
+ ```gradle
76
+ android {
77
+ packaging {
78
+ jniLibs {
79
+ excludes += '**/libPalmAPISaas.so'
80
+ }
81
+ }
82
+ }
83
+ ```
84
+
85
+ This filters the bundled `.so` out at packaging time. The runtime falls through to CDN download.
86
+
87
+ ### Verifying which mode you're in
88
+
89
+ iOS — after `pod install`:
90
+
91
+ ```bash
92
+ grep -c "VerySDK_BundledModel\|packed_data" ios/Pods/Pods.xcodeproj/project.pbxproj
93
+ # > 0 → bundled, 0 → slim
94
+ ```
95
+
96
+ Android — after a build:
97
+
98
+ ```bash
99
+ unzip -l android/app/build/outputs/apk/debug/app-debug.apk | grep libPalmAPISaas
100
+ # matches → bundled, no output → slim
101
+ ```
102
+
103
+ ### CDN endpoints (slim mode)
104
+
105
+ The SDK tries the primary CDN first and falls back automatically. Allowlist both hostnames if your network has egress restrictions.
106
+
107
+ | Asset | Primary | Backup |
108
+ | -------------------------------- | ------------------------------------------------ | ------------------------------------------------------- |
109
+ | Android `libPalmAPISaas.so` (per ABI) | `assets.very.org/sdk/data/<abi>/...` | `r2.assets.very.org/sdk/v1/<abi>/...` |
110
+ | iOS `packed_data.bin` | `assets.very.org/sdk/data/packed_data.bin` | `r2.assets.very.org/sdk/v1/packed_data.bin` |
111
+
26
112
  ## Getting an SDK Key
27
113
 
28
114
  Native SDK keys are not yet available via the Developer Portal. Contact [support@very.org](mailto:support@very.org) to get your SDK key and client credentials.
@@ -141,8 +227,16 @@ Decode the `id_token` JWT to get the user's identity:
141
227
  ## Requirements
142
228
 
143
229
  - React Native 0.73+
144
- - iOS 16.4+ / Android 10 (API 29)+
230
+ - iOS 13.0+ / Android 6 (API 23)+
145
231
  - Physical device (no simulator)
146
232
  - Camera permission
147
233
 
234
+ ## Error Codes
235
+
236
+ The full list lives in the [top-level README](../README.md#error-codes). One slim-mode-specific code worth calling out:
237
+
238
+ | Code | Name | Meaning |
239
+ |------|-------------------------------|------------------------------------------------------------------------|
240
+ | 6106 | `NATIVE_LIB_DOWNLOAD_FAILED` | Slim-mode partner: the SDK couldn't fetch the palm asset from CDN. Check internet, CDN allowlist, or revert to bundled mode. |
241
+
148
242
  Use `VerySDK.isSupported()` to check device compatibility at runtime before showing the verification UI.
@@ -37,13 +37,17 @@ android {
37
37
  buildConfig = true
38
38
  }
39
39
 
40
+ // JVM 17 to match the default of modern RN/Expo templates. AGP 7.4+
41
+ // refuses to mix Java/Kotlin JVM targets within one module, so a
42
+ // wrapper at 1.8 fails the consumer's `compileDebugKotlin` task as
43
+ // soon as their app's `compileDebugJavaWithJavac` runs at 17.
40
44
  compileOptions {
41
- sourceCompatibility JavaVersion.VERSION_1_8
42
- targetCompatibility JavaVersion.VERSION_1_8
45
+ sourceCompatibility JavaVersion.VERSION_17
46
+ targetCompatibility JavaVersion.VERSION_17
43
47
  }
44
48
 
45
49
  kotlinOptions {
46
- jvmTarget = '1.8'
50
+ jvmTarget = '17'
47
51
  }
48
52
 
49
53
  sourceSets {
@@ -72,7 +76,7 @@ dependencies {
72
76
  if (findProject(':very-sdk') != null) {
73
77
  implementation project(':very-sdk')
74
78
  } else {
75
- implementation "org.very:sdk:${project.findProperty('verySDKVersion') ?: '1.0.30'}"
79
+ implementation "org.very:sdk:${project.findProperty('verySDKVersion') ?: '1.0.34'}"
76
80
  }
77
81
  }
78
82
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veryai/react-native-sdk",
3
- "version": "1.0.30",
3
+ "version": "1.0.34",
4
4
  "description": "React Native wrapper for Very SDK - Palm biometrics verification",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -10,14 +10,32 @@ Pod::Spec.new do |s|
10
10
  s.author = { "Very Mobile Inc." => "mail@very.org" }
11
11
  s.source = { :git => "https://github.com/veroslabs/very-sdk.git", :tag => s.version }
12
12
  s.platform = :ios, "13.0"
13
-
14
- s.source_files = "ios/**/*.{swift,h,m,mm}"
15
- s.dependency "VerySDK", "1.0.30"
16
13
  s.swift_version = "5.0"
17
14
 
18
- if respond_to?(:install_modules_dependencies, true)
19
- install_modules_dependencies(s)
20
- else
21
- s.dependency "React-Core"
15
+ # Mirror VerySDK's Core + Bundled subspecs so RN partners can pick
16
+ # the same way native iOS partners do:
17
+ # pod 'veryai-react-native-sdk' # → Bundled (default)
18
+ # pod 'veryai-react-native-sdk/Core' # → slim, CDN download
19
+ #
20
+ # Without this, the wrapper's `s.dependency "VerySDK"` would always
21
+ # resolve VerySDK's default_subspecs = ['Bundled'], and a partner
22
+ # adding `pod 'VerySDK/Core'` to their app Podfile would just get
23
+ # the union (= Bundled wins), defeating the slim option.
24
+ s.default_subspecs = ['Bundled']
25
+
26
+ s.subspec 'Core' do |core|
27
+ core.source_files = "ios/**/*.{swift,h,m,mm}"
28
+ core.dependency "VerySDK/Core", "1.0.34"
29
+
30
+ if respond_to?(:install_modules_dependencies, true)
31
+ install_modules_dependencies(core)
32
+ else
33
+ core.dependency "React-Core"
34
+ end
35
+ end
36
+
37
+ s.subspec 'Bundled' do |bundled|
38
+ bundled.dependency 'veryai-react-native-sdk/Core'
39
+ bundled.dependency 'VerySDK/Bundled', "1.0.34"
22
40
  end
23
41
  end