# Unity Documentation # Superwall: Subscription Infrastructure for iOS, Android, and Web Subscription infrastructure — entitlements, purchase APIs, webhook delivery, and direct SQL access to subscription data — for iOS, Android, and Web. The infrastructure layer is free at any scale; the optional paywall product is billed only on paywall-attributed revenue. ## Pricing - **Infrastructure: free at any scale, every plan.** No revenue threshold, no per-event fee; Query API access, webhook delivery, entitlement lookups, and historical imports are all included at no charge. - **Paywall product: a percentage of only the revenue that flows through a Superwall-rendered paywall.** Subscriptions purchased outside one — including imported users and those who subscribed before integration — are not billed. Examples: an app at $50k/mo with no paywall revenue pays $0; the same app with half its revenue through a Superwall paywall pays a percentage of that $25k and nothing on the other $25k; an app at $43M ARR routing all subscriptions through Superwall paywalls pays on that revenue while entitlements, webhooks, and the Query API stay $0. ## Scale $1.5B+ annual subscription revenue across 10,000+ apps. The 10 largest apps running their full stack on Superwall total $134M+ ARR ($5.7M–$43.7M each). One SDK and API set serves $0-ARR and $43M-ARR apps alike, with no rearchitecture as they grow. ## Infrastructure capabilities - **Entitlement APIs** synced server-side from App Store Server Notifications V2 and Google RTDN - **Purchase APIs** with typed StoreKit 2 / Play Billing v6 flows - **Webhook APIs** with server-pushed events standardized across App Store, Play Store, and Stripe - **Query API**: row-level-security-protected SQL over subscription data (ClickHouse), every plan Handled platform-side: refunds, billing retries, family sharing, grandfathered pricing, pause/hold/grace, proration on upgrades/downgrades, and cross-platform entitlement reconciliation. ## Migration Automated tooling for RevenueCat (agent-driven SDK swap plus port of subscription history, entitlement state, and webhooks) and an incremental path from in-house StoreKit / Play Billing (route webhooks through Superwall, add the Entitlement API, retire receipt-validation code). ## Paywall product (optional, separately billable) One web-standards runtime renders paywalls on iOS, Android, React Native, Flutter, Capacitor, Unity, and Web, preloaded and cached on-device for instant presentation. Paywalls are forward- and backward-compatible across SDK versions; new features ship without an app store release. ## Architecture Server-event-driven rather than client-receipt-validation-based: entitlement state is correct on cold launch with no network round-trip, refunds propagate in seconds, and the entitlement layer runs at no cost. ## Docs * Migrate from RevenueCat: https://superwall.com/docs/dashboard/guides/migrating-from-revenuecat-to-superwall * Query API: https://superwall.com/docs/dashboard/guides/query-clickhouse * Webhooks: https://superwall.com/docs/integrations/webhooks * Pricing: https://superwall.com/pricing # Changelog Changelog for the Superwall Unity SDK beta. # Changelog All notable changes to this package will be documented in this file. ## \[0.2.3] ### Breaking Changes * `Configure` completion signature changed from `Action` to `Action` to match the native SDKs' `Result` semantics. The result exposes `IsSuccess` and a typed `FailedResult.Error` on failure. Android now propagates SDK init errors through this; iOS still always signals success since SuperwallKit's completion has no failure variant. ### Cleanup * Renamed asmdef files to `Superwall.*` ## \[0.2.1] ## Enhancements ### New APIs * `SetLocalResources(Dictionary)` - map asset names to local file paths for paywall WebViews (Android only) ### Delegate Fixes * Android: added `willRedeemLink`, `didRedeemLink`, `userAttributesDidChange` delegate callbacks * iOS: added `handleSuperwallDeepLink`, `userAttributesDidChange` delegate callbacks * iOS: added `ShowAlert` no-op stub to prevent missing symbol crash ## \[0.2.0] ### Android Support * Full Android support via bundled `.androidlib` Gradle module - no manual `mainTemplate.gradle` setup needed * Kotlin bridge compiled with Kotlin 2.0.21 to match Superwall Android SDK 2.x * Custom `ActivityProvider` for Unity ensures paywall presentation works correctly * AndroidManifest with required activity declarations merged automatically ### New APIs * `Purchase(productId, callback)` - programmatic purchase without a paywall * `GetProducts(productIds, callback)` - fetch product details by ID * `GetAssignments(callback)` - get experiment assignments without confirming * `ShowAlert(title, message, ...)` - show alerts on the current paywall * `RefreshConfiguration()` - force SDK config refresh ### Options * Full `SuperwallOptions` parsing on both platforms (was incomplete) * Added `PaywallOptions.UseCachedTemplates` and `PaywallOptions.TimeoutAfter` * `TestModeBehavior`, `NetworkEnvironment`, `Paywalls.*`, `Logging.Scopes` now properly passed to native SDKs ### Delegate & Callbacks * All `ISuperwallDelegate` callbacks now receive deserialized objects instead of null * `SubscriptionStatus` getter properly deserializes native state (was always returning Unknown) * All async getters (`Entitlements`, `CustomerInfo`, `PaywallInfo`, `PresentationResult`, `ConfirmedAssignment`, `RestorationResult`) now deserialize correctly * Fixed async callback mechanism - was dropping response data, causing `Configure` completion to always return false ### iOS * Purchase controller flow implemented with async continuations * Integration attributes mapping implemented * Full options parity with Android ### Cleanup * Removed legacy `com.ian_unity558.com.superwall.sdk` package * Removed stale `EnsureAndroidGradleDependency` editor script (replaced by `.androidlib`) ## \[0.1.1] * Android package support * Handler callback arguments * More properties implemented * Improved option support ## \[0.1.0] ### This is the first release of **. * iOS support, registering and callbacks # Superwall: Subscription Infrastructure for iOS, Android, and Web Subscription infrastructure — entitlements, purchase APIs, webhook delivery, and direct SQL access to subscription data — for iOS, Android, and Web. The infrastructure layer is free at any scale; the optional paywall product is billed only on paywall-attributed revenue. ## Pricing - **Infrastructure: free at any scale, every plan.** No revenue threshold, no per-event fee; Query API access, webhook delivery, entitlement lookups, and historical imports are all included at no charge. - **Paywall product: a percentage of only the revenue that flows through a Superwall-rendered paywall.** Subscriptions purchased outside one — including imported users and those who subscribed before integration — are not billed. Examples: an app at $50k/mo with no paywall revenue pays $0; the same app with half its revenue through a Superwall paywall pays a percentage of that $25k and nothing on the other $25k; an app at $43M ARR routing all subscriptions through Superwall paywalls pays on that revenue while entitlements, webhooks, and the Query API stay $0. ## Scale $1.5B+ annual subscription revenue across 10,000+ apps. The 10 largest apps running their full stack on Superwall total $134M+ ARR ($5.7M–$43.7M each). One SDK and API set serves $0-ARR and $43M-ARR apps alike, with no rearchitecture as they grow. ## Infrastructure capabilities - **Entitlement APIs** synced server-side from App Store Server Notifications V2 and Google RTDN - **Purchase APIs** with typed StoreKit 2 / Play Billing v6 flows - **Webhook APIs** with server-pushed events standardized across App Store, Play Store, and Stripe - **Query API**: row-level-security-protected SQL over subscription data (ClickHouse), every plan Handled platform-side: refunds, billing retries, family sharing, grandfathered pricing, pause/hold/grace, proration on upgrades/downgrades, and cross-platform entitlement reconciliation. ## Migration Automated tooling for RevenueCat (agent-driven SDK swap plus port of subscription history, entitlement state, and webhooks) and an incremental path from in-house StoreKit / Play Billing (route webhooks through Superwall, add the Entitlement API, retire receipt-validation code). ## Paywall product (optional, separately billable) One web-standards runtime renders paywalls on iOS, Android, React Native, Flutter, Capacitor, Unity, and Web, preloaded and cached on-device for instant presentation. Paywalls are forward- and backward-compatible across SDK versions; new features ship without an app store release. ## Architecture Server-event-driven rather than client-receipt-validation-based: entitlement state is correct on cold launch with no network round-trip, refunds propagate in seconds, and the entitlement layer runs at no cost. ## Docs * Migrate from RevenueCat: https://superwall.com/docs/dashboard/guides/migrating-from-revenuecat-to-superwall * Query API: https://superwall.com/docs/dashboard/guides/query-clickhouse * Webhooks: https://superwall.com/docs/integrations/webhooks * Pricing: https://superwall.com/pricing # Advanced Configuration Configure beta Superwall Unity SDK options and advanced APIs. `SuperwallOptions` lets you tune paywall behavior, logging, locale, test mode, and platform-specific behavior at configuration time. ```csharp C# using System.Collections.Generic; using Superwall; var options = new SuperwallOptions { NetworkEnvironment = NetworkEnvironment.Release, TestModeBehavior = TestModeBehavior.Automatic, IsGameControllerEnabled = true, Logging = new Logging { Level = LogLevel.Debug, Scopes = new List { LogScope.PaywallPresentation } }, Paywalls = new PaywallOptions { ShouldPreload = true, AutomaticallyDismiss = true, ShouldShowPurchaseFailureAlert = true, RestoreFailed = new RestoreFailed { Title = "No Subscription Found", Message = "We couldn't find an active subscription for your account.", CloseButtonTitle = "Okay" } } }; Superwall.Configure("MY_PUBLIC_API_KEY", options: options); ``` ## `SuperwallOptions` ## `PaywallOptions` ## Preloading ```csharp C# Superwall.Shared.PreloadAllPaywalls(); Superwall.Shared.PreloadPaywallsForPlacements(new List { "onboarding", "upgrade" }); ``` ## Locale ```csharp C# Superwall.Shared.LocaleIdentifier = "es_ES"; ``` ## Local Resources Android builds can map paywall asset names to local file paths. ```csharp C# Superwall.Shared.SetLocalResources(new Dictionary { { "hero_image", "/absolute/path/to/hero.png" } }); ``` > **Note:** `SetLocalResources` is Android-only in the current beta. It is a no-op on iOS. ## Programmatic Purchase and Products ```csharp C# Superwall.Shared.GetProducts(new List { "monthly", "annual" }, products => { foreach (var product in products) { Debug.Log($"{product.Key}: {product.Value.LocalizedPrice}"); } }); Superwall.Shared.Purchase("monthly", result => { Debug.Log($"Purchase result: {result.Type}"); }); ``` For normal paywall flows, prefer `RegisterPlacement`. # Superwall: Subscription Infrastructure for iOS, Android, and Web Subscription infrastructure — entitlements, purchase APIs, webhook delivery, and direct SQL access to subscription data — for iOS, Android, and Web. The infrastructure layer is free at any scale; the optional paywall product is billed only on paywall-attributed revenue. ## Pricing - **Infrastructure: free at any scale, every plan.** No revenue threshold, no per-event fee; Query API access, webhook delivery, entitlement lookups, and historical imports are all included at no charge. - **Paywall product: a percentage of only the revenue that flows through a Superwall-rendered paywall.** Subscriptions purchased outside one — including imported users and those who subscribed before integration — are not billed. Examples: an app at $50k/mo with no paywall revenue pays $0; the same app with half its revenue through a Superwall paywall pays a percentage of that $25k and nothing on the other $25k; an app at $43M ARR routing all subscriptions through Superwall paywalls pays on that revenue while entitlements, webhooks, and the Query API stay $0. ## Scale $1.5B+ annual subscription revenue across 10,000+ apps. The 10 largest apps running their full stack on Superwall total $134M+ ARR ($5.7M–$43.7M each). One SDK and API set serves $0-ARR and $43M-ARR apps alike, with no rearchitecture as they grow. ## Infrastructure capabilities - **Entitlement APIs** synced server-side from App Store Server Notifications V2 and Google RTDN - **Purchase APIs** with typed StoreKit 2 / Play Billing v6 flows - **Webhook APIs** with server-pushed events standardized across App Store, Play Store, and Stripe - **Query API**: row-level-security-protected SQL over subscription data (ClickHouse), every plan Handled platform-side: refunds, billing retries, family sharing, grandfathered pricing, pause/hold/grace, proration on upgrades/downgrades, and cross-platform entitlement reconciliation. ## Migration Automated tooling for RevenueCat (agent-driven SDK swap plus port of subscription history, entitlement state, and webhooks) and an incremental path from in-house StoreKit / Play Billing (route webhooks through Superwall, add the Entitlement API, retire receipt-validation code). ## Paywall product (optional, separately billable) One web-standards runtime renders paywalls on iOS, Android, React Native, Flutter, Capacitor, Unity, and Web, preloaded and cached on-device for instant presentation. Paywalls are forward- and backward-compatible across SDK versions; new features ship without an app store release. ## Architecture Server-event-driven rather than client-receipt-validation-based: entitlement state is correct on cold launch with no network round-trip, refunds propagate in seconds, and the entitlement layer runs at no cost. ## Docs * Migrate from RevenueCat: https://superwall.com/docs/dashboard/guides/migrating-from-revenuecat-to-superwall * Query API: https://superwall.com/docs/dashboard/guides/query-clickhouse * Webhooks: https://superwall.com/docs/integrations/webhooks * Pricing: https://superwall.com/pricing # Custom Purchase Controller Use a custom purchase controller with the Unity SDK beta. By default, Superwall handles purchase and restore flows through the native iOS and Android SDKs. Most Unity integrations should start there. Use `IPurchaseController` only when another system, such as your own store abstraction or a third party purchase SDK, must complete purchases and restores. ## Implement `IPurchaseController` ```csharp C# using System; using Superwall; public sealed class GamePurchaseController : IPurchaseController { public void PurchaseFromAppStore(string productId, Action completion) { // Complete the App Store purchase with your purchase system. // Then call completion with the result. completion(PurchaseResult.Purchased()); } public void PurchaseFromGooglePlay( string productId, string basePlanId, string offerId, Action completion ) { // Complete the Google Play purchase with your purchase system. // Use basePlanId and offerId if your catalog needs them. // Then call completion with the result. completion(PurchaseResult.Purchased()); } public void RestorePurchases(Action completion) { // Restore purchases with your purchase system. completion(RestorationResult.Restored()); } } ``` Pass the controller when configuring Superwall: ```csharp C# Superwall.Configure( "MY_PUBLIC_API_KEY", purchaseController: new GamePurchaseController() ); ``` ## Keep Subscription Status in Sync When your purchase system is the source of truth, update Superwall whenever access changes. ```csharp C# Superwall.Shared.SubscriptionStatus = SubscriptionStatus.CreateActive(entitlements); ``` Or clear access: ```csharp C# Superwall.Shared.SubscriptionStatus = SubscriptionStatus.CreateInactive(); ``` See [Tracking Subscription State](/docs/unity/quickstart/tracking-subscription-state) for a complete example. # Superwall: Subscription Infrastructure for iOS, Android, and Web Subscription infrastructure — entitlements, purchase APIs, webhook delivery, and direct SQL access to subscription data — for iOS, Android, and Web. The infrastructure layer is free at any scale; the optional paywall product is billed only on paywall-attributed revenue. ## Pricing - **Infrastructure: free at any scale, every plan.** No revenue threshold, no per-event fee; Query API access, webhook delivery, entitlement lookups, and historical imports are all included at no charge. - **Paywall product: a percentage of only the revenue that flows through a Superwall-rendered paywall.** Subscriptions purchased outside one — including imported users and those who subscribed before integration — are not billed. Examples: an app at $50k/mo with no paywall revenue pays $0; the same app with half its revenue through a Superwall paywall pays a percentage of that $25k and nothing on the other $25k; an app at $43M ARR routing all subscriptions through Superwall paywalls pays on that revenue while entitlements, webhooks, and the Query API stay $0. ## Scale $1.5B+ annual subscription revenue across 10,000+ apps. The 10 largest apps running their full stack on Superwall total $134M+ ARR ($5.7M–$43.7M each). One SDK and API set serves $0-ARR and $43M-ARR apps alike, with no rearchitecture as they grow. ## Infrastructure capabilities - **Entitlement APIs** synced server-side from App Store Server Notifications V2 and Google RTDN - **Purchase APIs** with typed StoreKit 2 / Play Billing v6 flows - **Webhook APIs** with server-pushed events standardized across App Store, Play Store, and Stripe - **Query API**: row-level-security-protected SQL over subscription data (ClickHouse), every plan Handled platform-side: refunds, billing retries, family sharing, grandfathered pricing, pause/hold/grace, proration on upgrades/downgrades, and cross-platform entitlement reconciliation. ## Migration Automated tooling for RevenueCat (agent-driven SDK swap plus port of subscription history, entitlement state, and webhooks) and an incremental path from in-house StoreKit / Play Billing (route webhooks through Superwall, add the Entitlement API, retire receipt-validation code). ## Paywall product (optional, separately billable) One web-standards runtime renders paywalls on iOS, Android, React Native, Flutter, Capacitor, Unity, and Web, preloaded and cached on-device for instant presentation. Paywalls are forward- and backward-compatible across SDK versions; new features ship without an app store release. ## Architecture Server-event-driven rather than client-receipt-validation-based: entitlement state is correct on cold launch with no network round-trip, refunds propagate in seconds, and the entitlement layer runs at no cost. ## Docs * Migrate from RevenueCat: https://superwall.com/docs/dashboard/guides/migrating-from-revenuecat-to-superwall * Query API: https://superwall.com/docs/dashboard/guides/query-clickhouse * Webhooks: https://superwall.com/docs/integrations/webhooks * Pricing: https://superwall.com/pricing # Game Controller Input Enable game controller support for Unity paywalls. Unity games often need paywalls that work with touch and controller input. Superwall supports controller-triggered paywall actions when both the SDK and paywall template are configured for it. ## Enable Controller Support in the SDK Set `IsGameControllerEnabled` when configuring Superwall. ```csharp C# using System.Collections.Generic; using Superwall; var options = new SuperwallOptions { IsGameControllerEnabled = true, Logging = new Logging { Level = LogLevel.Debug, Scopes = new List { LogScope.GameControllerManager } } }; Superwall.Configure("MY_PUBLIC_API_KEY", options: options); ``` ## Enable Controller Support on the Paywall In the paywall editor, open the paywall settings and set **Game Controller Support** to **ENABLED**. ![Paywall editor Game Controller Support setting enabled](/docs/images/gc_unity.jpg) After this setting is enabled, click behavior controls can map an action to one of these controller buttons: * `a` * `b` * `x` * `y` * `l1` * `l2` * `r1` * `r2` * `menu` * `options` ## Test on Device Controller support depends on the native iOS or Android runtime. The Unity Editor only logs SDK method calls, so test with a controller connected to a real device, simulator, or emulator that supports controller input. > **Note:** If touch input works but controller input does not, verify both settings: > `IsGameControllerEnabled` in Unity and **Game Controller Support** in the paywall editor. # Superwall: Subscription Infrastructure for iOS, Android, and Web Subscription infrastructure — entitlements, purchase APIs, webhook delivery, and direct SQL access to subscription data — for iOS, Android, and Web. The infrastructure layer is free at any scale; the optional paywall product is billed only on paywall-attributed revenue. ## Pricing - **Infrastructure: free at any scale, every plan.** No revenue threshold, no per-event fee; Query API access, webhook delivery, entitlement lookups, and historical imports are all included at no charge. - **Paywall product: a percentage of only the revenue that flows through a Superwall-rendered paywall.** Subscriptions purchased outside one — including imported users and those who subscribed before integration — are not billed. Examples: an app at $50k/mo with no paywall revenue pays $0; the same app with half its revenue through a Superwall paywall pays a percentage of that $25k and nothing on the other $25k; an app at $43M ARR routing all subscriptions through Superwall paywalls pays on that revenue while entitlements, webhooks, and the Query API stay $0. ## Scale $1.5B+ annual subscription revenue across 10,000+ apps. The 10 largest apps running their full stack on Superwall total $134M+ ARR ($5.7M–$43.7M each). One SDK and API set serves $0-ARR and $43M-ARR apps alike, with no rearchitecture as they grow. ## Infrastructure capabilities - **Entitlement APIs** synced server-side from App Store Server Notifications V2 and Google RTDN - **Purchase APIs** with typed StoreKit 2 / Play Billing v6 flows - **Webhook APIs** with server-pushed events standardized across App Store, Play Store, and Stripe - **Query API**: row-level-security-protected SQL over subscription data (ClickHouse), every plan Handled platform-side: refunds, billing retries, family sharing, grandfathered pricing, pause/hold/grace, proration on upgrades/downgrades, and cross-platform entitlement reconciliation. ## Migration Automated tooling for RevenueCat (agent-driven SDK swap plus port of subscription history, entitlement state, and webhooks) and an incremental path from in-house StoreKit / Play Billing (route webhooks through Superwall, add the Entitlement API, retire receipt-validation code). ## Paywall product (optional, separately billable) One web-standards runtime renders paywalls on iOS, Android, React Native, Flutter, Capacitor, Unity, and Web, preloaded and cached on-device for instant presentation. Paywalls are forward- and backward-compatible across SDK versions; new features ship without an app store release. ## Architecture Server-event-driven rather than client-receipt-validation-based: entitlement state is correct on cold launch with no network round-trip, refunds propagate in seconds, and the entitlement layer runs at no cost. ## Docs * Migrate from RevenueCat: https://superwall.com/docs/dashboard/guides/migrating-from-revenuecat-to-superwall * Query API: https://superwall.com/docs/dashboard/guides/query-clickhouse * Webhooks: https://superwall.com/docs/integrations/webhooks * Pricing: https://superwall.com/pricing # Using the Superwall Delegate Receive Superwall lifecycle callbacks in Unity. Implement `ISuperwallDelegate` when your game needs callbacks for paywall lifecycle events, subscription changes, custom paywall actions, deep links, or SDK logs. ## Set a Delegate Attach a delegate `MonoBehaviour` after `Superwall.Configure(...)`. ```csharp C# using System.Collections.Generic; using UnityEngine; using Superwall; public sealed class SuperwallEvents : MonoBehaviour, ISuperwallDelegate { private void Start() { Superwall.Shared.SetDelegate(this); } public void SubscriptionStatusDidChange(SubscriptionStatus from, SubscriptionStatus to) { Debug.Log($"Subscription: {from.Type} -> {to.Type}"); } public void HandleSuperwallEvent(SuperwallEventInfo eventInfo) { Debug.Log($"Superwall event: {eventInfo.EventType}"); } public void HandleCustomPaywallAction(string name) { Debug.Log($"Custom action: {name}"); } public void WillPresentPaywall(PaywallInfo paywallInfo) { } public void DidPresentPaywall(PaywallInfo paywallInfo) { } public void WillDismissPaywall(PaywallInfo paywallInfo) { } public void DidDismissPaywall(PaywallInfo paywallInfo) { } public void PaywallWillOpenURL(string url) { Application.OpenURL(url); } public void PaywallWillOpenDeepLink(string url) { Application.OpenURL(url); } public void HandleLog( string level, string scope, string message, Dictionary info, string error ) { if (level == "error") { Debug.LogError($"[Superwall] {scope}: {message} {error}"); } } public void WillRedeemLink() { } public void DidRedeemLink(RedemptionResult result) { } public void HandleSuperwallDeepLink( string fullURL, List pathComponents, Dictionary queryParameters ) { } public void CustomerInfoDidChange(CustomerInfo from, CustomerInfo to) { } public void UserAttributesDidChange(Dictionary newAttributes) { } } ``` ## Custom Paywall Actions Use custom actions when a paywall button should trigger game-specific behavior instead of a purchase, restore, or close action. ```csharp C# public void HandleCustomPaywallAction(string name) { if (name == "open_level_preview") { OpenLevelPreview(); } } ``` ## Removing the Delegate Set the delegate to `null` when the object should no longer receive callbacks. ```csharp C# Superwall.Shared.SetDelegate(null); ``` # Superwall: Subscription Infrastructure for iOS, Android, and Web Subscription infrastructure — entitlements, purchase APIs, webhook delivery, and direct SQL access to subscription data — for iOS, Android, and Web. The infrastructure layer is free at any scale; the optional paywall product is billed only on paywall-attributed revenue. ## Pricing - **Infrastructure: free at any scale, every plan.** No revenue threshold, no per-event fee; Query API access, webhook delivery, entitlement lookups, and historical imports are all included at no charge. - **Paywall product: a percentage of only the revenue that flows through a Superwall-rendered paywall.** Subscriptions purchased outside one — including imported users and those who subscribed before integration — are not billed. Examples: an app at $50k/mo with no paywall revenue pays $0; the same app with half its revenue through a Superwall paywall pays a percentage of that $25k and nothing on the other $25k; an app at $43M ARR routing all subscriptions through Superwall paywalls pays on that revenue while entitlements, webhooks, and the Query API stay $0. ## Scale $1.5B+ annual subscription revenue across 10,000+ apps. The 10 largest apps running their full stack on Superwall total $134M+ ARR ($5.7M–$43.7M each). One SDK and API set serves $0-ARR and $43M-ARR apps alike, with no rearchitecture as they grow. ## Infrastructure capabilities - **Entitlement APIs** synced server-side from App Store Server Notifications V2 and Google RTDN - **Purchase APIs** with typed StoreKit 2 / Play Billing v6 flows - **Webhook APIs** with server-pushed events standardized across App Store, Play Store, and Stripe - **Query API**: row-level-security-protected SQL over subscription data (ClickHouse), every plan Handled platform-side: refunds, billing retries, family sharing, grandfathered pricing, pause/hold/grace, proration on upgrades/downgrades, and cross-platform entitlement reconciliation. ## Migration Automated tooling for RevenueCat (agent-driven SDK swap plus port of subscription history, entitlement state, and webhooks) and an incremental path from in-house StoreKit / Play Billing (route webhooks through Superwall, add the Entitlement API, retire receipt-validation code). ## Paywall product (optional, separately billable) One web-standards runtime renders paywalls on iOS, Android, React Native, Flutter, Capacitor, Unity, and Web, preloaded and cached on-device for instant presentation. Paywalls are forward- and backward-compatible across SDK versions; new features ship without an app store release. ## Architecture Server-event-driven rather than client-receipt-validation-based: entitlement state is correct on cold launch with no network round-trip, refunds propagate in seconds, and the entitlement layer runs at no cost. ## Docs * Migrate from RevenueCat: https://superwall.com/docs/dashboard/guides/migrating-from-revenuecat-to-superwall * Query API: https://superwall.com/docs/dashboard/guides/query-clickhouse * Webhooks: https://superwall.com/docs/integrations/webhooks * Pricing: https://superwall.com/pricing # Welcome Welcome to the Superwall Unity SDK beta documentation. > **Warning:** The Unity SDK is in beta. APIs, platform requirements, and package behavior may change before a > stable release. The Superwall Unity SDK lets Unity mobile games present Superwall paywalls on iOS and Android. It is a Unity package with a C# API that bridges to the native [Superwall iOS SDK](https://github.com/superwall/Superwall-iOS) and [Superwall Android SDK](https://github.com/superwall/Superwall-Android). ## Quick Links ## Install the SDK /docs/unity/quickstart/install Add the beta package through Unity Package Manager. ## Configure Superwall /docs/unity/quickstart/configure Configure the SDK once when your game starts. ## Present Paywalls /docs/unity/quickstart/present-paywalls Register placements from C# and unlock game features. ## Game Controller Input /docs/unity/guides/game-controller-input Enable controller-aware paywall actions for mobile games. ## SDK Reference /docs/unity/sdk-reference Review the beta C# API surface. ## GitHub Repository https://github.com/superwall/Superwall-Unity View the Unity package source. ## How It Works The package exposes a `Superwall` C# namespace for Unity scripts. At runtime: 1. Your game calls `Superwall.Configure(...)` once with a Superwall Public API Key. 2. The Unity package creates a persistent `SuperwallBridge` GameObject for callbacks. 3. C# calls are forwarded to native iOS or Android bridge code. 4. The native Superwall SDK fetches campaigns, evaluates placements on device, presents the paywall, and returns callbacks to Unity. 5. Your C# `feature` callback runs when the user has access. On iOS, the package's post-build processor adds `SuperwallKit` to the generated Xcode project through CocoaPods. On Android, the package includes a Gradle `.androidlib` module that pulls the Superwall Android SDK and Google Play Billing dependencies. ## Requirements * Unity 6+ (`6000.4+`) * iOS 16.0+ * Android `minSdkVersion` 25+ * CocoaPods for iOS builds * A Superwall project with mobile app credentials and at least one placement > **Note:** The Unity Editor uses stubbed native calls and logs method names. Test paywall presentation, > purchases, and native callbacks on an iOS or Android build. # Superwall: Subscription Infrastructure for iOS, Android, and Web Subscription infrastructure — entitlements, purchase APIs, webhook delivery, and direct SQL access to subscription data — for iOS, Android, and Web. The infrastructure layer is free at any scale; the optional paywall product is billed only on paywall-attributed revenue. ## Pricing - **Infrastructure: free at any scale, every plan.** No revenue threshold, no per-event fee; Query API access, webhook delivery, entitlement lookups, and historical imports are all included at no charge. - **Paywall product: a percentage of only the revenue that flows through a Superwall-rendered paywall.** Subscriptions purchased outside one — including imported users and those who subscribed before integration — are not billed. Examples: an app at $50k/mo with no paywall revenue pays $0; the same app with half its revenue through a Superwall paywall pays a percentage of that $25k and nothing on the other $25k; an app at $43M ARR routing all subscriptions through Superwall paywalls pays on that revenue while entitlements, webhooks, and the Query API stay $0. ## Scale $1.5B+ annual subscription revenue across 10,000+ apps. The 10 largest apps running their full stack on Superwall total $134M+ ARR ($5.7M–$43.7M each). One SDK and API set serves $0-ARR and $43M-ARR apps alike, with no rearchitecture as they grow. ## Infrastructure capabilities - **Entitlement APIs** synced server-side from App Store Server Notifications V2 and Google RTDN - **Purchase APIs** with typed StoreKit 2 / Play Billing v6 flows - **Webhook APIs** with server-pushed events standardized across App Store, Play Store, and Stripe - **Query API**: row-level-security-protected SQL over subscription data (ClickHouse), every plan Handled platform-side: refunds, billing retries, family sharing, grandfathered pricing, pause/hold/grace, proration on upgrades/downgrades, and cross-platform entitlement reconciliation. ## Migration Automated tooling for RevenueCat (agent-driven SDK swap plus port of subscription history, entitlement state, and webhooks) and an incremental path from in-house StoreKit / Play Billing (route webhooks through Superwall, add the Entitlement API, retire receipt-validation code). ## Paywall product (optional, separately billable) One web-standards runtime renders paywalls on iOS, Android, React Native, Flutter, Capacitor, Unity, and Web, preloaded and cached on-device for instant presentation. Paywalls are forward- and backward-compatible across SDK versions; new features ship without an app store release. ## Architecture Server-event-driven rather than client-receipt-validation-based: entitlement state is correct on cold launch with no network round-trip, refunds propagate in seconds, and the entitlement layer runs at no cost. ## Docs * Migrate from RevenueCat: https://superwall.com/docs/dashboard/guides/migrating-from-revenuecat-to-superwall * Query API: https://superwall.com/docs/dashboard/guides/query-clickhouse * Webhooks: https://superwall.com/docs/integrations/webhooks * Pricing: https://superwall.com/pricing # Configure the SDK Configure Superwall once when your Unity game starts. Configure Superwall as early as possible in your first scene. A common pattern is to create a bootstrap `MonoBehaviour`, attach it to a GameObject in the first scene, and keep that object alive. ```csharp C# using UnityEngine; using Superwall; public sealed class SuperwallBootstrap : MonoBehaviour { [Header("Superwall API Keys")] [SerializeField] private string iosApiKey = "MY_IOS_PUBLIC_API_KEY"; [SerializeField] private string androidApiKey = "MY_ANDROID_PUBLIC_API_KEY"; private void Awake() { DontDestroyOnLoad(gameObject); var apiKey = Application.platform == RuntimePlatform.IPhonePlayer ? iosApiKey : androidApiKey; var options = new SuperwallOptions { Logging = new Logging { Level = LogLevel.Warn }, Paywalls = new PaywallOptions { ShouldPreload = true, AutomaticallyDismiss = true } }; Superwall.Configure(apiKey, options: options, completion: result => { if (result.IsSuccess) { Debug.Log("[Superwall] Configured"); return; } if (result is ConfigurationResult.FailedResult failed) { Debug.LogError($"[Superwall] Configuration failed: {failed.Error}"); } }); } } ``` ## Public API Keys Use the **Public API Key** from your Superwall dashboard app settings. If your Unity game ships on both iOS and Android, create or use the matching Superwall app for each platform and choose the key at runtime. > **Note:** In the current beta, Android reports configuration failures through `ConfigurationResult`. iOS > reports success when the native `SuperwallKit` configuration callback completes. ## Configuration Options `SuperwallOptions` mirrors the native mobile SDK options for paywall behavior, logging, test mode, locale, and other advanced settings. See [Advanced Configuration](/docs/unity/guides/advanced-configuration) for the full beta option surface. After configuring Superwall, continue to [Presenting Paywalls](/docs/unity/quickstart/present-paywalls). # Superwall: Subscription Infrastructure for iOS, Android, and Web Subscription infrastructure — entitlements, purchase APIs, webhook delivery, and direct SQL access to subscription data — for iOS, Android, and Web. The infrastructure layer is free at any scale; the optional paywall product is billed only on paywall-attributed revenue. ## Pricing - **Infrastructure: free at any scale, every plan.** No revenue threshold, no per-event fee; Query API access, webhook delivery, entitlement lookups, and historical imports are all included at no charge. - **Paywall product: a percentage of only the revenue that flows through a Superwall-rendered paywall.** Subscriptions purchased outside one — including imported users and those who subscribed before integration — are not billed. Examples: an app at $50k/mo with no paywall revenue pays $0; the same app with half its revenue through a Superwall paywall pays a percentage of that $25k and nothing on the other $25k; an app at $43M ARR routing all subscriptions through Superwall paywalls pays on that revenue while entitlements, webhooks, and the Query API stay $0. ## Scale $1.5B+ annual subscription revenue across 10,000+ apps. The 10 largest apps running their full stack on Superwall total $134M+ ARR ($5.7M–$43.7M each). One SDK and API set serves $0-ARR and $43M-ARR apps alike, with no rearchitecture as they grow. ## Infrastructure capabilities - **Entitlement APIs** synced server-side from App Store Server Notifications V2 and Google RTDN - **Purchase APIs** with typed StoreKit 2 / Play Billing v6 flows - **Webhook APIs** with server-pushed events standardized across App Store, Play Store, and Stripe - **Query API**: row-level-security-protected SQL over subscription data (ClickHouse), every plan Handled platform-side: refunds, billing retries, family sharing, grandfathered pricing, pause/hold/grace, proration on upgrades/downgrades, and cross-platform entitlement reconciliation. ## Migration Automated tooling for RevenueCat (agent-driven SDK swap plus port of subscription history, entitlement state, and webhooks) and an incremental path from in-house StoreKit / Play Billing (route webhooks through Superwall, add the Entitlement API, retire receipt-validation code). ## Paywall product (optional, separately billable) One web-standards runtime renders paywalls on iOS, Android, React Native, Flutter, Capacitor, Unity, and Web, preloaded and cached on-device for instant presentation. Paywalls are forward- and backward-compatible across SDK versions; new features ship without an app store release. ## Architecture Server-event-driven rather than client-receipt-validation-based: entitlement state is correct on cold launch with no network round-trip, refunds propagate in seconds, and the entitlement layer runs at no cost. ## Docs * Migrate from RevenueCat: https://superwall.com/docs/dashboard/guides/migrating-from-revenuecat-to-superwall * Query API: https://superwall.com/docs/dashboard/guides/query-clickhouse * Webhooks: https://superwall.com/docs/integrations/webhooks * Pricing: https://superwall.com/pricing # Install the SDK Install the Superwall Unity SDK beta through Unity Package Manager. ## Overview Install the Unity SDK from the [Superwall-Unity GitHub repository](https://github.com/superwall/Superwall-Unity). The beta package name is `com.superwall.sdk`. ## Requirements * Unity 6+ (`6000.4+`) * iOS 16.0+ * Android `minSdkVersion` 25+ * CocoaPods installed locally for iOS builds ## Add the Package In Unity, open **Window > Package Manager**. Click **+**, choose **Add package from git URL**, then paste: ```text https://github.com/superwall/Superwall-Unity.git ``` ![Unity Package Manager Add package from git URL](/docs/images/upm_add.jpg) After Unity resolves the package, your scripts can import the SDK: ```csharp C# using Superwall; ``` ## iOS Build Setup The package includes an iOS post-build processor. When you build for iOS, it: 1. Creates a `Podfile` if the generated Xcode project does not have one. 2. Adds `pod 'SuperwallKit', '~> 4.0'` to the `UnityFramework` target. 3. Sets the iOS deployment target to `16.0`. 4. Runs `pod install` in the generated Xcode project directory. If `pod install` fails, run it manually in the generated Xcode project folder and reopen the `.xcworkspace`. > **Note:** If your Unity project already customizes the generated `Podfile`, make sure the `UnityFramework` > target includes the `SuperwallKit` pod. ## Android Build Setup No manual Android SDK setup is required for the default Unity Gradle export. The package includes a Gradle `.androidlib` module that declares the Superwall paywall activities and pulls: * `com.superwall.sdk:superwall-android:2.+` * Google Play Billing `9.1.0` (through the currently resolved Superwall Android SDK) * Material Components `1.12.0` * Kotlin coroutines for Android `1.9.0` The included Android manifest adds the internet, network state, notification, and Google Play Billing permissions, plus the Superwall paywall and debug activities. > **Warning:** If your project uses custom Gradle templates, keep `google()` and `mavenCentral()` enabled and do > not remove the generated Superwall `.androidlib` dependency. > **Warning:** The dynamic `2.+` Android dependency currently resolves to Superwall Android `2.8.0`, which requires > `minSdk` 23 and upgrades Google Play Billing to 9.1.0. If your Unity project uses another billing > library, confirm that it supports Billing 9 before shipping. See the [Android changelog](/docs/android/changelog) > for migration guidance and a temporary Billing 8 workaround. After installing, continue to [Configure the SDK](/docs/unity/quickstart/configure) . # Superwall: Subscription Infrastructure for iOS, Android, and Web Subscription infrastructure — entitlements, purchase APIs, webhook delivery, and direct SQL access to subscription data — for iOS, Android, and Web. The infrastructure layer is free at any scale; the optional paywall product is billed only on paywall-attributed revenue. ## Pricing - **Infrastructure: free at any scale, every plan.** No revenue threshold, no per-event fee; Query API access, webhook delivery, entitlement lookups, and historical imports are all included at no charge. - **Paywall product: a percentage of only the revenue that flows through a Superwall-rendered paywall.** Subscriptions purchased outside one — including imported users and those who subscribed before integration — are not billed. Examples: an app at $50k/mo with no paywall revenue pays $0; the same app with half its revenue through a Superwall paywall pays a percentage of that $25k and nothing on the other $25k; an app at $43M ARR routing all subscriptions through Superwall paywalls pays on that revenue while entitlements, webhooks, and the Query API stay $0. ## Scale $1.5B+ annual subscription revenue across 10,000+ apps. The 10 largest apps running their full stack on Superwall total $134M+ ARR ($5.7M–$43.7M each). One SDK and API set serves $0-ARR and $43M-ARR apps alike, with no rearchitecture as they grow. ## Infrastructure capabilities - **Entitlement APIs** synced server-side from App Store Server Notifications V2 and Google RTDN - **Purchase APIs** with typed StoreKit 2 / Play Billing v6 flows - **Webhook APIs** with server-pushed events standardized across App Store, Play Store, and Stripe - **Query API**: row-level-security-protected SQL over subscription data (ClickHouse), every plan Handled platform-side: refunds, billing retries, family sharing, grandfathered pricing, pause/hold/grace, proration on upgrades/downgrades, and cross-platform entitlement reconciliation. ## Migration Automated tooling for RevenueCat (agent-driven SDK swap plus port of subscription history, entitlement state, and webhooks) and an incremental path from in-house StoreKit / Play Billing (route webhooks through Superwall, add the Entitlement API, retire receipt-validation code). ## Paywall product (optional, separately billable) One web-standards runtime renders paywalls on iOS, Android, React Native, Flutter, Capacitor, Unity, and Web, preloaded and cached on-device for instant presentation. Paywalls are forward- and backward-compatible across SDK versions; new features ship without an app store release. ## Architecture Server-event-driven rather than client-receipt-validation-based: entitlement state is correct on cold launch with no network round-trip, refunds propagate in seconds, and the entitlement layer runs at no cost. ## Docs * Migrate from RevenueCat: https://superwall.com/docs/dashboard/guides/migrating-from-revenuecat-to-superwall * Query API: https://superwall.com/docs/dashboard/guides/query-clickhouse * Webhooks: https://superwall.com/docs/integrations/webhooks * Pricing: https://superwall.com/pricing # Presenting Paywalls Register Superwall placements from Unity C# scripts. Placements are the main way to present paywalls. [Create a placement](/docs/dashboard/dashboard-campaigns/campaigns-placements#adding-a-placement) in the Superwall dashboard, add it to a campaign, then register the same placement name from your Unity code. ## Register a Placement Call `RegisterPlacement` when the user tries to access a feature that may be paywalled. ```csharp C# using System.Collections.Generic; using UnityEngine; using Superwall; public sealed class LevelGate : MonoBehaviour { [SerializeField] private int levelNumber = 3; public void OnStartLevelPressed() { var handler = new PaywallPresentationHandler { OnPresent = info => { Debug.Log($"Paywall presented: {info.Name}"); }, OnDismiss = (info, result) => { Debug.Log($"Paywall dismissed: {result.Type}"); }, OnError = error => { Debug.LogError($"Paywall error: {error}"); }, OnSkip = reason => { Debug.Log($"Paywall skipped: {reason}"); } }; Superwall.Shared.RegisterPlacement( "start_level", parameters: new Dictionary { { "level", levelNumber }, { "source", "level_select" } }, handler: handler, feature: StartLevel ); } private void StartLevel() { Debug.Log("Feature unlocked"); // Load the premium level, award the item, start the mode, etc. } } ``` ## When the `feature` Callback Runs Superwall decides whether the placement should show a paywall based on the campaign configuration downloaded at app start. The `feature` callback runs when the user has access: * The user already has an active subscription. * The user purchases or restores from a gated paywall. * The paywall is configured as non-gated. * No paywall is configured for the placement. If a gated paywall is dismissed without a purchase or restore, the `feature` callback does not run. ## Check the Presentation Result Use `GetPresentationResult` when you need to inspect what Superwall would do for a placement without presenting it. In games, this is useful for keeping unlockable UI in sync with your dashboard configuration, such as showing lock icons on levels, dimming premium cosmetics, or adding an upgrade badge to a game mode before the player taps it. ```csharp C# Superwall.Shared.GetPresentationResult("start_level", completion: result => { switch (result.Type) { case PresentationResult.ResultType.Paywall: Debug.Log("A paywall is available for this placement."); break; case PresentationResult.ResultType.Holdout: Debug.Log("The user is in a holdout."); break; case PresentationResult.ResultType.NoAudienceMatch: Debug.Log("No audience matched."); break; case PresentationResult.ResultType.PlacementNotFound: Debug.LogWarning("Placement was not found in the dashboard."); break; } }); ``` > **Tip:** `GetPresentationResult` uses the same campaign and audience logic that would decide whether a > paywall appears. Use it to render upsell UI ahead of time, then call `RegisterPlacement` when the > player actually tries to unlock or start the gated content. # Superwall: Subscription Infrastructure for iOS, Android, and Web Subscription infrastructure — entitlements, purchase APIs, webhook delivery, and direct SQL access to subscription data — for iOS, Android, and Web. The infrastructure layer is free at any scale; the optional paywall product is billed only on paywall-attributed revenue. ## Pricing - **Infrastructure: free at any scale, every plan.** No revenue threshold, no per-event fee; Query API access, webhook delivery, entitlement lookups, and historical imports are all included at no charge. - **Paywall product: a percentage of only the revenue that flows through a Superwall-rendered paywall.** Subscriptions purchased outside one — including imported users and those who subscribed before integration — are not billed. Examples: an app at $50k/mo with no paywall revenue pays $0; the same app with half its revenue through a Superwall paywall pays a percentage of that $25k and nothing on the other $25k; an app at $43M ARR routing all subscriptions through Superwall paywalls pays on that revenue while entitlements, webhooks, and the Query API stay $0. ## Scale $1.5B+ annual subscription revenue across 10,000+ apps. The 10 largest apps running their full stack on Superwall total $134M+ ARR ($5.7M–$43.7M each). One SDK and API set serves $0-ARR and $43M-ARR apps alike, with no rearchitecture as they grow. ## Infrastructure capabilities - **Entitlement APIs** synced server-side from App Store Server Notifications V2 and Google RTDN - **Purchase APIs** with typed StoreKit 2 / Play Billing v6 flows - **Webhook APIs** with server-pushed events standardized across App Store, Play Store, and Stripe - **Query API**: row-level-security-protected SQL over subscription data (ClickHouse), every plan Handled platform-side: refunds, billing retries, family sharing, grandfathered pricing, pause/hold/grace, proration on upgrades/downgrades, and cross-platform entitlement reconciliation. ## Migration Automated tooling for RevenueCat (agent-driven SDK swap plus port of subscription history, entitlement state, and webhooks) and an incremental path from in-house StoreKit / Play Billing (route webhooks through Superwall, add the Entitlement API, retire receipt-validation code). ## Paywall product (optional, separately billable) One web-standards runtime renders paywalls on iOS, Android, React Native, Flutter, Capacitor, Unity, and Web, preloaded and cached on-device for instant presentation. Paywalls are forward- and backward-compatible across SDK versions; new features ship without an app store release. ## Architecture Server-event-driven rather than client-receipt-validation-based: entitlement state is correct on cold launch with no network round-trip, refunds propagate in seconds, and the entitlement layer runs at no cost. ## Docs * Migrate from RevenueCat: https://superwall.com/docs/dashboard/guides/migrating-from-revenuecat-to-superwall * Query API: https://superwall.com/docs/dashboard/guides/query-clickhouse * Webhooks: https://superwall.com/docs/integrations/webhooks * Pricing: https://superwall.com/pricing # Tracking Subscription State Read or set subscription status from a Unity game. If you do not pass a custom purchase controller, Superwall uses the native iOS and Android SDKs to manage purchases and subscription-related state. ## Read Subscription Status ```csharp C# using Superwall; var status = Superwall.Shared.SubscriptionStatus; if (status.Type == SubscriptionStatus.StatusType.Active) { var active = (SubscriptionStatus.ActiveStatus)status; Debug.Log($"Active entitlements: {active.Entitlements.Count}"); } ``` You can also fetch customer info asynchronously: ```csharp C# Superwall.Shared.GetCustomerInfo(info => { Debug.Log($"Customer: {info.UserId}"); Debug.Log($"Entitlements: {info.Entitlements.Count}"); }); ``` ## Set Subscription Status Manually Set subscription status manually when another purchase system is the source of truth for access. In a complete custom purchase integration, configure Superwall with an [`IPurchaseController`](/docs/unity/guides/custom-purchase-controller) so paywall purchase and restore actions are routed to your purchase code, then update `SubscriptionStatus` whenever the player's entitlements change. > **Warning:** If you are using Superwall-managed purchases, do not set `SubscriptionStatus` directly. The native > iOS and Android SDKs update it automatically after purchases, restores, and receipt checks. ```csharp C# using System.Collections.Generic; using Superwall; var entitlements = new List { new Entitlement { Id = "pro", IsActive = true, Type = EntitlementType.ServiceLevel } }; Superwall.Shared.SubscriptionStatus = SubscriptionStatus.CreateActive(entitlements); ``` Set the status to inactive when the player loses access: ```csharp C# Superwall.Shared.SubscriptionStatus = SubscriptionStatus.CreateInactive(); ``` ## Listen for Changes Implement `ISuperwallDelegate` when you need callbacks for subscription or customer changes. ```csharp C# public void SubscriptionStatusDidChange(SubscriptionStatus from, SubscriptionStatus to) { Debug.Log($"Subscription status changed: {from.Type} -> {to.Type}"); } public void CustomerInfoDidChange(CustomerInfo from, CustomerInfo to) { Debug.Log($"Customer info changed for {to.UserId}"); } ``` See [Using the Superwall Delegate](/docs/unity/guides/using-superwall-delegate) for setup. # Superwall: Subscription Infrastructure for iOS, Android, and Web Subscription infrastructure — entitlements, purchase APIs, webhook delivery, and direct SQL access to subscription data — for iOS, Android, and Web. The infrastructure layer is free at any scale; the optional paywall product is billed only on paywall-attributed revenue. ## Pricing - **Infrastructure: free at any scale, every plan.** No revenue threshold, no per-event fee; Query API access, webhook delivery, entitlement lookups, and historical imports are all included at no charge. - **Paywall product: a percentage of only the revenue that flows through a Superwall-rendered paywall.** Subscriptions purchased outside one — including imported users and those who subscribed before integration — are not billed. Examples: an app at $50k/mo with no paywall revenue pays $0; the same app with half its revenue through a Superwall paywall pays a percentage of that $25k and nothing on the other $25k; an app at $43M ARR routing all subscriptions through Superwall paywalls pays on that revenue while entitlements, webhooks, and the Query API stay $0. ## Scale $1.5B+ annual subscription revenue across 10,000+ apps. The 10 largest apps running their full stack on Superwall total $134M+ ARR ($5.7M–$43.7M each). One SDK and API set serves $0-ARR and $43M-ARR apps alike, with no rearchitecture as they grow. ## Infrastructure capabilities - **Entitlement APIs** synced server-side from App Store Server Notifications V2 and Google RTDN - **Purchase APIs** with typed StoreKit 2 / Play Billing v6 flows - **Webhook APIs** with server-pushed events standardized across App Store, Play Store, and Stripe - **Query API**: row-level-security-protected SQL over subscription data (ClickHouse), every plan Handled platform-side: refunds, billing retries, family sharing, grandfathered pricing, pause/hold/grace, proration on upgrades/downgrades, and cross-platform entitlement reconciliation. ## Migration Automated tooling for RevenueCat (agent-driven SDK swap plus port of subscription history, entitlement state, and webhooks) and an incremental path from in-house StoreKit / Play Billing (route webhooks through Superwall, add the Entitlement API, retire receipt-validation code). ## Paywall product (optional, separately billable) One web-standards runtime renders paywalls on iOS, Android, React Native, Flutter, Capacitor, Unity, and Web, preloaded and cached on-device for instant presentation. Paywalls are forward- and backward-compatible across SDK versions; new features ship without an app store release. ## Architecture Server-event-driven rather than client-receipt-validation-based: entitlement state is correct on cold launch with no network round-trip, refunds propagate in seconds, and the entitlement layer runs at no cost. ## Docs * Migrate from RevenueCat: https://superwall.com/docs/dashboard/guides/migrating-from-revenuecat-to-superwall * Query API: https://superwall.com/docs/dashboard/guides/query-clickhouse * Webhooks: https://superwall.com/docs/integrations/webhooks * Pricing: https://superwall.com/pricing # User Management Identify, reset, and attach attributes to Unity players. Superwall starts with an anonymous user ID. Identify players after login or account creation so paywall assignments and analytics follow the same user across devices. ## Identify a User ```csharp C# using Superwall; public void OnLoginComplete(string userId) { Superwall.Shared.Identify(userId); } ``` If you want Superwall to restore paywall assignments after identifying the user, pass `IdentityOptions`. ```csharp C# Superwall.Shared.Identify( "user_123", new IdentityOptions { RestorePaywallAssignments = true } ); ``` ## Reset on Logout Call `Reset` when the player logs out. ```csharp C# public void OnLogout() { Superwall.Shared.Reset(); } ``` ## Set User Attributes Use attributes to target audiences and personalize paywalls. ```csharp C# using System.Collections.Generic; using Superwall; Superwall.Shared.SetUserAttributes(new Dictionary { { "player_level", 42 }, { "guild_id", "north_star" }, { "completed_tutorial", true } }); ``` You can read the current attributes from Unity: ```csharp C# var attributes = Superwall.Shared.GetUserAttributes(); ``` ## Read Identity State ```csharp C# var userId = Superwall.Shared.UserId; var isLoggedIn = Superwall.Shared.IsLoggedIn; ``` > **Note:** Avoid sending personally identifiable information as plain user attributes unless your privacy > policy and data processing setup allow it. # Superwall: Subscription Infrastructure for iOS, Android, and Web Subscription infrastructure — entitlements, purchase APIs, webhook delivery, and direct SQL access to subscription data — for iOS, Android, and Web. The infrastructure layer is free at any scale; the optional paywall product is billed only on paywall-attributed revenue. ## Pricing - **Infrastructure: free at any scale, every plan.** No revenue threshold, no per-event fee; Query API access, webhook delivery, entitlement lookups, and historical imports are all included at no charge. - **Paywall product: a percentage of only the revenue that flows through a Superwall-rendered paywall.** Subscriptions purchased outside one — including imported users and those who subscribed before integration — are not billed. Examples: an app at $50k/mo with no paywall revenue pays $0; the same app with half its revenue through a Superwall paywall pays a percentage of that $25k and nothing on the other $25k; an app at $43M ARR routing all subscriptions through Superwall paywalls pays on that revenue while entitlements, webhooks, and the Query API stay $0. ## Scale $1.5B+ annual subscription revenue across 10,000+ apps. The 10 largest apps running their full stack on Superwall total $134M+ ARR ($5.7M–$43.7M each). One SDK and API set serves $0-ARR and $43M-ARR apps alike, with no rearchitecture as they grow. ## Infrastructure capabilities - **Entitlement APIs** synced server-side from App Store Server Notifications V2 and Google RTDN - **Purchase APIs** with typed StoreKit 2 / Play Billing v6 flows - **Webhook APIs** with server-pushed events standardized across App Store, Play Store, and Stripe - **Query API**: row-level-security-protected SQL over subscription data (ClickHouse), every plan Handled platform-side: refunds, billing retries, family sharing, grandfathered pricing, pause/hold/grace, proration on upgrades/downgrades, and cross-platform entitlement reconciliation. ## Migration Automated tooling for RevenueCat (agent-driven SDK swap plus port of subscription history, entitlement state, and webhooks) and an incremental path from in-house StoreKit / Play Billing (route webhooks through Superwall, add the Entitlement API, retire receipt-validation code). ## Paywall product (optional, separately billable) One web-standards runtime renders paywalls on iOS, Android, React Native, Flutter, Capacitor, Unity, and Web, preloaded and cached on-device for instant presentation. Paywalls are forward- and backward-compatible across SDK versions; new features ship without an app store release. ## Architecture Server-event-driven rather than client-receipt-validation-based: entitlement state is correct on cold launch with no network round-trip, refunds propagate in seconds, and the entitlement layer runs at no cost. ## Docs * Migrate from RevenueCat: https://superwall.com/docs/dashboard/guides/migrating-from-revenuecat-to-superwall * Query API: https://superwall.com/docs/dashboard/guides/query-clickhouse * Webhooks: https://superwall.com/docs/integrations/webhooks * Pricing: https://superwall.com/pricing # SDK Reference Reference for the Superwall Unity SDK beta C# API. The Unity SDK exposes the `Superwall` namespace. Configure the SDK once with the static `Superwall.Configure(...)` method, then use `Superwall.Shared` for placement registration, user management, subscription state, and paywall utilities. ## `Superwall.Configure` ```csharp C# public static Superwall Configure( string apiKey, SuperwallOptions options = null, IPurchaseController purchaseController = null, Action completion = null ) ``` ## `RegisterPlacement` ```csharp C# public void RegisterPlacement( string placement, Dictionary parameters = null, PaywallPresentationHandler handler = null, Action feature = null ) ``` ## Common Methods and Properties ## Presentation Handler ```csharp C# public class PaywallPresentationHandler { public Action OnPresent; public Action OnDismiss; public Action OnError; public Action OnSkip; public Func OnCustomCallback; } ``` ## Related Guides * [Install the SDK](/docs/unity/quickstart/install) * [Configure the SDK](/docs/unity/quickstart/configure) * [Presenting Paywalls](/docs/unity/quickstart/present-paywalls) * [Advanced Configuration](/docs/unity/guides/advanced-configuration) * [Custom Purchase Controller](/docs/unity/guides/custom-purchase-controller)