@wireai/activation 0.11.0 → 0.12.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 (58) hide show
  1. package/AGENTS.md +51 -0
  2. package/CHANGELOG.md +58 -3
  3. package/INTEGRATION_PROMPT.md +13 -1
  4. package/README.md +73 -0
  5. package/dist/analytics/index.d.mts +17 -6
  6. package/dist/analytics/index.d.ts +17 -6
  7. package/dist/analytics/index.js +130 -35
  8. package/dist/analytics/index.js.map +1 -1
  9. package/dist/analytics/index.mjs +126 -36
  10. package/dist/analytics/index.mjs.map +1 -1
  11. package/dist/{currentSession-DdnUq2HQ.d.ts → currentSession-D6RiVtc8.d.ts} +88 -30
  12. package/dist/{currentSession-C0_odnIW.d.mts → currentSession-DsSDHqor.d.mts} +88 -30
  13. package/dist/index.d.mts +236 -36
  14. package/dist/index.d.ts +236 -36
  15. package/dist/index.js +281 -20
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.mjs +269 -21
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/questionnaire/index.d.mts +1 -1
  20. package/dist/questionnaire/index.d.ts +1 -1
  21. package/dist/questionnaire/index.js +49 -6
  22. package/dist/questionnaire/index.js.map +1 -1
  23. package/dist/questionnaire/index.mjs +49 -6
  24. package/dist/questionnaire/index.mjs.map +1 -1
  25. package/dist/reviews/index.d.mts +2 -2
  26. package/dist/reviews/index.d.ts +2 -2
  27. package/dist/reviews/index.js +73 -8
  28. package/dist/reviews/index.js.map +1 -1
  29. package/dist/reviews/index.mjs +73 -8
  30. package/dist/reviews/index.mjs.map +1 -1
  31. package/dist/{transport-BGW9uXZJ.d.mts → transport-CF_eHwzC.d.mts} +15 -1
  32. package/dist/{transport-jUJd5kxu.d.ts → transport-DsRe4epC.d.ts} +15 -1
  33. package/llms.txt +1 -0
  34. package/package.json +1 -1
  35. package/src/activation/useWireActivation.ts +12 -1
  36. package/src/activation/wireActivation.ts +36 -24
  37. package/src/analytics/analyticsFacade.ts +41 -20
  38. package/src/analytics/currentSession.ts +83 -0
  39. package/src/analytics/eventQueue.ts +9 -1
  40. package/src/analytics/index.ts +20 -1
  41. package/src/analytics/reportClientEvent.ts +38 -0
  42. package/src/analytics/screenTracking.ts +6 -1
  43. package/src/analytics/useAnalytics.ts +22 -1
  44. package/src/context/deviceId.ts +109 -0
  45. package/src/context/userContext.ts +18 -0
  46. package/src/index.ts +45 -1
  47. package/src/questionnaire/runtime.ts +12 -2
  48. package/src/questionnaire/useQuestionnaireGate.ts +9 -7
  49. package/src/revenuecat/index.ts +55 -0
  50. package/src/revenuecat/purchaseEvents.ts +167 -0
  51. package/src/revenuecat/revenueCatBridge.ts +221 -0
  52. package/src/revenuecat/types.ts +95 -0
  53. package/src/reviews/runtime.ts +92 -1
  54. package/src/reviews/transport.ts +21 -2
  55. package/src/reviews/useReviewGate.ts +12 -7
  56. package/src/session-analytics/lifecycle.ts +9 -2
  57. package/src/session-analytics/reportSessionStart.ts +15 -4
  58. package/src/session-analytics/useLifecycleEvents.ts +28 -2
package/dist/index.js CHANGED
@@ -1518,6 +1518,23 @@ var buildEventsRequest = (target, events) => {
1518
1518
  return null;
1519
1519
  }
1520
1520
  };
