@onramper/onramper-react-native 1.3.0 → 1.4.0

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 (41) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/README.md +33 -0
  3. package/ios/Frameworks/OnramperSDK.xcframework/Info.plist +5 -5
  4. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/Info.plist +0 -0
  5. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  6. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios.swiftinterface +3 -0
  7. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/OnramperSDK +0 -0
  8. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/OnramperSDK_OnramperSDK.bundle/Info.plist +0 -0
  9. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/DWARF/OnramperSDK +0 -0
  10. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/OnramperSDK.yml +3917 -3560
  11. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Info.plist +0 -0
  12. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  13. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +3 -0
  14. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  15. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +3 -0
  16. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/OnramperSDK +0 -0
  17. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/OnramperSDK_OnramperSDK.bundle/Info.plist +0 -0
  18. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/DWARF/OnramperSDK +0 -0
  19. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/OnramperSDK.yml +3917 -3560
  20. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/x86_64/OnramperSDK.yml +3862 -3523
  21. package/ios/HybridOnramperNitro.swift +2 -0
  22. package/lib/commonjs/OnramperClient.js +15 -0
  23. package/lib/commonjs/OnramperClient.js.map +1 -1
  24. package/lib/module/OnramperClient.js +15 -0
  25. package/lib/module/OnramperClient.js.map +1 -1
  26. package/lib/typescript/commonjs/src/OnramperClient.d.ts +8 -0
  27. package/lib/typescript/commonjs/src/OnramperClient.d.ts.map +1 -1
  28. package/lib/typescript/commonjs/src/specs/OnramperNitro.nitro.d.ts +1 -0
  29. package/lib/typescript/commonjs/src/specs/OnramperNitro.nitro.d.ts.map +1 -1
  30. package/lib/typescript/module/src/OnramperClient.d.ts +8 -0
  31. package/lib/typescript/module/src/OnramperClient.d.ts.map +1 -1
  32. package/lib/typescript/module/src/specs/OnramperNitro.nitro.d.ts +1 -0
  33. package/lib/typescript/module/src/specs/OnramperNitro.nitro.d.ts.map +1 -1
  34. package/nitrogen/generated/ios/c++/HybridOnramperNitroSpecSwift.hpp +5 -2
  35. package/nitrogen/generated/ios/swift/HybridOnramperNitroSpec.swift +1 -1
  36. package/nitrogen/generated/ios/swift/HybridOnramperNitroSpec_cxx.swift +6 -1
  37. package/nitrogen/generated/shared/c++/HybridOnramperNitroSpec.cpp +1 -0
  38. package/nitrogen/generated/shared/c++/HybridOnramperNitroSpec.hpp +2 -2
  39. package/package.json +2 -2
  40. package/src/OnramperClient.ts +16 -0
  41. package/src/specs/OnramperNitro.nitro.ts +2 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,96 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [1.4.0]
