expo-superwall 1.0.10 → 1.1.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 (50) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/expo/modules/superwallexpo/SuperwallExpoModule.kt +24 -0
  4. package/android/src/main/java/expo/modules/superwallexpo/json/CustomerInfo.kt +63 -0
  5. package/android/src/main/java/expo/modules/superwallexpo/json/PaywallInfo.kt +2 -0
  6. package/android/src/main/java/expo/modules/superwallexpo/json/RestorationResult.kt +10 -0
  7. package/build/package.json +1 -1
  8. package/build/src/SuperwallExpoModule.d.ts +3 -1
  9. package/build/src/SuperwallExpoModule.d.ts.map +1 -1
  10. package/build/src/SuperwallExpoModule.js.map +1 -1
  11. package/build/src/SuperwallExpoModule.types.d.ts +214 -3
  12. package/build/src/SuperwallExpoModule.types.d.ts.map +1 -1
  13. package/build/src/SuperwallExpoModule.types.js.map +1 -1
  14. package/build/src/compat/index.d.ts +20 -1
  15. package/build/src/compat/index.d.ts.map +1 -1
  16. package/build/src/compat/index.js +24 -1
  17. package/build/src/compat/index.js.map +1 -1
  18. package/build/src/compat/lib/CustomerInfo.d.ts +65 -0
  19. package/build/src/compat/lib/CustomerInfo.d.ts.map +1 -0
  20. package/build/src/compat/lib/CustomerInfo.js +30 -0
  21. package/build/src/compat/lib/CustomerInfo.js.map +1 -0
  22. package/build/src/compat/lib/PaywallInfo.d.ts +10 -1
  23. package/build/src/compat/lib/PaywallInfo.d.ts.map +1 -1
  24. package/build/src/compat/lib/PaywallInfo.js +12 -1
  25. package/build/src/compat/lib/PaywallInfo.js.map +1 -1
  26. package/build/src/compat/lib/Product.d.ts +62 -1
  27. package/build/src/compat/lib/Product.d.ts.map +1 -1
  28. package/build/src/compat/lib/Product.js +42 -1
  29. package/build/src/compat/lib/Product.js.map +1 -1
  30. package/build/src/compat/lib/SuperwallEventInfo.d.ts +18 -1
  31. package/build/src/compat/lib/SuperwallEventInfo.d.ts.map +1 -1
  32. package/build/src/compat/lib/SuperwallEventInfo.js +8 -0
  33. package/build/src/compat/lib/SuperwallEventInfo.js.map +1 -1
  34. package/build/src/useSuperwall.d.ts +6 -1
  35. package/build/src/useSuperwall.d.ts.map +1 -1
  36. package/build/src/useSuperwall.js +3 -0
  37. package/build/src/useSuperwall.js.map +1 -1
  38. package/ios/Bridges/PurchaseControllerBridge.swift +28 -4
  39. package/ios/Json/CustomStoreProduct+Json.swift +9 -0
  40. package/ios/Json/PaddleProduct+Json.swift +9 -0
  41. package/ios/Json/PageViewData+Json.swift +25 -0
  42. package/ios/Json/PaywallInfo+Json.swift +4 -11
  43. package/ios/Json/Product+Json.swift +28 -0
  44. package/ios/Json/ProductStore+Json.swift +4 -0
  45. package/ios/Json/RestorationResult+Json.swift +9 -0
  46. package/ios/Json/StripeProduct+Json.swift +13 -0
  47. package/ios/Json/SuperwallPlacementInfo+Json.swift +6 -0
  48. package/ios/SuperwallExpo.podspec +1 -1
  49. package/ios/SuperwallExpoModule.swift +11 -0
  50. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 0c3396d: Bump native SDKs and expose new APIs.
8
+
9
+ **iOS — SuperwallKit 4.14.1 → 4.15.1**
10
+
11
+ - New `paywallPageView` event for multi-page paywall navigation tracking (with `PageViewData` payload).
12
+ - `PaywallInfo.presentationId` is now bridged so events within a single presentation can be correlated.
13
+ - Custom store products are fully bridged: `Product` now carries `store` (`APP_STORE` | `STRIPE` | `PADDLE` | `PLAY_STORE` | `SUPERWALL` | `CUSTOM` | `OTHER`) plus per-store identifier objects (`appStoreProduct`, `stripeProduct`, `paddleProduct`, `customProduct`). `onPurchase` also receives `store` so JS can route `CUSTOM` products to its own purchase logic instead of StoreKit.
14
+
15
+ **Android — Superwall-Android 2.7.11 → 2.7.12**
16
+
17
+ - Bridges the new `customerInfo` field on `PaywallInfo` (subscriptions, non-subscriptions, entitlements, userId).
18
+ - Picks up new intro-offer eligibility logic for Stripe/Paddle products and bottom-sheet dismiss fix on newer Samsung devices.
19
+
20
+ ## 1.0.11
21
+
22
+ ### Patch Changes
23
+
24
+ - 975de31: Add android 'consume' method
25
+ - 2204ee8: Bump Android version
26
+
3
27
  ## 1.0.10
4
28
 
5
29
  ### Patch Changes
@@ -43,7 +43,7 @@ android {
43
43
  }
44
44
 
45
45
  dependencies {
46
- implementation "com.superwall.sdk:superwall-android:2.7.8"
46
+ implementation "com.superwall.sdk:superwall-android:2.7.12"
47
47
  implementation 'com.android.billingclient:billing:8.0.0'
48
48
  implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.2'
49
49
  }
@@ -410,6 +410,20 @@ class SuperwallExpoModule : Module() {
410
410
  promise.resolve(null)
411
411
  }
