@app-swiss-knife/react-native-sdk 0.2.7 → 0.3.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.
Files changed (66) hide show
  1. package/README.md +100 -47
  2. package/SwissKnifePurchases.podspec +8 -5
  3. package/android/vendor/java/com/appswissknife/context/DeviceContext.kt +1 -1
  4. package/android/vendor/java/com/appswissknife/net/IngestClient.kt +1 -1
  5. package/ios/SwissKnifeCrashReporting.swift +59 -18
  6. package/ios/vendor/SwissKnifeiOS/Context/DeviceContext.swift +1 -1
  7. package/ios/vendor/SwissKnifeiOS/Context/Reachability.swift +1 -1
  8. package/ios/vendor/SwissKnifeiOS/CrashReporting/SKCrashReporting.swift +51 -1
  9. package/ios/vendor/SwissKnifeiOS/DeviceID.swift +22 -1
  10. package/ios/vendor/SwissKnifeiOS/Identity/Identity.swift +105 -7
  11. package/ios/vendor/SwissKnifeiOS/Net/IngestClient.swift +14 -0
  12. package/lib/commonjs/attributes.js +103 -0
  13. package/lib/commonjs/attributes.js.map +1 -0
  14. package/lib/commonjs/index.js +31 -2
  15. package/lib/commonjs/index.js.map +1 -1
  16. package/lib/commonjs/internal/config.js +237 -0
  17. package/lib/commonjs/internal/config.js.map +1 -0
  18. package/lib/commonjs/purchases.js +152 -209
  19. package/lib/commonjs/purchases.js.map +1 -1
  20. package/lib/commonjs/swiss-knife.js +115 -0
  21. package/lib/commonjs/swiss-knife.js.map +1 -0
  22. package/lib/commonjs/types.js +11 -0
  23. package/lib/commonjs/types.js.map +1 -1
  24. package/lib/module/attributes.js +100 -0
  25. package/lib/module/attributes.js.map +1 -0
  26. package/lib/module/index.js +19 -2
  27. package/lib/module/index.js.map +1 -1
  28. package/lib/module/internal/config.js +225 -0
  29. package/lib/module/internal/config.js.map +1 -0
  30. package/lib/module/purchases.js +132 -198
  31. package/lib/module/purchases.js.map +1 -1
  32. package/lib/module/swiss-knife.js +112 -0
  33. package/lib/module/swiss-knife.js.map +1 -0
  34. package/lib/module/types.js +11 -0
  35. package/lib/module/types.js.map +1 -1
  36. package/lib/typescript/commonjs/attributes.d.ts +41 -0
  37. package/lib/typescript/commonjs/attributes.d.ts.map +1 -0
  38. package/lib/typescript/commonjs/index.d.ts +2 -0
  39. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  40. package/lib/typescript/commonjs/internal/config.d.ts +121 -0
  41. package/lib/typescript/commonjs/internal/config.d.ts.map +1 -0
  42. package/lib/typescript/commonjs/purchases.d.ts +47 -91
  43. package/lib/typescript/commonjs/purchases.d.ts.map +1 -1
  44. package/lib/typescript/commonjs/swiss-knife.d.ts +56 -0
  45. package/lib/typescript/commonjs/swiss-knife.d.ts.map +1 -0
  46. package/lib/typescript/commonjs/types.d.ts +13 -0
  47. package/lib/typescript/commonjs/types.d.ts.map +1 -1
  48. package/lib/typescript/module/attributes.d.ts +41 -0
  49. package/lib/typescript/module/attributes.d.ts.map +1 -0
  50. package/lib/typescript/module/index.d.ts +2 -0
  51. package/lib/typescript/module/index.d.ts.map +1 -1
  52. package/lib/typescript/module/internal/config.d.ts +121 -0
  53. package/lib/typescript/module/internal/config.d.ts.map +1 -0
  54. package/lib/typescript/module/purchases.d.ts +47 -91
  55. package/lib/typescript/module/purchases.d.ts.map +1 -1
  56. package/lib/typescript/module/swiss-knife.d.ts +56 -0
  57. package/lib/typescript/module/swiss-knife.d.ts.map +1 -0
  58. package/lib/typescript/module/types.d.ts +13 -0
  59. package/lib/typescript/module/types.d.ts.map +1 -1
  60. package/package.json +1 -1
  61. package/src/attributes.ts +97 -0
  62. package/src/index.ts +19 -2
  63. package/src/internal/config.ts +233 -0
  64. package/src/purchases.ts +142 -213
  65. package/src/swiss-knife.ts +134 -0
  66. package/src/types.ts +14 -0