6
+
7
+ Bundles `OnramperSDK@1.4.0` from its published, checksum-verified release.
8
+
9
+ Most changes in this release come from
10
+ [OnramperSDK for iOS 1.4.0](https://github.com/onramper/onramper-ios/releases/tag/v1.4.0).
11
+
12
+ ### Added
13
+
14
+ - **Trusted partner login.** If your backend has already verified the user's
15
+ email, add `user: { email }` to the signed `client-sessions` request. On Buy,
16
+ the user is signed in to OnramperID without the email OTP:
17
+ - **Best case:** no login UI at all — the user goes straight to the payment sheet.
18
+ - **Profile fields missing:** only the OnramperID "additional info" form
19
+ appears. There is no OTP screen and no "Grant permission" screen.
20
+ - If an OnramperID account already exists for that email, the user is signed
21
+ in to it; otherwise one is created with the email marked verified.
22
+
23
+ When `user` is sent, the session response also carries
24
+ `trustedLogin: "bound" | "unavailable"`. Trusted login is enabled per
25
+ integration — talk to your Onramper contact. Until it is, every session
26
+ reports `"unavailable"` and sign-in stays the normal OTP flow. It never blocks
27
+ sign-in: on any failure the normal OnramperID sign-in appears, with no error to
28
+ handle. No JavaScript API changed. See
29
+ [Backend session endpoint](docs/BACKEND_SESSION_ENDPOINT.md#trusted-partner-login).
30
+
31
+ ### Changed
32
+
33
+ - `signOut()` also clears the OnramperID web session (no "continue as" the
34
+ previous user), closes an open login sheet without reporting an error, and
35
+ turns trusted login off for that client.
36
+ - When login is needed, the Buy button spins briefly while the SDK checks for a
37
+ trusted login, then the login sheet appears. With a trusted login, the sheet is
38
+ already presented but invisible while the button spins (up to ~15s): your
39
+ screen stays interactive, but it can't present its own modal until the login
40
+ sheet appears or closes.
41
+ - If the OnramperID page can't load, the login sheet shows **Retry** and
42
+ **Close** instead of staying blank. If OnramperID ends sign-in with an error,
43
+ the sheet closes and Buy is tappable again. A stalled sign-in now fails after
44
+ 15 seconds instead of leaving the Buy button spinning.
45
+ - The bare RN demo's Settings screen has a **Trusted partner login** email field
46
+ that re-mints the demo session with `user.email` and re-creates the client.
47
+ The Expo demo has the same field under Credentials, applied on the next
48
+ **Configure + Initialize**.
49
+
50
+ ### Upgrading from 1.3.1
51
+
52
+ - No existing call sites need to change. Run `pod install` and rebuild the native
53
+ app after updating the package.
54
+ - **When your app's signed-in user changes:** call `signOut()`, then `destroy()`
55
+ the client and create and initialize a new `OnramperClient` with a session
56
+ minted for the new user's `user.email`. Without `signOut()`, an existing
57
+ OnramperID login on the device wins and the next checkout reuses the previous
58
+ user's account.
59
+
60
+ ## [1.3.1]
61
+
62
+ Bundles `OnramperSDK@1.3.1` from its published, checksum-verified release.
63
+
64
+ ### Added
65
+
66
+ - **Runtime native SDK version.** `OnramperClient.sdkVersion` returns the iOS SDK
67
+ version actually loaded by the app, as plain semver (for example, `"1.3.1"`).
68
+ It is synchronous and read-only, and requires no client instance, credentials,
69
+ or initialization. Use it in diagnostics, analytics, or a support screen.
70
+
71
+ ```ts
72
+ const sdkVersion = OnramperClient.sdkVersion;
73
+ ```
74
+
75
+ This reports the native SDK version, not the React Native package or app
76
+ version. Do not infer it from the framework bundle's version fields.
77
+
78
+ ### Changed
79
+
80
+ - The bare RN demo's Settings screen now reads the SDK version from native code
81
+ instead of inferring it from the JavaScript package version. The Expo demo
82
+ also shows the native SDK version in its build information.
83
+ - The bare RN demo records TestFlight build number 2 and declares its use of
84
+ exempt encryption in `Info.plist`, avoiding a repeated encryption questionnaire
85
+ for future uploads. Already uploaded builds still need their declaration in
86
+ App Store Connect.
87
+
88
+ ### Upgrading from 1.3.0
89
+
90
+ - Existing checkout, event, error, and logging APIs are unchanged. No existing
91
+ call sites need to change; the runtime version property is optional and iOS-only.
92
+ - Run `pod install` and rebuild the native app after updating the package. A
93
+ JavaScript-only update cannot add the native version getter.
94
+
5
95
  ## [1.3.0]
6
96
 
7
97
  Bundles the published, checksum-verified `OnramperSDK@1.3.0` for iOS.
package/README.md CHANGED
@@ -135,6 +135,21 @@ to start again; calling `initialize()` on a destroyed instance does not revive i
135
135
  These rules release local prepared views; they do not cancel an already submitted
136
136
  payment or guarantee cancellation of a request already sent to the backend.
137
137
 
138
+ When your app's signed-in user changes, call `signOut()`, then `destroy()` the
139
+ client and create and initialize a new `OnramperClient` with a session minted for
140
+ the new user. Without `signOut()`, an existing OnramperID login on the device wins
141
+ and the next checkout reuses the previous user's account.
142
+
143
+ ## Trusted partner login
144
+
145
+ If your backend has already verified the user's email, add `user: { email }` to
146
+ its signed `client-sessions` request. On Buy, the user is signed in to OnramperID
147
+ without the email OTP — with no login UI at all, or only the "additional info"
148
+ form when profile fields are missing. No JavaScript changes are needed; it is
149
+ enabled per integration by Onramper and falls back to the normal OTP sign-in on
150
+ any failure. Available with RN package 1.4.0 or newer. See
151
+ [Backend session endpoint](docs/BACKEND_SESSION_ENDPOINT.md#trusted-partner-login).
152
+
138
153
  ## Diagnostic logs
139
154
 
140
155
  Pass `logLevel: 'info'` (or `'debug'`) and `logHandler: record => yourStore.append(record)`
@@ -147,6 +162,24 @@ See [debugging](docs/DEBUGGING.md) for the record shape and retention guidance.
147
162
  For migration details, including new enum cases and one-time OnramperID sign-in,
148
163
  see [1.3.0 release notes](CHANGELOG.md#130).
149
164
 
165
+ ## Runtime SDK version
166
+
167
+ Read `OnramperClient.sdkVersion` to identify the native iOS SDK loaded by the app:
168
+
169
+ ```ts
170
+ import { OnramperClient } from '@onramper/onramper-react-native';
171
+
172
+ const sdkVersion = OnramperClient.sdkVersion; // e.g. "1.3.1"
173
+ ```
174
+
175
+ This is a synchronous, read-only property. It needs no client instance, API key,
176
+ SDK session, or initialization. Use it in diagnostics and support screens;
177
+ read the RN package version separately from its `package.json`. Wrapper-only
178
+ releases can have a different version from their bundled native SDK.
179
+
180
+ Available on iOS with RN package 1.3.1 or newer. Run `pod install` and rebuild the
181
+ native app after upgrading; a JavaScript-only update cannot add the native getter.
182
+
150
183
  ## Versioning
151
184
 
152
185
  `@onramper/onramper-react-native@X.Y.Z` always bundles `OnramperSDK@X.Y.Z` (iOS). Wrapper-only patches are published as `X.Y.Z-N` pre-releases (`npm install @onramper/onramper-react-native@next` to opt in).
@@ -10,15 +10,18 @@
10
10
  <key>DebugSymbolsPath</key>
11
11
  <string>dSYMs</string>
12
12
  <key>LibraryIdentifier</key>
13
- <string>ios-arm64</string>
13
+ <string>ios-arm64_x86_64-simulator</string>
14
14
  <key>LibraryPath</key>
15
15
  <string>OnramperSDK.framework</string>
16
16
  <key>SupportedArchitectures</key>
17
17
  <array>
18
18
  <string>arm64</string>
19
+ <string>x86_64</string>
19
20
  </array>
20
21
  <key>SupportedPlatform</key>
21
22
  <string>ios</string>
23
+ <key>SupportedPlatformVariant</key>
24
+ <string>simulator</string>
22
25
  </dict>
23
26
  <dict>
24
27
  <key>BinaryPath</key>
@@ -26,18 +29,15 @@
26
29
  <key>DebugSymbolsPath</key>
27
30
  <string>dSYMs</string>
28
31
  <key>LibraryIdentifier</key>
29
- <string>ios-arm64_x86_64-simulator</string>
32
+ <string>ios-arm64</string>
30
33
  <key>LibraryPath</key>
31
34
  <string>OnramperSDK.framework</string>
32
35
  <key>SupportedArchitectures</key>
33
36
  <array>
34
37
  <string>arm64</string>
35
- <string>x86_64</string>
36
38
  </array>
37
39
  <key>SupportedPlatform</key>
38
40
  <string>ios</string>
39
- <key>SupportedPlatformVariant</key>
40
- <string>simulator</string>
41
41
  </dict>
42
42
  </array>
43
43
  <key>CFBundlePackageType</key>
@@ -621,6 +621,9 @@ public struct OnramperConfiguration : Swift.Sendable {
621
621
  public init(apiKey: Swift.String, clientId: Swift.String, environment: OnramperSDK.OnramperConfiguration.Environment = .production, theme: OnramperSDK.OnramperConfiguration.Theme = .system, logLevel: OnramperSDK.LogLevel = .off, logHandler: OnramperSDK.OnramperLogHandler? = nil, isEventLoggingEnabled: Swift.Bool = false, isEventConsoleLoggingEnabled: Swift.Bool = false, sessionExpirationHandler: @escaping @Sendable () async throws -> OnramperSDK.SessionCredentials)
622
622
  #endif
623
623
  }
624
+ extension OnramperSDK.OnramperClient {
625
+ nonisolated public static let sdkVersion: Swift.String
626
+ }
624
627
  public enum OnramperState : Swift.Sendable {
625
628
  case idle
626
629
  case initializing