412
412
 
413
+ AsyncFunction("restorePurchases") { promise: Promise ->
414
+ ioScope.launch {
415
+ Superwall.instance.restorePurchases().fold({ result ->
416
+ scope.launch {
417
+ promise.resolve(restorationResultToJson(result))
418
+ }
419
+ }, { error ->
420
+ scope.launch {
421
+ promise.resolve(restorationResultToJson(RestorationResult.Failed(error)))
422
+ }
423
+ })
424
+ }
425
+ }
426
+
413
427
  AsyncFunction("dismiss") { promise: Promise ->
414
428
  ioScope.launch {
415
429
  Superwall.instance.dismiss()
@@ -482,5 +496,15 @@ class SuperwallExpoModule : Module() {
482
496
  val attributes = Superwall.instance.integrationAttributes
483
497
  promise.resolve(attributes)
484
498
  }
499
+
500
+ AsyncFunction("consume") { purchaseToken: String, promise: Promise ->
501
+ ioScope.launch {
502
+ Superwall.instance.consume(purchaseToken).fold({ token ->
503
+ scope.launch { promise.resolve(token) }
504
+ }, { error ->
505
+ scope.launch { promise.reject(CodedException(error)) }
506
+ })
507
+ }
508
+ }
485
509
  }
486
510
  }
@@ -0,0 +1,63 @@
1
+ package expo.modules.superwallexpo.json
2
+
3
+ import com.superwall.sdk.models.customer.CustomerInfo
4
+ import com.superwall.sdk.models.customer.NonSubscriptionTransaction
5
+ import com.superwall.sdk.models.customer.SubscriptionTransaction
6
+ import com.superwall.sdk.store.abstractions.product.receipt.LatestPeriodType
7
+ import java.time.ZoneId
8
+ import java.time.format.DateTimeFormatter
9
+ import java.util.Date
10
+
11
+ // Mirrors the @SerialName values on `LatestPeriodType`. Exhaustive `when` so a new
12
+ // SDK case is a compile error rather than a silently-incorrect string.
13
+ private fun LatestPeriodType.toJsonString(): String =
14
+ when (this) {
15
+ LatestPeriodType.TRIAL -> "trial"
16
+ LatestPeriodType.CODE -> "code"
17
+ LatestPeriodType.SUBSCRIPTION -> "subscription"
18
+ LatestPeriodType.PROMOTIONAL -> "promotional"
19
+ LatestPeriodType.WINBACK -> "winback"
20
+ LatestPeriodType.REVOKED -> "revoked"
21
+ }
22
+
23
+ private val dateFormatter: DateTimeFormatter = DateTimeFormatter.ISO_INSTANT
24
+
25
+ private fun Date.toIsoString(): String =
26
+ this.toInstant().atZone(ZoneId.systemDefault()).format(dateFormatter)
27
+
28
+ fun CustomerInfo.toJson(): Map<String, Any?> {
29
+ val map = mutableMapOf<String, Any?>()
30
+ map["userId"] = this.userId
31
+ map["subscriptions"] = this.subscriptions.map { it.toJson() }
32
+ map["nonSubscriptions"] = this.nonSubscriptions.map { it.toJson() }
33
+ map["entitlements"] = this.entitlements.map { it.toJson() }
34
+ return map
35
+ }
36
+
37
+ fun SubscriptionTransaction.toJson(): Map<String, Any?> {
38
+ val map = mutableMapOf<String, Any?>()
39
+ map["transactionId"] = this.transactionId
40
+ map["productId"] = this.productId
41
+ map["purchaseDate"] = this.purchaseDate.toIsoString()
42
+ map["willRenew"] = this.willRenew
43
+ map["isRevoked"] = this.isRevoked
44
+ map["isInGracePeriod"] = this.isInGracePeriod
45
+ map["isInBillingRetryPeriod"] = this.isInBillingRetryPeriod
46
+ map["isActive"] = this.isActive
47
+ map["expirationDate"] = this.expirationDate?.toIsoString()
48
+ map["store"] = this.store.name
49
+ this.offerType?.let { map["offerType"] = it.toJsonString() }
50
+ this.subscriptionGroupId?.let { map["subscriptionGroupId"] = it }
51
+ return map
52
+ }
53
+
54
+ fun NonSubscriptionTransaction.toJson(): Map<String, Any?> {
55
+ val map = mutableMapOf<String, Any?>()
56
+ map["transactionId"] = this.transactionId
57
+ map["productId"] = this.productId
58
+ map["purchaseDate"] = this.purchaseDate.toIsoString()
59
+ map["isConsumable"] = this.isConsumable
60
+ map["isRevoked"] = this.isRevoked
61
+ map["store"] = this.store.name
62
+ return map
63
+ }
@@ -92,5 +92,7 @@ fun PaywallInfo.toJson(): Map<String, Any?> {
92
92
 
93
93
  map["state"] = this.state
94
94
 
95
+ map["customerInfo"] = this.customerInfo.toJson()
96
+
95
97
  return map
96
98
  }
@@ -13,3 +13,13 @@ fun restorationResultFromJson(json: Map<String, Any>): RestorationResult {
13
13
  else -> RestorationResult.Failed(Error("Unknown restoration result"))
14
14
  }
15
15
  }