@@ -75,9 +75,32 @@ public extension SwissKnife {
75
75
  public let customerInfo: CustomerInfo
76
76
  public let created: Bool
77
77
 
78
- public init(customerInfo: CustomerInfo, created: Bool) {
78
+ /// A NEWER identity change overtook this call before it could
79
+ /// commit, so this login did not take effect — `customerInfo`
80
+ /// describes the identity that WON, not the one asked for here.
81
+ ///
82
+ /// Being superseded is not a failure, and it is not rare. The
83
+ /// launch sequence this SDK's own setup playbook prescribes —
84
+ /// identify with a bootstrap id, then switch to the real account
85
+ /// (or log out) once the auth listener resolves — produces exactly
86
+ /// this, on every single launch. The earlier call is obsolete
87
+ /// because the host itself said so a moment later; reporting that
88
+ /// as an error trained whole teams to ignore identity errors.
89
+ ///
90
+ /// Hosts that only care about the end state can ignore this flag:
91
+ /// the winning identity is already applied SDK-wide by the time it
92
+ /// is set. Hosts that dispatch on their own call's outcome should
93
+ /// check it before treating the result as "user X is now current".
94
+ public let superseded: Bool
95
+
96
+ public init(
97
+ customerInfo: CustomerInfo,
98
+ created: Bool,
99
+ superseded: Bool = false
100
+ ) {
79
101
  self.customerInfo = customerInfo
80
102
  self.created = created
103
+ self.superseded = superseded
81
104
  }
82
105
  }
83
106
 
@@ -119,6 +142,30 @@ public extension SwissKnife {
119
142
  }
120
143
  }
121
144
 
145
+ /// In-flight `logIn` calls, keyed by the user id they are installing.
146
+ ///
147
+ /// Auth-state listeners fire more than once per launch as a matter of
148
+ /// routine — typically once from cached credentials and again when the
149
+ /// network confirms them — so two `logIn(sameUser)` calls overlapping
150
+ /// is the normal case, not an edge one. Left to race, the second bumps
151
+ /// `identityGeneration`, the first fails its TOCTOU guard, and the host
152
+ /// is handed a `CancellationError` for a login that in fact succeeded:
153
+ /// `[swiss-knife] Identity.logIn failed: ... Swift.CancellationError`
154
+ /// on EVERY launch, with the subject nonetheless attached to every
155
+ /// event and crash report. That was a real field report, and the log
156
+ /// was the only symptom — which is worse than it sounds, because it
157
+ /// trained everyone to ignore identity errors.
158
+ ///
159
+ /// Coalescing removes the race at the source instead of teaching the
160
+ /// guard to forgive it: overlapping calls for the SAME id share one
161
+ /// identify POST and one result, so neither can supersede the other.
162
+ /// Calls for a DIFFERENT id (or a `logOut` / `reset` / `wipe`) still
163
+ /// race, and the generation counter still decides them — that conflict
164
+ /// is genuine and the loser must still be invalidated.
165
+ ///
166
+ /// Guarded by `queue`, like every other piece of state on this type.
167
+ private static var inFlightLogIns: [String: Task<LogInResult, Error>] = [:]
168
+
122
169
  /// Identify this device as a known user. POSTs the
123
170
  /// `(anonymous_id, user_id)` pair to `/api/sdk/users/identify` so
124
171
  /// the backend can merge the anonymous → identified user record,