1521
+ var warnOnSkippedEvents = (res) => {
1522
+ try {
1523
+ const json = res == null ? void 0 : res.json;
1524
+ if (typeof json !== "function") return;
1525
+ void Promise.resolve(json.call(res)).then((body) => {
1526
+ const skipped = body == null ? void 0 : body.skipped;
1527
+ if (typeof skipped !== "number" || skipped <= 0) return;
1528
+ if (typeof __DEV__ !== "undefined" && __DEV__ && typeof console !== "undefined" && console.warn) {
1529
+ console.warn(
1530
+ `[wireai] the server ACCEPTED the /v1/events POST but DISCARDED ${skipped} event(s) (skipped in the response body) \u2014 they are gone, not retried. The usual cause is an event with a missing or empty session_id.`
1531
+ );
1532
+ }
1533
+ }).catch(() => {
1534
+ });
1535
+ } catch {
1536
+ }
1537
+ };
1521
1538
  var reportClientEvents = (target, events) => {
1522
1539
  try {
1523
1540
  const req = buildEventsRequest(target, events);
@@ -3314,6 +3331,28 @@ var getCurrentSessionId = () => globalSlot[CURRENT_SESSION_ID_SLOT];
3314
3331
  var resetCurrentSessionId = () => {
3315
3332
  globalSlot[CURRENT_SESSION_ID_SLOT] = void 0;
3316
3333
  };
3334
+ var warnInDev = (message) => {
3335
+ if (typeof __DEV__ !== "undefined" && __DEV__ && typeof console !== "undefined" && console.warn) {
3336
+ console.warn(message);
3337
+ return true;
3338
+ }
3339
+ return false;
3340
+ };
3341
+ var MINT_WARNING = "[wireai] No app-open session was registered, so a session id was minted for this event (the server drops an event that has no session_id, and still answers 200). Mount useLifecycleEvents at your app root so events correlate to a real app-open.";
3342
+ var MINT_WARNED_SLOT = /* @__PURE__ */ Symbol.for(
3343
+ "@wireai/activation:currentSessionIdMintWarned"
3344
+ );
3345
+ var warnSlot = globalThis;
3346
+ var ensureCurrentSessionId = () => {
3347
+ const existing = globalSlot[CURRENT_SESSION_ID_SLOT];
3348
+ if (typeof existing === "string" && existing.length > 0) return existing;
3349
+ const minted = makeSessionId();
3350
+ globalSlot[CURRENT_SESSION_ID_SLOT] = minted;
3351
+ if (!warnSlot[MINT_WARNED_SLOT] && warnInDev(MINT_WARNING)) {
3352
+ warnSlot[MINT_WARNED_SLOT] = true;
3353
+ }
3354
+ return minted;
3355
+ };
3317
3356
 
3318
3357
  // src/session/persistedSession.ts
3319
3358
  var DEFAULT_SESSION_TTL_MS = 36e5;
@@ -4113,6 +4152,10 @@ var clearUserContext = async (opts = {}) => {
4113
4152
  } catch {
4114
4153
  }
4115
4154
  };
4155
+ var activationJoinContext = (deviceKey) => {
4156
+ var _a2;
4157
+ return (_a2 = resolveUserContext({ deviceKey }).userContext) != null ? _a2 : {};
4158
+ };
4116
4159
  var resolveUserContext = (ctx = {}, opts = {}) => {
4117
4160
  var _a2;
4118
4161
  const result = {};
@@ -4151,6 +4194,47 @@ var mintDeviceId = () => {
4151
4194
  const time = Date.now().toString(36);
4152
4195
  return `${AUTO_DEVICE_ID_PREFIX}${time}_${randomChunk()}${randomChunk()}`;
4153
4196
  };
4197
+ var AUTO_DEVICE_KEY_SLOT = /* @__PURE__ */ Symbol.for("@wireai/activation:autoDeviceKeys");
4198
+ var deviceKeyGlobal = globalThis;
4199
+ var autoDeviceKeyRegistry = () => {
4200
+ const existing = deviceKeyGlobal[AUTO_DEVICE_KEY_SLOT];
4201
+ if (existing) return existing;
4202
+ const created = { keys: /* @__PURE__ */ new Map(), hydrating: /* @__PURE__ */ new Set() };
4203
+ deviceKeyGlobal[AUTO_DEVICE_KEY_SLOT] = created;
4204
+ return created;
4205
+ };
4206
+ var resolveAutoDeviceKey = (opts = {}) => {
4207
+ var _a2, _b;
4208
+ const registry = autoDeviceKeyRegistry();
4209
+ const appId = (_a2 = opts.appId) != null ? _a2 : "default";
4210
+ let id = registry.keys.get(appId);
4211
+ if (!id) {
4212
+ id = mintDeviceId();
4213
+ registry.keys.set(appId, id);
4214
+ }
4215
+ const storage = opts.storage;
4216
+ if (storage && !registry.hydrating.has(appId)) {
4217
+ registry.hydrating.add(appId);
4218
+ const slot = deviceIdStorageKey(appId);
4219
+ const minted = id;
4220
+ try {
4221
+ void Promise.resolve(storage.getItem(slot)).then((saved) => {
4222
+ const persisted = typeof saved === "string" && saved.trim() ? saved.trim() : void 0;
4223
+ if (persisted) registry.keys.set(appId, persisted);
4224
+ else void Promise.resolve(storage.setItem(slot, minted)).catch(() => {
4225
+ });
4226
+ }).catch(() => {
4227
+ });
4228
+ } catch {
4229
+ }
4230
+ }
4231
+ return (_b = registry.keys.get(appId)) != null ? _b : id;
4232
+ };
4233
+ var resetAutoDeviceKeys = () => {
4234
+ const registry = autoDeviceKeyRegistry();
4235
+ registry.keys.clear();
4236
+ registry.hydrating.clear();
4237
+ };
4154
4238
 
4155
4239
  // src/activation/revalidation.ts
4156
4240
  var REVALIDATION_SLOT = /* @__PURE__ */ Symbol.for(
@@ -4198,22 +4282,20 @@ var createWireActivation = (config) => {
4198
4282
  var _a2, _b;
4199
4283
  const target = { serverUrl: config.serverUrl, apiKey: config.apiKey };
4200
4284
  const explicitDeviceKey = (_b = clean(config.deviceKey)) != null ? _b : clean((_a2 = config.userContext) == null ? void 0 : _a2.deviceKey);
4201
- let autoDeviceKey = explicitDeviceKey != null ? explicitDeviceKey : mintDeviceId();
4202
- if (config.storage && !explicitDeviceKey) {
4203
- const storage = config.storage;
4204
- const key = deviceIdStorageKey(config.appId);
4205
- void storage.getItem(key).then((saved) => {
4206
- const persisted = clean(saved != null ? saved : void 0);
4207
- if (persisted) autoDeviceKey = persisted;
4208
- else void storage.setItem(key, autoDeviceKey).catch(() => {
4209
- });
4210
- }).catch(() => {
4211
- });
4212
- }
4285
+ const autoDeviceKeyOptions = {
4286
+ appId: config.appId,
4287
+ // An explicit key opts out of minting AND persisting (unchanged contract).
4288
+ storage: explicitDeviceKey ? void 0 : config.storage
4289
+ };
4290
+ if (!explicitDeviceKey) resolveAutoDeviceKey(autoDeviceKeyOptions);
4213
4291
  const applyContext = (event) => {
4214
4292
  var _a3, _b2;
4215
4293
  const resolved = resolveUserContext(
4216
- { ...(_a3 = config.userContext) != null ? _a3 : {}, deviceKey: explicitDeviceKey != null ? explicitDeviceKey : autoDeviceKey },
4294
+ // `??` is lazy on purpose: an explicit key must never even touch the auto registry.
4295
+ {
4296
+ ...(_a3 = config.userContext) != null ? _a3 : {},
4297
+ deviceKey: explicitDeviceKey != null ? explicitDeviceKey : resolveAutoDeviceKey(autoDeviceKeyOptions)
4298
+ },
4217
4299
  { autoAppVersion: config.appVersion }
4218
4300
  );
4219
4301
  if (resolved.userContext) {
@@ -4222,8 +4304,8 @@ var createWireActivation = (config) => {
4222
4304
  if (resolved.userId && !event.user_id) event.user_id = resolved.userId;
4223
4305
  };
4224
4306
  const track = async (name2, meta) => {
4225
- const sessionId = getCurrentSessionId();
4226
- if (!clean(name2) || !sessionId) return false;
4307
+ if (!clean(name2)) return false;
4308
+ const sessionId = ensureCurrentSessionId();
4227
4309
  const event = {
4228
4310
  event_type: "app_event",
4229
4311
  session_id: sessionId,
@@ -4250,9 +4332,16 @@ var useActivationRevalidation = () => React18.useSyncExternalStore(
4250
4332
  getActivationRevalidationVersion
4251
4333
  );
4252
4334
  var useWireActivation = (config) => {
4335
+ var _a2;
4253
4336
  const ref = React18.useRef(void 0);
4254
4337
  const prevKeys = React18.useRef("");
4255
- const currentKeys = `${config.serverUrl}|${config.apiKey}|${config.appId}|${config.deviceKey}`;
4338
+ const currentKeys = [
4339
+ config.serverUrl,
4340
+ config.apiKey,
4341
+ config.appId,
4342
+ config.deviceKey,
4343
+ (_a2 = config.userContext) == null ? void 0 : _a2.deviceKey
4344
+ ].join("|");
4256
4345
  if (!ref.current || prevKeys.current !== currentKeys) {
4257
4346
  prevKeys.current = currentKeys;
4258
4347
  ref.current = createWireActivation(config);
@@ -4261,6 +4350,154 @@ var useWireActivation = (config) => {
4261
4350
  return { track: ref.current.track, sessionId: ref.current.sessionId, revalidation };
4262
4351
  };
4263
4352
 
4353
+ // src/revenuecat/purchaseEvents.ts
4354
+ var WIRE_PURCHASE_EVENTS = {
4355
+ /** The paywall became visible (offerings loaded). */
4356
+ paywallShown: "wire_paywall_shown",
4357
+ /** The user tapped buy; the store sheet is about to open. */
4358
+ checkoutStarted: "wire_checkout_started",
4359
+ /** The store confirmed the purchase AND the entitlement is now active. */
4360
+ purchased: "wire_purchase_completed",
4361
+ /** The purchase did not land: a user cancel or a real store/network error (see `reason`). */
4362
+ purchaseFailed: "wire_purchase_failed",
4363
+ /** A restore ran (whether or not it produced an entitlement; see `plan_tier`). */
4364
+ restored: "wire_purchase_restored"
4365
+ };
4366
+ var PLAN_TIER_CONTEXT_KEY = "plan_tier";
4367
+ var asRecord = (value) => typeof value === "object" && value !== null ? value : void 0;
4368
+ var activeEntitlement = (info, entitlementId) => {
4369
+ var _a2, _b;
4370
+ const active = asRecord((_b = asRecord((_a2 = asRecord(info)) == null ? void 0 : _a2.entitlements)) == null ? void 0 : _b.active);
4371
+ const found = active == null ? void 0 : active[entitlementId];
4372
+ const entitlement = asRecord(found);
4373
+ if (!entitlement) return void 0;
4374
+ return entitlement.isActive === false ? void 0 : entitlement;
4375
+ };
4376
+ var isTrial = (entitlement) => typeof entitlement.periodType === "string" && entitlement.periodType.toUpperCase() === "TRIAL";
4377
+ var resolvePlanTier = (info, entitlementId) => {
4378
+ const entitlement = activeEntitlement(info, entitlementId);
4379
+ if (!entitlement) return "free";
4380
+ return isTrial(entitlement) ? "trial" : "paid";
4381
+ };
4382
+ var describePackage = (pkg) => {
4383
+ const props = {};
4384
+ if (!pkg) return props;
4385
+ if (typeof pkg.identifier === "string") props.package_id = pkg.identifier;
4386
+ if (typeof pkg.packageType === "string") props.package_type = pkg.packageType;
4387
+ if (typeof pkg.offeringIdentifier === "string") props.offering_id = pkg.offeringIdentifier;
4388
+ const product = asRecord(pkg.product);
4389
+ if (product) {
4390
+ if (typeof product.identifier === "string") props.product_id = product.identifier;
4391
+ if (typeof product.price === "number" && Number.isFinite(product.price)) {
4392
+ props.price = product.price;
4393
+ }
4394
+ if (typeof product.currencyCode === "string") props.currency = product.currencyCode;
4395
+ }
4396
+ return props;
4397
+ };
4398
+ var describeEntitlement = (info, entitlementId) => {
4399
+ const entitlement = activeEntitlement(info, entitlementId);
4400
+ const props = {
4401
+ entitlement: entitlementId,
4402
+ plan_tier: entitlement ? isTrial(entitlement) ? "trial" : "paid" : "free"
4403
+ };
4404
+ if (!entitlement) return props;
4405
+ if (typeof entitlement.periodType === "string") props.period_type = entitlement.periodType;
4406
+ props.is_trial = isTrial(entitlement);
4407
+ if (typeof entitlement.willRenew === "boolean") props.will_renew = entitlement.willRenew;
4408
+ if (typeof entitlement.store === "string") props.store = entitlement.store;
4409
+ if (typeof entitlement.productIdentifier === "string") {
4410
+ props.product_id = entitlement.productIdentifier;
4411
+ }
4412
+ if (typeof entitlement.isSandbox === "boolean") props.is_sandbox = entitlement.isSandbox;
4413
+ return props;
4414
+ };
4415
+ var PURCHASE_CANCELLED_CODE = "1";
4416
+ var isUserCancelled = (error) => {
4417
+ const record = asRecord(error);
4418
+ if (!record) return false;
4419
+ if (record.userCancelled === true) return true;
4420
+ return record.code === PURCHASE_CANCELLED_CODE;
4421
+ };
4422
+ var describeFailure = (error) => {
4423
+ const record = asRecord(error);
4424
+ const code = typeof (record == null ? void 0 : record.code) === "string" ? record.code : "unknown";
4425
+ return { reason: isUserCancelled(error) ? "cancelled" : "error", code };
4426
+ };
4427
+
4428
+ // src/revenuecat/revenueCatBridge.ts
4429
+ var createRevenueCatBridge = (config) => {
4430
+ const { analytics, entitlementId } = config;
4431
+ const writeTier = config.writePlanTier !== false;
4432
+ const emit = (event, props) => {
4433
+ try {
4434
+ const result = analytics.track(event, { ...config.commonProps, ...props });
4435
+ if (result && typeof result.catch === "function") {
4436
+ void result.catch(() => {
4437
+ });
4438
+ }
4439
+ } catch {
4440
+ }
4441
+ };
4442
+ const syncPlanTier = (customerInfo) => {
4443
+ var _a2;
4444
+ const tier = resolvePlanTier(customerInfo, entitlementId);
4445
+ if (!writeTier) return tier;
4446
+ try {
4447
+ (_a2 = analytics.setUserContext) == null ? void 0 : _a2.call(analytics, { extra: { [PLAN_TIER_CONTEXT_KEY]: tier } });
4448
+ } catch {
4449
+ }
4450
+ return tier;
4451
+ };
4452
+ const paywallShown = (offering, props) => {
4453
+ var _a2, _b;
4454
+ const shown = {
4455
+ packages_count: (_b = (_a2 = offering == null ? void 0 : offering.availablePackages) == null ? void 0 : _a2.length) != null ? _b : 0
4456
+ };
4457
+ if (typeof (offering == null ? void 0 : offering.identifier) === "string") shown.offering_id = offering.identifier;
4458
+ emit(WIRE_PURCHASE_EVENTS.paywallShown, { ...shown, ...props });
4459
+ };
4460
+ const checkoutStarted = (pkg, props) => {
4461
+ emit(WIRE_PURCHASE_EVENTS.checkoutStarted, { ...describePackage(pkg), ...props });
4462
+ };
4463
+ const purchaseCompleted = (customerInfo, pkg, props) => {
4464
+ const tier = syncPlanTier(customerInfo);
4465
+ const entitled = tier !== "free";
4466
+ if (entitled) {
4467
+ emit(WIRE_PURCHASE_EVENTS.purchased, {
4468
+ ...describePackage(pkg),
4469
+ ...describeEntitlement(customerInfo, entitlementId),
4470
+ ...props
4471
+ });
4472
+ return true;
4473
+ }
4474
+ emit(WIRE_PURCHASE_EVENTS.purchaseFailed, {
4475
+ ...describePackage(pkg),
4476
+ reason: "not_entitled",
4477
+ code: "unknown",
4478
+ entitlement: entitlementId,
4479
+ ...props
4480
+ });
4481
+ return false;
4482
+ };
4483
+ const purchaseFailed = (error, pkg, props) => {
4484
+ emit(WIRE_PURCHASE_EVENTS.purchaseFailed, {
4485
+ ...describePackage(pkg),
4486
+ ...describeFailure(error),
4487
+ ...props
4488
+ });
4489
+ };
4490
+ const purchasesRestored = (customerInfo, props) => {
4491
+ const tier = syncPlanTier(customerInfo);
4492
+ emit(WIRE_PURCHASE_EVENTS.restored, {
4493
+ ...describeEntitlement(customerInfo, entitlementId),
4494
+ ...props
4495
+ });
4496
+ return tier !== "free";
4497
+ };
4498
+ return { paywallShown, checkoutStarted, purchaseCompleted, purchaseFailed, purchasesRestored, syncPlanTier };
4499
+ };
4500
+
4264
4501
  // src/session-analytics/reportSessionStart.ts
4265
4502
  var SESSION_STARTED_EVENT = "app.session_started";
4266
4503
  var _emitted = /* @__PURE__ */ new Set();
@@ -4313,6 +4550,8 @@ var reportSessionStart = (opts) => {
4313
4550
  method: "POST",
4314
4551
  headers,
4315
4552
  body: JSON.stringify({ events: [event] })
4553
+ }).then((res) => {
4554
+ warnOnSkippedEvents(res);
4316
4555
  }).catch(() => {
4317
4556
  });
4318
4557
  } catch {
@@ -4443,11 +4682,13 @@ var reportFirstOpen = (opts) => {
4443
4682
  })();
4444
4683
  };
4445
4684
  var wireLifecycleEvents = (opts) => {
4446
- reportFirstOpen(opts);
4685
+ var _a2;
4686
+ const sessionId = (_a2 = opts.sessionId) != null ? _a2 : makeSessionId();
4687
+ reportFirstOpen({ ...opts, sessionId });
4447
4688
  reportSessionStart({
4448
4689
  target: opts.target,
4449
4690
  sink: opts.sink,
4450
- sessionId: opts.sessionId,
4691
+ sessionId,
4451
4692
  userId: opts.userId,
4452
4693
  deviceKey: opts.deviceKey,
4453
4694
  sessionCount: opts.sessionCount,
@@ -4582,6 +4823,7 @@ var createEventQueue = (options) => {
4582
4823
  const timer = setTimeout(() => controller == null ? void 0 : controller.abort(), 15e3);
4583
4824
  try {
4584
4825
  const res = await fetch(req.url, { ...req.init, signal: controller == null ? void 0 : controller.signal });
4826
+ warnOnSkippedEvents(res);
4585
4827
  return !!(res && res.ok);
4586
4828
  } catch {
4587
4829
  return false;
@@ -4687,6 +4929,12 @@ var useLifecycleEvents = (config, options = {}) => {
4687
4929
  var _a3;
4688
4930
  return (cfg == null ? void 0 : cfg.serverUrl) ? { serverUrl: cfg.serverUrl, apiKey: (_a3 = cfg.apiKey) != null ? _a3 : "" } : void 0;
4689
4931
  };
4932
+ const resolveDeviceKey = (cfg, opts) => {
4933
+ const host = typeof opts.deviceKey === "string" && opts.deviceKey.trim() ? opts.deviceKey : void 0;
4934
+ if (host) return host;
4935
+ if (!(cfg == null ? void 0 : cfg.storage)) return void 0;
4936
+ return resolveAutoDeviceKey({ appId: cfg.appId, storage: cfg.storage });
4937
+ };
4690
4938
  const mountOpenSessionId = makeSessionId();
4691
4939
  const fireSession = (sessionId) => {
4692
4940
  var _a3;
@@ -4700,7 +4948,7 @@ var useLifecycleEvents = (config, options = {}) => {
4700
4948
  sink: resolveSink(),
4701
4949
  sessionId,
4702
4950
  userId: opts.userId,
4703
- deviceKey: opts.deviceKey,
4951
+ deviceKey: resolveDeviceKey(cfg, opts),
4704
4952
  sessionCount: opts.sessionCount,
4705
4953
  appVersion: (_a3 = cfg == null ? void 0 : cfg.appVersion) != null ? _a3 : device.appVersion,
4706
4954
  platform: reactNative.Platform.OS,
@@ -4721,7 +4969,7 @@ var useLifecycleEvents = (config, options = {}) => {
4721
4969
  storage: cfg == null ? void 0 : cfg.storage,
4722
4970
  appId: cfg == null ? void 0 : cfg.appId,
4723
4971
  userId: opts.userId,
4724
- deviceKey: opts.deviceKey,
4972
+ deviceKey: resolveDeviceKey(cfg, opts),
4725
4973
  sessionCount: opts.sessionCount,
4726
4974
  appVersion: (_a2 = cfg == null ? void 0 : cfg.appVersion) != null ? _a2 : device.appVersion,
4727
4975
  platform: reactNative.Platform.OS,
@@ -4774,6 +5022,7 @@ exports.OnboardingButton = Button;
4774
5022
  exports.OnboardingFlow = OnboardingFlow;
4775
5023
  exports.OnboardingScaffold = OnboardingScaffold;
4776
5024
  exports.OnboardingThemeProvider = OnboardingThemeProvider;
5025
+ exports.PLAN_TIER_CONTEXT_KEY = PLAN_TIER_CONTEXT_KEY;
4777
5026
  exports.RESERVED_USER_CONTEXT_KEYS = RESERVED_USER_CONTEXT_KEYS;
4778
5027
  exports.SESSION_STARTED_EVENT = SESSION_STARTED_EVENT;
4779
5028
  exports.SelectionCard = SelectionCard;
@@ -4784,9 +5033,12 @@ exports.USER_ID_MAX_LENGTH = USER_ID_MAX_LENGTH;
4784
5033
  exports.WIRE_ICON_GLYPHS = WIRE_ICON_GLYPHS;
4785
5034
  exports.WIRE_ICON_NAMES = WIRE_ICON_NAMES;
4786
5035
  exports.WIRE_ONBOARDING_EVENTS = WIRE_ONBOARDING_EVENTS;
5036
+ exports.WIRE_PURCHASE_EVENTS = WIRE_PURCHASE_EVENTS;
4787
5037
  exports.WireFeaturesProvider = WireFeaturesProvider;
4788
5038
  exports.WireIcon = WireIcon;
4789
5039
  exports.WireOnboarding = WireOnboarding;
5040
+ exports.activationJoinContext = activationJoinContext;
5041
+ exports.activeEntitlement = activeEntitlement;
4790
5042
  exports.analyticsUserIdStorageKey = analyticsUserIdStorageKey;
4791
5043
  exports.attributionMetadata = attributionMetadata;
4792
5044
  exports.bumpActivationRevalidation = bumpActivationRevalidation;
@@ -4794,14 +5046,19 @@ exports.clearPersistedSession = clearPersistedSession;
4794
5046
  exports.clearPiiFromContext = clearPiiFromContext;
4795
5047
  exports.clearUserContext = clearUserContext;
4796
5048
  exports.collectDeviceContext = collectDeviceContext;
5049
+ exports.createRevenueCatBridge = createRevenueCatBridge;
4797
5050
  exports.createWireActivation = createWireActivation;
4798
5051
  exports.defaultIllustrations = defaultIllustrations;
4799
5052
  exports.defaultOnboardingTheme = defaultOnboardingTheme;
4800
5053
  exports.defaultWireFeatures = defaultWireFeatures;
4801
5054
  exports.deriveAnswers = deriveAnswers;
5055
+ exports.describeEntitlement = describeEntitlement;
5056
+ exports.describeFailure = describeFailure;
5057
+ exports.describePackage = describePackage;
4802
5058
  exports.detectAppVersion = detectAppVersion;
4803
5059
  exports.detectNativeModel = detectNativeModel;
4804
5060
  exports.deviceIdStorageKey = deviceIdStorageKey;
5061
+ exports.ensureCurrentSessionId = ensureCurrentSessionId;
4805
5062
  exports.featuresCacheKey = featuresCacheKey;
4806
5063
  exports.featuresEqual = featuresEqual;
4807
5064
  exports.fetchWireFeatures = fetchWireFeatures;
@@ -4812,6 +5069,7 @@ exports.hashEmailFnv1a = hashEmailFnv1a;
4812
5069
  exports.identifyOnboarding = identifyOnboarding;
4813
5070
  exports.isFeaturesFresh = isFeaturesFresh;
4814
5071
  exports.isOnboardingEnabled = isOnboardingEnabled;
5072
+ exports.isUserCancelled = isUserCancelled;
4815
5073
  exports.isWireScalar = isWireScalar;
4816
5074
  exports.loadPersistedSession = loadPersistedSession;
4817
5075
  exports.looksLikeEmail = looksLikeEmail;
@@ -4833,9 +5091,12 @@ exports.reportClientEventsAwait = reportClientEventsAwait;
4833
5091
  exports.reportFirstOpen = reportFirstOpen;
4834
5092
  exports.reportSessionStart = reportSessionStart;
4835
5093
  exports.resetActivationRevalidation = resetActivationRevalidation;
5094
+ exports.resetAutoDeviceKeys = resetAutoDeviceKeys;
4836
5095
  exports.resetCurrentSessionId = resetCurrentSessionId;
4837
5096
  exports.resetFirstOpenLatch = resetFirstOpenLatch;
4838
5097
  exports.resetSessionStartGuard = resetSessionStartGuard;
5098
+ exports.resolveAutoDeviceKey = resolveAutoDeviceKey;
5099
+ exports.resolvePlanTier = resolvePlanTier;
4839
5100
  exports.resolveUserContext = resolveUserContext;
4840
5101
  exports.sanitizeUserId = sanitizeUserId;
4841
5102
  exports.savePersistedSession = savePersistedSession;