16
+
17
+ fun restorationResultToJson(result: RestorationResult): Map<String, Any?> {
18
+ return when (result) {
19
+ is RestorationResult.Restored -> mapOf("result" to "restored")
20
+ is RestorationResult.Failed -> mapOf(
21
+ "result" to "failed",
22
+ "errorMessage" to (result.error?.message ?: "Unknown error")
23
+ )
24
+ }
25
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-superwall",
3
- "version": "1.0.10",
3
+ "version": "1.1.0",
4
4
  "description": "Offical Expo Integration for Superwall",
5
5
  "main": "build/src/index.js",
6
6
  "types": "build/src/index.d.ts",
@@ -1,6 +1,6 @@
1
1
  import { NativeModule } from "expo";
2
2
  import type { PresentationResult } from "./compat/lib/PresentationResult";
3
- import type { EntitlementsInfo, IntegrationAttributes, SuperwallExpoModuleEvents } from "./SuperwallExpoModule.types";
3
+ import type { EntitlementsInfo, IntegrationAttributes, RestorationResultResponse, SuperwallExpoModuleEvents } from "./SuperwallExpoModule.types";
4
4
  export type SubscriptionStatus = any;
5
5
  declare class SuperwallExpoModule extends NativeModule<SuperwallExpoModuleEvents> {
6
6
  getApiKey(): string;
@@ -26,6 +26,7 @@ declare class SuperwallExpoModule extends NativeModule<SuperwallExpoModuleEvents
26
26
  didRestore(result: Record<string, any>): void;
27
27
  didHandleBackPressed(shouldConsume: boolean): void;
28
28
  didHandleCustomCallback(callbackId: string, status: string, data?: Record<string, any>): Promise<void>;
29
+ restorePurchases(): Promise<RestorationResultResponse>;
29
30
  dismiss(): Promise<void>;
30
31
  confirmAllAssignments(): Promise<any[]>;
31
32
  getPresentationResult(placement: string, params?: Map<string, any> | Record<string, any>): Promise<PresentationResult>;
@@ -35,6 +36,7 @@ declare class SuperwallExpoModule extends NativeModule<SuperwallExpoModuleEvents
35
36
  setLogLevel(level: string): void;
36
37
  setIntegrationAttributes(attributes: IntegrationAttributes): Promise<void>;
37
38
  getIntegrationAttributes(): Promise<Record<string, string>>;
39
+ consume(purchaseToken: string): Promise<string>;
38
40
  }
39
41
  declare const _default: SuperwallExpoModule;
40
42
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"SuperwallExpoModule.d.ts","sourceRoot":"","sources":["../../src/SuperwallExpoModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAA;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,6BAA6B,CAAA;AAEpC,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAEpC,OAAO,OAAO,mBAAoB,SAAQ,YAAY,CAAC,yBAAyB,CAAC;IAC/E,SAAS,IAAI,MAAM;IACnB,iBAAiB,CACf,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC/C,SAAS,CAAC,EAAE,MAA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GAAG,OAAO,CAAC,IAAI,CAAC;IAC1E,wBAAwB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE3D,OAAO,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAChD;;AAED,wBAAwE"}
@@ -1 +1 @@
1
- {"version":3,"file":"SuperwallExpoModule.js","sourceRoot":"","sources":["../../src/SuperwallExpoModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAA;AA6ExD,eAAe,mBAAmB,CAAsB,eAAe,CAAC,CAAA","sourcesContent":["import { NativeModule, requireNativeModule } from \"expo\"\nimport type { PresentationResult } from \"./compat/lib/PresentationResult\"\nimport type {\n EntitlementsInfo,\n IntegrationAttributes,\n SuperwallExpoModuleEvents,\n} from \"./SuperwallExpoModule.types\"\n\nexport type SubscriptionStatus = any\n\ndeclare class SuperwallExpoModule extends NativeModule<SuperwallExpoModuleEvents> {\n getApiKey(): string\n registerPlacement(\n placement: string,\n params?: Map<string, any> | Record<string, any>,\n handlerId?: string | null,\n ): Promise<void>\n\n configure(\n apiKey: string,\n options?: Map<string, any> | Record<string, any>,\n usingPurchaseController?: boolean,\n sdkVersion?: string,\n ): Promise<void>\n\n getConfigurationStatus(): Promise<string>\n\n identify(userId: string, options?: Map<string, any> | Record<string, any> | null): Promise<void>\n reset(): Promise<void>\n\n getAssignments(): Promise<any[]>\n getEntitlements(): Promise<EntitlementsInfo>\n getSubscriptionStatus(): Promise<SubscriptionStatus>\n setSubscriptionStatus(status: Record<string, any>): Promise<void>\n\n setInterfaceStyle(style?: string): void\n\n getUserAttributes(): Promise<Record<string, any>>\n setUserAttributes(userAttributes: Record<string, any | null>): Promise<void>\n\n handleDeepLink(url: string): Promise<boolean>\n\n didPurchase(\n result:\n | { type: \"cancelled\" | \"purchased\" | \"pending\" }\n | {\n type: \"failed\"\n error?: string\n },\n ): void\n didRestore(result: Record<string, any>): void\n didHandleBackPressed(shouldConsume: boolean): void\n didHandleCustomCallback(\n callbackId: string,\n status: string,\n data?: Record<string, any>,\n ): Promise<void>\n\n dismiss(): Promise<void>\n confirmAllAssignments(): Promise<any[]>\n\n getPresentationResult(\n placement: string,\n params?: Map<string, any> | Record<string, any>,\n ): Promise<PresentationResult>\n\n getDeviceAttributes(): Promise<Record<string, any>>\n\n preloadPaywalls(placementNames: string[]): void\n preloadAllPaywalls(): void\n\n setLogLevel(level: string): void\n\n setIntegrationAttributes(attributes: IntegrationAttributes): Promise<void>\n getIntegrationAttributes(): Promise<Record<string, string>>\n}\n\nexport default requireNativeModule<SuperwallExpoModule>(\"SuperwallExpo\")\n"]}
1
+ {"version":3,"file":"SuperwallExpoModule.js","sourceRoot":"","sources":["../../src/SuperwallExpoModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAA;AAkFxD,eAAe,mBAAmB,CAAsB,eAAe,CAAC,CAAA","sourcesContent":["import { NativeModule, requireNativeModule } from \"expo\"\nimport type { PresentationResult } from \"./compat/lib/PresentationResult\"\nimport type {\n EntitlementsInfo,\n IntegrationAttributes,\n RestorationResultResponse,\n SuperwallExpoModuleEvents,\n} from \"./SuperwallExpoModule.types\"\n\nexport type SubscriptionStatus = any\n\ndeclare class SuperwallExpoModule extends NativeModule<SuperwallExpoModuleEvents> {\n getApiKey(): string\n registerPlacement(\n placement: string,\n params?: Map<string, any> | Record<string, any>,\n handlerId?: string | null,\n ): Promise<void>\n\n configure(\n apiKey: string,\n options?: Map<string, any> | Record<string, any>,\n usingPurchaseController?: boolean,\n sdkVersion?: string,\n ): Promise<void>\n\n getConfigurationStatus(): Promise<string>\n\n identify(userId: string, options?: Map<string, any> | Record<string, any> | null): Promise<void>\n reset(): Promise<void>\n\n getAssignments(): Promise<any[]>\n getEntitlements(): Promise<EntitlementsInfo>\n getSubscriptionStatus(): Promise<SubscriptionStatus>\n setSubscriptionStatus(status: Record<string, any>): Promise<void>\n\n setInterfaceStyle(style?: string): void\n\n getUserAttributes(): Promise<Record<string, any>>\n setUserAttributes(userAttributes: Record<string, any | null>): Promise<void>\n\n handleDeepLink(url: string): Promise<boolean>\n\n didPurchase(\n result:\n | { type: \"cancelled\" | \"purchased\" | \"pending\" }\n | {\n type: \"failed\"\n error?: string\n },\n ): void\n didRestore(result: Record<string, any>): void\n didHandleBackPressed(shouldConsume: boolean): void\n didHandleCustomCallback(\n callbackId: string,\n status: string,\n data?: Record<string, any>,\n ): Promise<void>\n\n restorePurchases(): Promise<RestorationResultResponse>\n\n dismiss(): Promise<void>\n confirmAllAssignments(): Promise<any[]>\n\n getPresentationResult(\n placement: string,\n params?: Map<string, any> | Record<string, any>,\n ): Promise<PresentationResult>\n\n getDeviceAttributes(): Promise<Record<string, any>>\n\n preloadPaywalls(placementNames: string[]): void\n preloadAllPaywalls(): void\n\n setLogLevel(level: string): void\n\n setIntegrationAttributes(attributes: IntegrationAttributes): Promise<void>\n getIntegrationAttributes(): Promise<Record<string, string>>\n\n consume(purchaseToken: string): Promise<string>\n}\n\nexport default requireNativeModule<SuperwallExpoModule>(\"SuperwallExpo\")\n"]}
@@ -314,9 +314,125 @@ export interface ComputedPropertyRequest {
314
314
  */
315
315
  placementName: string;
316
316
  }
317
+ /**
318
+ * The store that backs a {@link Product}.
319
+ * - `APP_STORE`: Apple App Store product (iOS).
320
+ * - `PLAY_STORE`: Google Play Store product (Android).
321
+ * - `STRIPE`: Stripe-managed product.
322
+ * - `PADDLE`: Paddle-managed product.
323
+ * - `SUPERWALL`: Manually granted entitlement from the Superwall dashboard.
324
+ * - `CUSTOM`: A custom product purchased through a `PurchaseController` outside of any
325
+ * storefront. When you receive a custom product in `onPurchase`, you must implement the
326
+ * purchase yourself (e.g., calling your backend) instead of going through StoreKit / Billing.
327
+ * - `OTHER`: An unknown or unsupported store.
328
+ */
329
+ export type ProductStore = "APP_STORE" | "PLAY_STORE" | "STRIPE" | "PADDLE" | "SUPERWALL" | "CUSTOM" | "OTHER";
330
+ /**
331
+ * The Apple App Store-specific data for a {@link Product}.
332
+ */
333
+ export interface AppStoreProductIdentifier {
334
+ /** The App Store product identifier. */
335
+ id: string;
336
+ }
337
+ /**
338
+ * The Stripe-specific data for a {@link Product}.
339
+ */
340
+ export interface StripeProductIdentifier {
341
+ /** The Stripe price/product identifier. */
342
+ id: string;
343
+ /** The number of trial days for this product, if any. */
344
+ trialDays?: number;
345
+ }
346
+ /**
347
+ * The Paddle-specific data for a {@link Product}.
348
+ */
349
+ export interface PaddleProductIdentifier {
350
+ /** The Paddle product identifier. */
351
+ id: string;
352
+ }
353
+ /**
354
+ * The custom-product data for a {@link Product}.
355
+ * Custom products are purchased via your `PurchaseController` rather than through a storefront.
356
+ */
357
+ export interface CustomStoreProductIdentifier {
358
+ /** The custom product identifier (as configured on the Superwall dashboard). */
359
+ id: string;
360
+ }
361
+ /**
362
+ * The offer type that applied to a {@link SubscriptionTransaction}.
363
+ *
364
+ * @platform Android
365
+ */
366
+ export type SubscriptionOfferType = "trial" | "code" | "subscription" | "promotional" | "winback" | "revoked";
367
+ /**
368
+ * A subscription transaction recorded in the customer's purchase history.
369
+ *
370
+ * @platform Android — currently only delivered by the Android SDK.
371
+ */
372
+ export interface SubscriptionTransaction {
373
+ /** The unique identifier for the transaction. */
374
+ transactionId: string;
375
+ /** The product identifier of the subscription. */
376
+ productId: string;
377
+ /** ISO-8601 timestamp of when the user was charged. */
378
+ purchaseDate: string;
379
+ /** Whether the subscription is set to renew. */
380
+ willRenew: boolean;
381
+ /** Whether the transaction has been revoked. */
382
+ isRevoked: boolean;
383
+ /** Whether the subscription is in a billing grace period. */
384
+ isInGracePeriod: boolean;
385
+ /** Whether the subscription is in a billing retry period. */
386
+ isInBillingRetryPeriod: boolean;
387
+ /** Whether the subscription is currently active. */
388
+ isActive: boolean;
389
+ /** ISO-8601 expiration date, or `null` if non-renewing. */
390
+ expirationDate?: string | null;
391
+ /** Store the transaction came from (e.g. `"PLAY_STORE"`). */
392
+ store: string;
393
+ /** Offer type, if any was applied. */
394
+ offerType?: SubscriptionOfferType;
395
+ /** iOS-only — the subscription group identifier. */
396
+ subscriptionGroupId?: string;
397
+ }
398
+ /**
399
+ * A non-subscription (one-time / consumable) transaction in the customer's purchase history.
400
+ *
401
+ * @platform Android — currently only delivered by the Android SDK.
402
+ */
403
+ export interface NonSubscriptionTransaction {
404
+ /** The unique identifier for the transaction. */
405
+ transactionId: string;
406
+ /** The product identifier of the in-app purchase. */
407
+ productId: string;
408
+ /** ISO-8601 timestamp of when the user was charged. */
409
+ purchaseDate: string;
410
+ /** Whether the in-app purchase is consumable. */
411
+ isConsumable: boolean;
412
+ /** Whether the transaction has been revoked. */
413
+ isRevoked: boolean;
414
+ /** Store the transaction came from (e.g. `"PLAY_STORE"`). */
415
+ store: string;
416
+ }
417
+ /**
418
+ * The latest subscription and entitlement state for the customer.
419
+ * Snapshots are immutable and don't auto-update.
420
+ *
421
+ * @platform Android — currently only delivered by the Android SDK.
422
+ */
423
+ export interface CustomerInfo {
424
+ /** The user ID at the time the snapshot was taken. */
425
+ userId: string;
426
+ /** All subscription transactions, ordered by purchase date ascending. */
427
+ subscriptions: SubscriptionTransaction[];
428
+ /** All non-subscription transactions, ordered by purchase date ascending. */
429
+ nonSubscriptions: NonSubscriptionTransaction[];
430
+ /** All entitlements available to the user. */
431
+ entitlements: Entitlement[];
432
+ }
317
433
  /**
318
434
  * Represents a product available for purchase on a paywall, as defined within {@link PaywallInfo}.
319
- * This provides a simplified view of a product, focusing on its ID, name, and granted entitlements.
435
+ * This provides a simplified view of a product, focusing on its ID, name, store, and granted entitlements.
320
436
  */
321
437
  export interface Product {
322
438
  /**
@@ -332,6 +448,34 @@ export interface Product {
332
448
  * See {@link Entitlement}.
333
449
  */
334
450
  entitlements: Entitlement[];
451
+ /**
452
+ * The store that backs this product. See {@link ProductStore}.
453
+ * Use this to detect `CUSTOM` products in `onPurchase` and route them to your own
454
+ * purchase logic instead of StoreKit / Google Play Billing.
455
+ *
456
+ * @platform iOS — present on iOS 4.15.0+. May be absent on older Android SDK versions.
457
+ */
458
+ store?: ProductStore;
459
+ /**
460
+ * App Store-specific product data, present when `store === "APP_STORE"`.
461
+ * @platform iOS
462
+ */
463
+ appStoreProduct?: AppStoreProductIdentifier;
464
+ /**
465
+ * Stripe-specific product data, present when `store === "STRIPE"`.
466
+ * @platform iOS
467
+ */
468
+ stripeProduct?: StripeProductIdentifier;
469
+ /**
470
+ * Paddle-specific product data, present when `store === "PADDLE"`.
471
+ * @platform iOS
472
+ */
473
+ paddleProduct?: PaddleProductIdentifier;
474
+ /**
475
+ * Custom-product data, present when `store === "CUSTOM"`.
476
+ * @platform iOS
477
+ */
478
+ customProduct?: CustomStoreProductIdentifier;
335
479
  }
336
480
  /**
337
481
  * Contains comprehensive information about a paywall, including its configuration, associated experiment,
@@ -344,6 +488,11 @@ export interface PaywallInfo {
344
488
  name: string;
345
489
  /** The URL where the paywall's web content is hosted. */
346
490
  url: string;
491
+ /**
492
+ * A unique identifier for this paywall presentation, used to correlate all events
493
+ * within a single presentation lifecycle.
494
+ */
495
+ presentationId?: string;
347
496
  /**
348
497
  * The experiment associated with this paywall presentation, if applicable.
349
498
  * See {@link Experiment}.
@@ -437,6 +586,14 @@ export interface PaywallInfo {
437
586
  * Contains key-value pairs representing the paywall's current state.
438
587
  */
439
588
  state: Record<string, any>;
589
+ /**
590
+ * A snapshot of the customer's subscription and entitlement state at the time
591
+ * the paywall was presented.
592
+ *
593
+ * @platform Android — currently only populated by the Android SDK (2.7.12+).
594
+ * Will be `undefined` on iOS.
595
+ */
596
+ customerInfo?: CustomerInfo;
440
597
  }
441
598
  /**
442
599
  * Represents a custom callback invoked from a paywall.
@@ -1848,17 +2005,52 @@ export interface StripeCheckoutFailEvent {
1848
2005
  /** Information about the paywall associated with this checkout. */
1849
2006
  paywallInfo: PaywallInfo;
1850
2007
  }
2008
+ /**
2009
+ * Page-specific details for a multi-page paywall page view.
2010
+ */
2011
+ export interface PageViewData {
2012
+ /** The unique identifier for the page node. */
2013
+ pageNodeId: string;
2014
+ /** The zero-based index of the page in the paywall flow. */
2015
+ flowPosition: number;
2016
+ /** The display name of the page. */
2017
+ pageName: string;
2018
+ /** The unique identifier for the navigation node. */
2019
+ navigationNodeId: string;
2020
+ /** The unique identifier for the previous page node, if any. */
2021
+ previousPageNodeId?: string;
2022
+ /** The flow position of the previous page, if any. */
2023
+ previousFlowPosition?: number;
2024
+ /**
2025
+ * How the user navigated to the page.
2026
+ * Possible values: `"entry"`, `"forward"`, `"back"`, `"auto_transition"`.
2027
+ */
2028
+ navigationType: string;
2029
+ /** Time spent on the previous page in milliseconds, if any. */
2030
+ timeOnPreviousPageMs?: number;
2031
+ }
2032
+ /**
2033
+ * The user navigated to a page in a multi-page paywall.
2034
+ */
2035
+ export interface PaywallPageViewEvent {
2036
+ /** The user navigated to a page in a multi-page paywall. */
2037
+ event: "paywallPageView";
2038
+ /** Information about the paywall associated with this page view. */
2039
+ paywallInfo: PaywallInfo;
2040
+ /** Details about the page that was navigated to. */
2041
+ data: PageViewData;
2042
+ }
1851
2043
  /**
1852
2044
  * A union of all possible string literal values for the `event` property from all specific Superwall event types.
1853
2045
  * This type can be used when you need to refer to an event type name itself.
1854
2046
  */
1855
- export type SuperwallEventType = FirstSeenEvent["event"] | AppOpenEvent["event"] | AppLaunchEvent["event"] | IdentityAliasEvent["event"] | AppInstallEvent["event"] | SessionStartEvent["event"] | ResetEvent["event"] | ConfigRefreshEvent["event"] | ConfigFailEvent["event"] | ConfigAttributesEvent["event"] | ConfirmAllAssignmentsEvent["event"] | TouchesBeganEvent["event"] | SurveyCloseEvent["event"] | RestoreStartEvent["event"] | RestoreCompleteEvent["event"] | RestoreFailEvent["event"] | AdServicesTokenRequestStartEvent["event"] | AdServicesTokenRequestFailEvent["event"] | AdServicesTokenRequestCompleteEvent["event"] | ShimmerViewStartEvent["event"] | ShimmerViewCompleteEvent["event"] | RedemptionStartEvent["event"] | RedemptionCompleteEvent["event"] | RedemptionFailEvent["event"] | EnrichmentStartEvent["event"] | EnrichmentCompleteEvent["event"] | EnrichmentFailEvent["event"] | UnknownEvent["event"] | DeviceAttributesEvent["event"] | SubscriptionStatusDidChangeEvent["event"] | AppCloseEvent["event"] | DeepLinkEvent["event"] | TriggerFireEvent["event"] | PaywallOpenEvent["event"] | PaywallCloseEvent["event"] | PaywallDeclineEvent["event"] | TransactionStartEvent["event"] | TransactionFailEvent["event"] | TransactionAbandonEvent["event"] | TransactionCompleteEvent["event"] | SubscriptionStartEvent["event"] | FreeTrialStartEvent["event"] | TransactionRestoreEvent["event"] | TransactionTimeoutEvent["event"] | UserAttributesEvent["event"] | NonRecurringProductPurchaseEvent["event"] | PaywallResponseLoadStartEvent["event"] | PaywallResponseLoadNotFoundEvent["event"] | PaywallResponseLoadFailEvent["event"] | PaywallResponseLoadCompleteEvent["event"] | PaywallWebviewLoadStartEvent["event"] | PaywallWebviewLoadFailEvent["event"] | PaywallWebviewLoadCompleteEvent["event"] | PaywallWebviewLoadTimeoutEvent["event"] | PaywallWebviewLoadFallbackEvent["event"] | PaywallProductsLoadStartEvent["event"] | PaywallProductsLoadFailEvent["event"] | PaywallProductsLoadCompleteEvent["event"] | PaywallProductsLoadRetryEvent["event"] | SurveyResponseEvent["event"] | PaywallPresentationRequestEvent["event"] | CustomPlacementEvent["event"] | PaywallWebviewProcessTerminatedEvent["event"] | PaywallProductsLoadMissingProductsEvent["event"] | NetworkDecodingFailEvent["event"] | CustomerInfoDidChangeEvent["event"] | IntegrationAttributesEvent["event"] | ReviewRequestedEvent["event"] | PermissionRequestedEvent["event"] | PermissionGrantedEvent["event"] | PermissionDeniedEvent["event"] | PaywallPreloadStartEvent["event"] | PaywallPreloadCompleteEvent["event"] | TestModeModalOpenEvent["event"] | TestModeModalCloseEvent["event"] | StripeCheckoutStartEvent["event"] | StripeCheckoutSubmitEvent["event"] | StripeCheckoutCompleteEvent["event"] | StripeCheckoutFailEvent["event"];
2047
+ export type SuperwallEventType = FirstSeenEvent["event"] | AppOpenEvent["event"] | AppLaunchEvent["event"] | IdentityAliasEvent["event"] | AppInstallEvent["event"] | SessionStartEvent["event"] | ResetEvent["event"] | ConfigRefreshEvent["event"] | ConfigFailEvent["event"] | ConfigAttributesEvent["event"] | ConfirmAllAssignmentsEvent["event"] | TouchesBeganEvent["event"] | SurveyCloseEvent["event"] | RestoreStartEvent["event"] | RestoreCompleteEvent["event"] | RestoreFailEvent["event"] | AdServicesTokenRequestStartEvent["event"] | AdServicesTokenRequestFailEvent["event"] | AdServicesTokenRequestCompleteEvent["event"] | ShimmerViewStartEvent["event"] | ShimmerViewCompleteEvent["event"] | RedemptionStartEvent["event"] | RedemptionCompleteEvent["event"] | RedemptionFailEvent["event"] | EnrichmentStartEvent["event"] | EnrichmentCompleteEvent["event"] | EnrichmentFailEvent["event"] | UnknownEvent["event"] | DeviceAttributesEvent["event"] | SubscriptionStatusDidChangeEvent["event"] | AppCloseEvent["event"] | DeepLinkEvent["event"] | TriggerFireEvent["event"] | PaywallOpenEvent["event"] | PaywallCloseEvent["event"] | PaywallDeclineEvent["event"] | TransactionStartEvent["event"] | TransactionFailEvent["event"] | TransactionAbandonEvent["event"] | TransactionCompleteEvent["event"] | SubscriptionStartEvent["event"] | FreeTrialStartEvent["event"] | TransactionRestoreEvent["event"] | TransactionTimeoutEvent["event"] | UserAttributesEvent["event"] | NonRecurringProductPurchaseEvent["event"] | PaywallResponseLoadStartEvent["event"] | PaywallResponseLoadNotFoundEvent["event"] | PaywallResponseLoadFailEvent["event"] | PaywallResponseLoadCompleteEvent["event"] | PaywallWebviewLoadStartEvent["event"] | PaywallWebviewLoadFailEvent["event"] | PaywallWebviewLoadCompleteEvent["event"] | PaywallWebviewLoadTimeoutEvent["event"] | PaywallWebviewLoadFallbackEvent["event"] | PaywallProductsLoadStartEvent["event"] | PaywallProductsLoadFailEvent["event"] | PaywallProductsLoadCompleteEvent["event"] | PaywallProductsLoadRetryEvent["event"] | SurveyResponseEvent["event"] | PaywallPresentationRequestEvent["event"] | CustomPlacementEvent["event"] | PaywallWebviewProcessTerminatedEvent["event"] | PaywallProductsLoadMissingProductsEvent["event"] | NetworkDecodingFailEvent["event"] | CustomerInfoDidChangeEvent["event"] | IntegrationAttributesEvent["event"] | ReviewRequestedEvent["event"] | PermissionRequestedEvent["event"] | PermissionGrantedEvent["event"] | PermissionDeniedEvent["event"] | PaywallPreloadStartEvent["event"] | PaywallPreloadCompleteEvent["event"] | TestModeModalOpenEvent["event"] | TestModeModalCloseEvent["event"] | StripeCheckoutStartEvent["event"] | StripeCheckoutSubmitEvent["event"] | StripeCheckoutCompleteEvent["event"] | StripeCheckoutFailEvent["event"] | PaywallPageViewEvent["event"];
1856
2048
  /**
1857
2049
  * Represents a Superwall event that can be tracked by the SDK.
1858
2050
  * This is a discriminated union type where the `event` property determines the specific event and its associated payload.
1859
2051
  * These events provide insights into user behavior, SDK operations, and paywall interactions.
1860
2052
  */
1861
- export type SuperwallEvent = FirstSeenEvent | AppOpenEvent | AppLaunchEvent | IdentityAliasEvent | AppInstallEvent | SessionStartEvent | ResetEvent | ConfigRefreshEvent | ConfigFailEvent | ConfigAttributesEvent | ConfirmAllAssignmentsEvent | TouchesBeganEvent | SurveyCloseEvent | RestoreStartEvent | RestoreCompleteEvent | RestoreFailEvent | AdServicesTokenRequestStartEvent | AdServicesTokenRequestFailEvent | AdServicesTokenRequestCompleteEvent | ShimmerViewStartEvent | ShimmerViewCompleteEvent | RedemptionStartEvent | RedemptionCompleteEvent | RedemptionFailEvent | EnrichmentStartEvent | EnrichmentCompleteEvent | EnrichmentFailEvent | UnknownEvent | DeviceAttributesEvent | SubscriptionStatusDidChangeEvent | AppCloseEvent | DeepLinkEvent | TriggerFireEvent | PaywallOpenEvent | PaywallCloseEvent | PaywallDeclineEvent | TransactionStartEvent | TransactionFailEvent | TransactionAbandonEvent | TransactionCompleteEvent | SubscriptionStartEvent | FreeTrialStartEvent | TransactionRestoreEvent | TransactionTimeoutEvent | UserAttributesEvent | NonRecurringProductPurchaseEvent | PaywallResponseLoadStartEvent | PaywallResponseLoadNotFoundEvent | PaywallResponseLoadFailEvent | PaywallResponseLoadCompleteEvent | PaywallWebviewLoadStartEvent | PaywallWebviewLoadFailEvent | PaywallWebviewLoadCompleteEvent | PaywallWebviewLoadTimeoutEvent | PaywallWebviewLoadFallbackEvent | PaywallProductsLoadStartEvent | PaywallProductsLoadFailEvent | PaywallProductsLoadCompleteEvent | PaywallProductsLoadRetryEvent | SurveyResponseEvent | PaywallPresentationRequestEvent | CustomPlacementEvent | PaywallWebviewProcessTerminatedEvent | PaywallProductsLoadMissingProductsEvent | NetworkDecodingFailEvent | CustomerInfoDidChangeEvent | IntegrationAttributesEvent | ReviewRequestedEvent | PermissionRequestedEvent | PermissionGrantedEvent | PermissionDeniedEvent | PaywallPreloadStartEvent | PaywallPreloadCompleteEvent | TestModeModalOpenEvent | TestModeModalCloseEvent | StripeCheckoutStartEvent | StripeCheckoutSubmitEvent | StripeCheckoutCompleteEvent | StripeCheckoutFailEvent;
2053
+ export type SuperwallEvent = FirstSeenEvent | AppOpenEvent | AppLaunchEvent | IdentityAliasEvent | AppInstallEvent | SessionStartEvent | ResetEvent | ConfigRefreshEvent | ConfigFailEvent | ConfigAttributesEvent | ConfirmAllAssignmentsEvent | TouchesBeganEvent | SurveyCloseEvent | RestoreStartEvent | RestoreCompleteEvent | RestoreFailEvent | AdServicesTokenRequestStartEvent | AdServicesTokenRequestFailEvent | AdServicesTokenRequestCompleteEvent | ShimmerViewStartEvent | ShimmerViewCompleteEvent | RedemptionStartEvent | RedemptionCompleteEvent | RedemptionFailEvent | EnrichmentStartEvent | EnrichmentCompleteEvent | EnrichmentFailEvent | UnknownEvent | DeviceAttributesEvent | SubscriptionStatusDidChangeEvent | AppCloseEvent | DeepLinkEvent | TriggerFireEvent | PaywallOpenEvent | PaywallCloseEvent | PaywallDeclineEvent | TransactionStartEvent | TransactionFailEvent | TransactionAbandonEvent | TransactionCompleteEvent | SubscriptionStartEvent | FreeTrialStartEvent | TransactionRestoreEvent | TransactionTimeoutEvent | UserAttributesEvent | NonRecurringProductPurchaseEvent | PaywallResponseLoadStartEvent | PaywallResponseLoadNotFoundEvent | PaywallResponseLoadFailEvent | PaywallResponseLoadCompleteEvent | PaywallWebviewLoadStartEvent | PaywallWebviewLoadFailEvent | PaywallWebviewLoadCompleteEvent | PaywallWebviewLoadTimeoutEvent | PaywallWebviewLoadFallbackEvent | PaywallProductsLoadStartEvent | PaywallProductsLoadFailEvent | PaywallProductsLoadCompleteEvent | PaywallProductsLoadRetryEvent | SurveyResponseEvent | PaywallPresentationRequestEvent | CustomPlacementEvent | PaywallWebviewProcessTerminatedEvent | PaywallProductsLoadMissingProductsEvent | NetworkDecodingFailEvent | CustomerInfoDidChangeEvent | IntegrationAttributesEvent | ReviewRequestedEvent | PermissionRequestedEvent | PermissionGrantedEvent | PermissionDeniedEvent | PaywallPreloadStartEvent | PaywallPreloadCompleteEvent | TestModeModalOpenEvent | TestModeModalCloseEvent | StripeCheckoutStartEvent | StripeCheckoutSubmitEvent | StripeCheckoutCompleteEvent | StripeCheckoutFailEvent | PaywallPageViewEvent;
1862
2054
  /**
1863
2055
  * Contains information about a Superwall event, including the specific {@link SuperwallEvent}
1864
2056
  * that occurred and any associated parameters. This structure is used by the `onSuperwallEvent` callback
@@ -1915,6 +2107,14 @@ export type LogScope = "localizationManager" | "bounceButton" | "coreData" | "co
1915
2107
  export type OnPurchaseParamsIOS = {
1916
2108
  productId: string;
1917
2109
  platform: "ios";
2110
+ /**
2111
+ * The store that backs the product being purchased. See {@link ProductStore}.
2112
+ * When the value is `"CUSTOM"`, the product is not backed by StoreKit and your
2113
+ * purchase handler must implement the purchase itself (e.g., calling your backend).
2114
+ * May be `undefined` if the product cannot be matched against the most recently
2115
+ * presented paywall (e.g., during background flows).
2116
+ */
2117
+ store?: ProductStore;
1918
2118
  };
1919
2119
  export type OnPurchaseParamsAndroid = {
1920
2120
  productId: string;
@@ -1923,6 +2123,17 @@ export type OnPurchaseParamsAndroid = {
1923
2123
  offerId?: string;
1924
2124
  };
1925
2125
  export type OnPurchaseParams = OnPurchaseParamsIOS | OnPurchaseParamsAndroid;
2126
+ /**
2127
+ * Represents the result of a purchase restoration attempt.
2128
+ * - `restored`: The restoration completed successfully.
2129
+ * - `failed`: The restoration failed, with an accompanying error message.
2130
+ */
2131
+ export type RestorationResultResponse = {
2132
+ result: "restored";
2133
+ } | {
2134
+ result: "failed";
2135
+ errorMessage: string | null;
2136
+ };
1926
2137
  /**
1927
2138
  * Defines the events emitted by the native Superwall Expo module that can be listened to.
1928
2139
  * These events provide a way to react to various SDK activities and user interactions.