@@ -129,6 +176,9 @@ public extension SwissKnife {
129
176
  /// The backend call uses a bounded exponential-backoff retry
130
177
  /// (1/2/4s with jitter, cap 3) so transient 5xx doesn't lose the
131
178
  /// identify side effect.
179
+ ///
180
+ /// Concurrent calls for the SAME user id are coalesced onto one
181
+ /// request — see `inFlightLogIns`.
132
182
  @discardableResult
133
183
  public static func logIn(_ userId: String) async throws -> LogInResult {
134
184
  // Gates on CORE, not on the purchase engine. Identity is a core
@@ -139,6 +189,25 @@ public extension SwissKnife {
139
189
  guard SwissKnife.isCoreConfigured else { throw PurchasesError.notConfigured }
140
190
  precondition(!userId.isEmpty, "logIn requires a non-empty userId")
141
191
 
192
+ // Join an identical login already in flight rather than starting a
193
+ // second one that would only race the first. Both callers await the
194
+ // same task, so both observe the same outcome — success or failure.
195
+ let work: Task<LogInResult, Error> = queue.sync {
196
+ if let existing = inFlightLogIns[userId] { return existing }
197
+ let started = Task { try await performLogIn(userId) }
198
+ inFlightLogIns[userId] = started
199
+ return started
200
+ }
201
+ return try await work.value
202
+ }
203
+
204
+ /// The actual login. Only ever entered once per (user id, in-flight
205
+ /// window) — see `inFlightLogIns`.
206
+ private static func performLogIn(_ userId: String) async throws -> LogInResult {
207
+ // Clear the slot on EVERY exit, including the throwing ones: a
208
+ // failed login must not pin its own failure onto later attempts.
209
+ defer { queue.sync { inFlightLogIns.removeValue(forKey: userId) } }
210
+
142
211
  let previous = current
143
212
  let (apiKey, baseURL) = SwissKnife.identityConfigSnapshot()
144
213
  // Bump and capture under the queue — any newer mutation
@@ -159,11 +228,12 @@ public extension SwissKnife {
159
228
  )
160
229
  } catch {
161
230
  // If a newer mutation (logOut/reset/wipe/another logIn)
162
- // has raced past while we were in flight, swallow the
163
- // error — the caller has already moved on. Otherwise
164
- // surface it. Mirrors Android's Round E behaviour.
231
+ // has raced past while we were in flight, the caller has
232
+ // already moved on — report the supersede rather than this
233
+ // call's own network error, which describes an operation
234
+ // whose outcome no longer matters.
165
235
  let racedPast: Bool = queue.sync { identityGeneration != myGeneration }
166
- if racedPast { throw CancellationError() }
236
+ if racedPast { return try await supersededResult(created: false) }
167
237
  throw error
168
238
  }
169
239
 
@@ -173,7 +243,7 @@ public extension SwissKnife {
173
243
  // mutation's intent wins. Mirrors Android's Round E fix.
174
244
  let generationAfterNetwork: Int = queue.sync { identityGeneration }
175
245
  if generationAfterNetwork != myGeneration {
176
- throw CancellationError()
246
+ return try await supersededResult(created: result.created)
177
247
  }
178
248
 
179
249
  let newSnapshot = Snapshot(
@@ -188,7 +258,7 @@ public extension SwissKnife {
188
258
  return true
189
259
  }
190
260
  guard applied else {
191
- throw CancellationError()
261
+ return try await supersededResult(created: result.created)
192
262
  }
193
263
  // Push the user-id into the rest of the SDK so subscriptions and
194
264
  // attributes get the new identity.
@@ -202,6 +272,21 @@ public extension SwissKnife {
202
272
  return LogInResult(customerInfo: info, created: result.created)
203
273
  }
204
274
 
275
+ /// Describe an identity change that overtook an in-flight `logIn`.
276
+ ///
277
+ /// Reports the identity that WON, which is the only one the caller can
278
+ /// usefully act on: by the time this runs, the newer change is already
279
+ /// applied SDK-wide. Prefers the cached snapshot and only reaches the
280
+ /// network when there is none — at launch, which is precisely when
281
+ /// supersedes happen, the cache is usually still empty.
282
+ private static func supersededResult(created: Bool) async throws -> LogInResult {
283
+ if let cached = EntitlementsService.shared.current() {
284
+ return LogInResult(customerInfo: cached, created: created, superseded: true)
285
+ }
286
+ let info = try await EntitlementsService.shared.refresh()
287
+ return LogInResult(customerInfo: info, created: created, superseded: true)
288
+ }
289
+
205
290
  /// Revert to anonymous. The DeviceID is NOT regenerated — Phase 1
206
291
  /// keeps it stable across logout (analytics continuity for the
207
292
  /// same physical install). Use `wipe()` for a full identity reset.
@@ -209,6 +294,16 @@ public extension SwissKnife {
209
294
  // Core gate — see `logIn(_:)`.
210
295
  guard SwissKnife.isCoreConfigured else { throw PurchasesError.notConfigured }
211
296
  let previous = current
297
+ // NOTE: this bumps even when already anonymous, and that is
298
+ // deliberate. Skipping the bump looks like a free optimisation for
299
+ // the launch-time "signed out before the first sign-in resolved"
300
+ // case, but a `logIn` may be IN FLIGHT with nothing committed yet:
301
+ // the host said log out, so it must win over that login too, and a
302
+ // no-op here would let the login land afterwards and re-identify.
303
+ // `test_logIn_thenImmediate_logOut_doesNotReidentify` pins it.
304
+ //
305
+ // The bump costs nothing now that being superseded returns a
306
+ // flagged result instead of throwing `CancellationError`.
212
307
  let anonId = previous.anonymousId
213
308
  let newSnapshot = Snapshot(anonymousId: anonId, userId: nil)
214
309
  // Bump generation BEFORE clearing state so any in-flight `logIn`
@@ -295,6 +390,9 @@ public extension SwissKnife {
295
390
  observers.removeAll()
296
391
  network = BackendHttpClientIdentityNetwork()
297
392
  identityGeneration = 0
393
+ // A task left over from a previous test would otherwise be
394
+ // joined by the next one and replay its result.
395
+ inFlightLogIns.removeAll()
298
396
  }
299
397
  }
300
398
 
@@ -471,6 +471,20 @@ internal final class IngestClient: @unchecked Sendable {
471
471
  }
472
472
  if !deadLetterItems.isEmpty {
473
473
  queue.deadLetter(deadLetterItems)
474
+ // Dead-lettering used to be completely silent. A crash report
475
+ // the server rejects for a schema mismatch is indistinguishable
476
+ // from a crash that never happened — same empty dashboard, no
477
+ // error anywhere, and the item is gone from the live queue. Say
478
+ // so, with the server's own reason and the item types, so the
479
+ // next "we get no crashes" investigation starts from a fact.
480
+ os_log(
481
+ "IngestClient dead-lettered %d item(s) rejected by the server: %{public}@ | reasons: %{public}@",
482
+ log: log,
483
+ type: .error,
484
+ deadLetterItems.count,
485
+ deadLetterItems.map { $0.type.rawValue }.joined(separator: ","),
486
+ result.errors.map { $0.error }.joined(separator: " | ")
487
+ )
474
488
  }
475
489
  try queue.remove(ids: Set(batch.map { $0.id }))
476
490
  // If the batch was the full size, there might be more — loop.
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Attributes = void 0;
7
+ var _module = require("./native/module.js");
8
+ var _config = require("./internal/config.js");
9
+ // packages/react-native-sdk/src/attributes.ts
10
+ //
11
+ // Subscriber attributes as a peer namespace, alongside `Identity`,
12
+ // `Attribution`, `Analytics`, `CrashReporting` and `Performance`.
13
+ //
14
+ // ## Why this is not on `Purchases`
15
+ //
16
+ // Attributes describe the *person*, not the purchase. They are the only path to
17
+ // `POST /api/sdk/users/attributes` → `app_users.properties`, which is what the
18
+ // dashboard person card renders — and an app with no in-app purchases at all
19
+ // still wants that card filled in. Reaching it through an object named
20
+ // `Purchases` is a false statement about what the call does, and in practice it
21
+ // is the single hardest surface in this SDK to find: "which call fills the
22
+ // person card?" was the question that cost our integrators the most time.
23
+ //
24
+ // It also disagreed with the guard. These five have been gated on
25
+ // `throwIfCoreNotConfigured` — *not* the purchase guard — since the
26
+ // core/purchases split, precisely because a `configureCore` app (another
27
+ // library owns the store) must still be able to set them. A method that works
28
+ // without the store had no business living on the store namespace.
29
+ //
30
+ // ## Method naming
31
+ //
32
+ // `set` rather than `setAttributes`: `Attributes.setAttributes({...})` stutters,
33
+ // and the namespace already says what is being set. The four reserved keys keep
34
+ // their `setX` spelling — `Attributes.setEmail(...)` reads correctly, does not
35
+ // stutter, and matches the native spelling on both platforms
36
+ // (`SwissKnife.setEmail` on iOS, the `setEmail` bridge method on Android), so
37
+ // there is one name to learn across all three SDKs. Dropping the prefix
38
+ // (`Attributes.email(...)`) would read as a getter.
39
+ //
40
+ // The RC-compatible spellings on `Purchases` are the *same function objects* as
41
+ // these — see `src/internal/config.ts` for why that matters and
42
+ // `src/namespaces.test.ts` for the assertion.
43
+
44
+ /**
45
+ * Set arbitrary subscriber attributes. `null` clears an attribute.
46
+ *
47
+ * Works after `SwissKnife.configure`, `SwissKnife.configureCore`, or
48
+ * `Analytics.init` — the store does not have to be ours, and does not have to
49
+ * exist.
50
+ */
51
+ async function set(attributes) {
52
+ await (0, _config.throwIfCoreNotConfigured)();
53
+ return (0, _module.getNativeModule)().setAttributes(attributes);
54
+ }
55
+
56
+ /** Reserved attribute: email. `null` clears it. */
57
+ async function setEmail(email) {
58
+ await (0, _config.throwIfCoreNotConfigured)();
59
+ return (0, _module.getNativeModule)().setEmail(email);
60
+ }
61
+
62
+ /** Reserved attribute: display name. `null` clears it. */
63
+ async function setDisplayName(displayName) {
64
+ await (0, _config.throwIfCoreNotConfigured)();
65
+ return (0, _module.getNativeModule)().setDisplayName(displayName);
66
+ }
67
+
68
+ /** Reserved attribute: phone number. `null` clears it. */
69
+ async function setPhoneNumber(phoneNumber) {
70
+ await (0, _config.throwIfCoreNotConfigured)();
71
+ return (0, _module.getNativeModule)().setPhoneNumber(phoneNumber);
72
+ }
73
+
74
+ /** Reserved attribute: push token. `null` clears it. */
75
+ async function setPushToken(pushToken) {
76
+ await (0, _config.throwIfCoreNotConfigured)();
77
+ return (0, _module.getNativeModule)().setPushToken(pushToken);
78
+ }
79
+
80
+ /**
81
+ * Subscriber attributes — the data behind the dashboard person card.
82
+ *
83
+ * ```ts
84
+ * import { Attributes } from "@app-swiss-knife/react-native-sdk";
85
+ *
86
+ * await Attributes.setEmail("ann@example.com");
87
+ * await Attributes.setDisplayName("Ann");
88
+ * await Attributes.set({ plan: "gold", cohort: "2026-08" });
89
+ * await Attributes.set({ cohort: null }); // clear
90
+ * ```
91
+ *
92
+ * Every method requires core to be configured and rejects with
93
+ * `UninitializedPurchasesError` otherwise. None of them touch StoreKit or Play
94
+ * Billing.
95
+ */
96
+ const Attributes = exports.Attributes = {
97
+ set,
98
+ setEmail,
99
+ setDisplayName,
100
+ setPhoneNumber,
101
+ setPushToken
102
+ };
103
+ //# sourceMappingURL=attributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_module","require","_config","set","attributes","throwIfCoreNotConfigured","getNativeModule","setAttributes","setEmail","email","setDisplayName","displayName","setPhoneNumber","phoneNumber","setPushToken","pushToken","Attributes","exports"],"sourceRoot":"../../src","sources":["attributes.ts"],"mappings":";;;;;;AAmCA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AApCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeE,GAAGA,CAACC,UAAyC,EAAiB;EAC3E,MAAM,IAAAC,gCAAwB,EAAC,CAAC;EAChC,OAAO,IAAAC,uBAAe,EAAC,CAAC,CAACC,aAAa,CAACH,UAAU,CAAC;AACpD;;AAEA;AACA,eAAeI,QAAQA,CAACC,KAAoB,EAAiB;EAC3D,MAAM,IAAAJ,gCAAwB,EAAC,CAAC;EAChC,OAAO,IAAAC,uBAAe,EAAC,CAAC,CAACE,QAAQ,CAACC,KAAK,CAAC;AAC1C;;AAEA;AACA,eAAeC,cAAcA,CAACC,WAA0B,EAAiB;EACvE,MAAM,IAAAN,gCAAwB,EAAC,CAAC;EAChC,OAAO,IAAAC,uBAAe,EAAC,CAAC,CAACI,cAAc,CAACC,WAAW,CAAC;AACtD;;AAEA;AACA,eAAeC,cAAcA,CAACC,WAA0B,EAAiB;EACvE,MAAM,IAAAR,gCAAwB,EAAC,CAAC;EAChC,OAAO,IAAAC,uBAAe,EAAC,CAAC,CAACM,cAAc,CAACC,WAAW,CAAC;AACtD;;AAEA;AACA,eAAeC,YAAYA,CAACC,SAAwB,EAAiB;EACnE,MAAM,IAAAV,gCAAwB,EAAC,CAAC;EAChC,OAAO,IAAAC,uBAAe,EAAC,CAAC,CAACQ,YAAY,CAACC,SAAS,CAAC;AAClD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG;EACxBb,GAAG;EACHK,QAAQ;EACRE,cAAc;EACdE,cAAc;EACdE;AACF,CAAC","ignoreList":[]}
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  var _exportNames = {
7
7
  Purchases: true,
8
+ SwissKnife: true,
9
+ Attributes: true,
8
10
  Identity: true,
9
11
  Attribution: true,
10
12
  Analytics: true,
@@ -21,6 +23,12 @@ Object.defineProperty(exports, "Analytics", {
21
23
  return _analytics.Analytics;
22
24
  }
23
25
  });
26
+ Object.defineProperty(exports, "Attributes", {
27
+ enumerable: true,
28
+ get: function () {
29
+ return _attributes.Attributes;
30
+ }
31
+ });
24
32
  Object.defineProperty(exports, "Attribution", {
25
33
  enumerable: true,
26
34
  get: function () {
@@ -69,6 +77,12 @@ Object.defineProperty(exports, "SKRevenue", {
69
77
  return _analytics.SKRevenue;
70
78
  }
71
79
  });
80
+ Object.defineProperty(exports, "SwissKnife", {
81
+ enumerable: true,
82
+ get: function () {
83
+ return _swissKnife.SwissKnife;
84
+ }
85
+ });
72
86
  exports.default = void 0;
73
87
  Object.defineProperty(exports, "parseStackTrace", {
74
88
  enumerable: true,
@@ -77,6 +91,8 @@ Object.defineProperty(exports, "parseStackTrace", {
77
91
  }
78
92
  });
79
93
  var _purchases = _interopRequireDefault(require("./purchases.js"));
94
+ var _swissKnife = require("./swiss-knife.js");
95
+ var _attributes = require("./attributes.js");
80
96
  var _types = require("./types.js");
81
97
  Object.keys(_types).forEach(function (key) {
82
98
  if (key === "default" || key === "__esModule") return;
@@ -98,9 +114,22 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
98
114
  // src/index.ts
99
115
  // Default export mirrors react-native-purchases: `import Purchases from '...'`.
100
116
  var _default = exports.default = _purchases.default; // Named export of the class for `import { Purchases } from '...'`.
117
+ // The SDK root — bootstrap (`configure`, `configureCore`, `isConfigured`,
118
+ // `isCoreConfigured`, `setLogLevel`) plus a handle on every namespace, so
119
+ // `SwissKnife.` lists the whole SDK. Mirrors the native SDKs, which have rooted
120
+ // everything under `SwissKnife` (iOS) / `com.appswissknife.SwissKnife`
121
+ // (Android) all along; JS had no root at all until now.
122
+ //
123
+ // `Purchases.configure` and friends remain — they are the SAME functions, not
124
+ // wrappers, so mixing the spellings shares one bootstrap state.
125
+ // Subscriber attributes as a peer namespace. This is the surface behind the
126
+ // dashboard person card (`POST /api/sdk/users/attributes`), and it needs only
127
+ // core — an app with no in-app purchases still wants it. The RC-compatible
128
+ // `Purchases.setAttributes` / `setEmail` / … aliases are the same functions.
101
129
  // Public type/enum/error surface (CustomerInfo, PurchasesOfferings,
102
- // PURCHASES_ERROR_CODE, LOG_LEVEL, the enums, PurchasesError, etc.) —
103
- // defined in ./types (Phase 7: own definitions, no RC dependency).
130
+ // PURCHASES_ERROR_CODE, LOG_LEVEL, ConfigureOptions, the enums,
131
+ // PurchasesError, etc.) — defined in ./types (Phase 7: own definitions, no RC
132
+ // dependency).
104
133
  // Wave 1 — unified Identity surface. Routes through native
105
134
  // `SwissKnife.Identity` (iOS) / `com.appswissknife.identity.Identity`
106
135
  // (Android). Decoupled from analytics: `Identity.logIn(...)` does NOT
@@ -1 +1 @@
1
- {"version":3,"names":["_purchases","_interopRequireDefault","require","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_identity","_attribution","_analytics","_crashReporting","_performance","e","__esModule","default","_default","Purchases"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAWA,IAAAC,MAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAOA,IAAAS,SAAA,GAAAd,OAAA;AAQA,IAAAe,YAAA,GAAAf,OAAA;AAOA,IAAAgB,UAAA,GAAAhB,OAAA;AAEA,IAAAiB,eAAA,GAAAjB,OAAA;AAWA,IAAAkB,YAAA,GAAAlB,OAAA;AAAoD,SAAAD,uBAAAoB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AA/CpD;AAGA;AAAA,IAAAG,QAAA,GAAAZ,OAAA,CAAAW,OAAA,GACeE,kBAAS,EAExB;AAGA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["_purchases","_interopRequireDefault","require","_swissKnife","_attributes","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_identity","_attribution","_analytics","_crashReporting","_performance","e","__esModule","default","_default","Purchases"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAgBA,IAAAC,WAAA,GAAAD,OAAA;AAMA,IAAAE,WAAA,GAAAF,OAAA;AAMA,IAAAG,MAAA,GAAAH,OAAA;AAAAI,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAOA,IAAAS,SAAA,GAAAhB,OAAA;AAQA,IAAAiB,YAAA,GAAAjB,OAAA;AAOA,IAAAkB,UAAA,GAAAlB,OAAA;AAEA,IAAAmB,eAAA,GAAAnB,OAAA;AAWA,IAAAoB,YAAA,GAAApB,OAAA;AAAoD,SAAAD,uBAAAsB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAhEpD;AAGA;AAAA,IAAAG,QAAA,GAAAZ,OAAA,CAAAW,OAAA,GACeE,kBAAS,EAExB;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,237 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.configure = configure;
7
+ exports.configureCore = configureCore;
8
+ exports.isConfigured = isConfigured;
9
+ exports.isCoreConfigured = isCoreConfigured;
10
+ exports.nativeBoolean = nativeBoolean;
11
+ exports.resetConfigForTests = resetConfigForTests;
12
+ exports.setLogLevel = setLogLevel;
13
+ exports.throwIfCoreNotConfigured = throwIfCoreNotConfigured;
14
+ exports.throwIfNotConfigured = throwIfNotConfigured;
15
+ var _module = require("../native/module.js");
16
+ var _types = require("../types.js");
17
+ // src/internal/config.ts
18
+ //
19
+ // The SDK's bootstrap: the process-wide "have we been configured?" state, the
20
+ // two configure entry points, the two readback flags, the log level, and the
21
+ // guards every public surface is gated on.
22
+ //
23
+ // ## Why this is a module of its own rather than statics on a namespace
24
+ //
25
+ // `SwissKnife.configure(...)` and `Purchases.configure(...)` are one call under
26
+ // two names. If each namespace owned its own copy of `configured` /
27
+ // `coreConfigured`, an app that bootstrapped through one name and then used a
28
+ // surface guarded by the other would be told it had never configured anything —
29
+ // precisely the class of bug a namespace split invites. There is exactly one
30
+ // implementation here, and every public namespace exports a *reference to it*.
31
+ // That makes `SwissKnife.configure === Purchases.configure` literally true (and
32
+ // `Attributes.set === Purchases.setAttributes`, and so on), so the compatibility
33
+ // aliases cannot drift from the canonical methods by construction rather than by
34
+ // diligence. Pinned in `src/namespaces.test.ts`.
35
+ //
36
+ // Nothing in here is part of the published API. It is reachable via the
37
+ // package's `./*` subpath export, as every file under `src/` is; the `internal/`
38
+ // segment is the signal not to.
39
+
40
+ let configured = false;
41
+ let configuredApiKey = null;
42
+ let coreConfigured = false;
43
+
44
+ /**
45
+ * Read a boolean off the native module without ever letting a missing native
46
+ * module escape as an exception.
47
+ *
48
+ * `getNativeModule()` THROWS when the module is not linked (Expo Go, a bare RN
49
+ * app that skipped `pod install` / a Gradle sync, web) — precisely the state a
50
+ * developer is in while wiring the SDK up, and precisely when they are most
51
+ * likely to be calling one of these accessors to find out what is wrong. A
52
+ * boolean accessor rejecting with "native module is not linked" is a worse
53
+ * answer than `false`: an unlinked module cannot have configured anything, so
54
+ * `false` is not merely safe, it is correct.
55
+ *
56
+ * The `.catch` covers the adjacent case where the module IS linked but predates
57
+ * the method (JS upgraded without rebuilding the app) — same reasoning, same
58
+ * answer. Mirrors the tolerance `Analytics.init` already applies to
59
+ * `configureObservability`.
60
+ */
61
+ function nativeBoolean(read) {
62
+ try {
63
+ return Promise.resolve(read((0, _module.getNativeModule)())).catch(() => false);
64
+ } catch {
65
+ return Promise.resolve(false);
66
+ }
67
+ }
68
+
69
+ /**
70
+ * Configure the SDK. Must be called before any other method. Calling again
71
+ * with the same API key is a no-op (matches the common "configure once" guard);
72
+ * the native layer owns full reconfiguration.
73
+ */
74
+ function configure(options) {
75
+ if (configured && configuredApiKey === options.apiKey) return;
76
+ const native = (0, _module.getNativeModule)();
77
+ const nativeOptions = {
78
+ apiKey: options.apiKey,
79
+ appUserID: options.appUserID ?? null,
80
+ // proxyURL points the native SDK at the Swiss Knife backend. Without it the
81
+ // native layer falls back to its hardcoded default host (api.swiss-knife.dev),
82
+ // which is unreachable for self-hosted tenants. Forward it so callers can
83
+ // target their own backend (e.g. https://swiss.remneys.com).
84
+ proxyURL: options.proxyURL ?? null,
85
+ // Hardening pass (spec): diagnostics opt-in only — default OFF.
86
+ diagnosticsEnabled: options.diagnosticsEnabled ?? false,
87
+ storeKitVersion: options.storeKitVersion,
88
+ useAmazon: options.useAmazon,
89
+ // iOS ATT — default off (no tracking prompt) unless the host opts in.
90
+ autoPromptATT: options.autoPromptATT,
91
+ sendInstallOnFirstLaunch: options.sendInstallOnFirstLaunch,
92
+ logLevel: options.logLevel
93
+ };
94
+ // Fire-and-forget: native configure resolves async but RC's configure is sync.
95
+ void native.configure(nativeOptions);
96
+ configured = true;
97
+ coreConfigured = true;
98
+ configuredApiKey = options.apiKey;
99
+ }
100
+
101
+ /**
102
+ * Configure everything EXCEPT the store: ingest, `Identity`, `Attribution`,
103
+ * `Attributes`.
104
+ *
105
+ * Use this when another library already owns in-app purchases. `configure`
106
+ * starts a `StoreKit.Transaction.updates` observer on iOS (whose handler
107
+ * calls `transaction.finish()`) and builds a `BillingClient` on Android —
108
+ * both of which contend with an incumbent IAP SDK. `configureCore` creates
109
+ * neither, and registers no install as a side effect.
110
+ *
111
+ * Analytics-only apps don't even need this: `Analytics.init(...)` already
112
+ * wires core natively. Reach for `configureCore` when you want to pass an
113
+ * `appUserID`, an attribution configuration, or a log level up front.
114
+ */
115
+ function configureCore(options) {
116
+ if (coreConfigured && configuredApiKey === options.apiKey) return;
117
+ const native = (0, _module.getNativeModule)();
118
+ const nativeOptions = {
119
+ apiKey: options.apiKey,
120
+ appUserID: options.appUserID ?? null,
121
+ proxyURL: options.proxyURL ?? null,
122
+ diagnosticsEnabled: options.diagnosticsEnabled ?? false,
123
+ autoPromptATT: options.autoPromptATT,
124
+ // Forwarded but inert on this path — core never auto-registers an
125
+ // install. Kept on the payload so the same options object can be handed
126
+ // to `configure` later without surprises.
127
+ sendInstallOnFirstLaunch: options.sendInstallOnFirstLaunch,
128
+ logLevel: options.logLevel
129
+ };
130
+ void native.configureCore(nativeOptions);
131
+ coreConfigured = true;
132
+ configuredApiKey = options.apiKey;
133
+ }
134
+
135
+ /**
136
+ * Whether the PURCHASE engine has been configured — i.e. whether the store
137
+ * APIs (`getOfferings`, `purchasePackage`, `restorePurchases`, …) can work.
138
+ *
139
+ * **Native is the source of truth.** This does not consult the JS-side
140
+ * "configure was called" flag: a brownfield app can configure the SDK from
141
+ * native code, and `configure` itself is fire-and-forget, so the JS flag is a
142
+ * request, not a fact.
143
+ *
144
+ * Never throws and never rejects. Resolves `false` when the native module is
145
+ * not linked — see {@link nativeBoolean}. Exactly the same failure semantics
146
+ * as {@link isCoreConfigured}; the two differ only in which native flag they
147
+ * report.
148
+ */
149
+ function isConfigured() {
150
+ return nativeBoolean(native => native.isConfigured());
151
+ }
152
+
153
+ /**
154
+ * Whether the CORE (ingest / Identity / Attribution / Attributes) is
155
+ * configured. True after `configure`, `configureCore`, or `Analytics.init`.
156
+ *
157
+ * **Native is the source of truth**, and here that is load-bearing rather
158
+ * than merely principled: `Analytics.init` wires core natively via
159
+ * `configureObservability` and touches no JS configure flag, so an
160
+ * analytics-only app has core configured while every JS flag reads false.
161
+ * Short-circuiting on JS state would report `false` in the single most
162
+ * common core-only integration.
163
+ *
164
+ * Never throws and never rejects. Resolves `false` when the native module is
165
+ * not linked — see {@link nativeBoolean}.
166
+ */
167
+ function isCoreConfigured() {
168
+ return nativeBoolean(native => native.isCoreConfigured());
169
+ }
170
+
171
+ /**
172
+ * Set the native log level. Process-wide: it is read by the store engine, the
173
+ * ingest client, Identity, Attribution and the observability modules alike,
174
+ * which is why it belongs on the SDK root and not on any one namespace.
175
+ *
176
+ * Deliberately ungated — a log level you can only raise *after* a successful
177
+ * configure is useless for debugging a configure that is going wrong. It does
178
+ * still require the native module to be linked, and rejects if it is not.
179
+ */
180
+ function setLogLevel(level) {
181
+ return (0, _module.getNativeModule)().setLogLevel(level);
182
+ }
183
+
184
+ /**
185
+ * Guard for surfaces that genuinely need the PURCHASE engine — `getOfferings`,
186
+ * `purchasePackage`, `restorePurchases` and friends. Checks the JS "configure
187
+ * was called" flag.
188
+ *
189
+ * The RC-parity identity aliases used to sit here too, on the grounds that the
190
+ * legacy native bridge methods they called meant different things on iOS and
191
+ * Android. They now delegate to `Identity` and sit on
192
+ * {@link throwIfCoreNotConfigured} — see the block above `Purchases.logIn`.
193
+ */
194
+ function throwIfNotConfigured() {
195
+ if (!configured) {
196
+ throw new _types.UninitializedPurchasesError();
197
+ }
198
+ }
199
+
200
+ /**
201
+ * Guard for surfaces that only need CORE — the `Attributes` setters.
202
+ *
203
+ * Attributes describe the *person*, not the purchase: natively they land in
204
+ * `AttributesClient` → `POST /api/sdk/users/attributes` → `app_users.properties`,
205
+ * which is what the dashboard person card reads. Neither platform's attributes
206
+ * path touches StoreKit or Play Billing — iOS gates on `SwissKnife.isCoreConfigured`
207
+ * (`SwissKnife.currentAnonymousIdForAttributes`), and Android's `configureCore`
208
+ * wires `AttributesClient` with an `Identity`-snapshot id fallback precisely so a
209
+ * store-less app still resolves ids. Gating these on the purchase flag left an app
210
+ * that uses `configureCore` (because another library owns the store) with **no way
211
+ * at all** to populate the person card.
212
+ *
213
+ * Two-step check, and the second step is load-bearing:
214
+ *
215
+ * 1. The JS flag, set by `configure` / `configureCore`. Free, no bridge hop.
216
+ * 2. Native truth. `Analytics.init(...)` wires core natively via
217
+ * `configureObservability` and touches no JS flag, so an analytics-only app
218
+ * has core configured while every JS flag reads `false` — exactly the case
219
+ * {@link isCoreConfigured} documents. Skipping this step would keep the most
220
+ * common core-only integration broken.
221
+ *
222
+ * Never consults the purchase flag. Strictly more permissive than
223
+ * {@link throwIfNotConfigured}, so no existing caller can break.
224
+ */
225
+ async function throwIfCoreNotConfigured() {
226
+ if (coreConfigured) return;
227
+ if (await nativeBoolean(native => native.isCoreConfigured())) return;
228
+ throw new _types.UninitializedPurchasesError("Swiss Knife core is not configured. Call SwissKnife.configure(), " + "SwissKnife.configureCore(), or Analytics.init() first.");
229
+ }
230
+
231
+ /** @internal Test seam: drop the process-wide configure state. */
232
+ function resetConfigForTests() {
233
+ configured = false;
234
+ coreConfigured = false;
235
+ configuredApiKey = null;
236
+ }
237
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_module","require","_types","configured","configuredApiKey","coreConfigured","nativeBoolean","read","Promise","resolve","getNativeModule","catch","configure","options","apiKey","native","nativeOptions","appUserID","proxyURL","diagnosticsEnabled","storeKitVersion","useAmazon","autoPromptATT","sendInstallOnFirstLaunch","logLevel","configureCore","isConfigured","isCoreConfigured","setLogLevel","level","throwIfNotConfigured","UninitializedPurchasesError","throwIfCoreNotConfigured","resetConfigForTests"],"sourceRoot":"../../../src","sources":["internal/config.ts"],"mappings":"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","ignoreList":[]}