# 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

# SuperwallOptions

A configuration class for customizing paywall appearance and behavior.

> **Warning:** Only modify `networkEnvironment` if explicitly instructed by the Superwall team. Use `.RELEASE` (default) for production apps.

> **Tip:** Use different `SuperwallOptions` configurations for debug and release builds to optimize logging, purchasing behavior, and Google Play settings for each environment.

## Purpose

Configures paywall presentation, logging, Google Play purchase behavior, and other global SDK settings. Pass an instance in to [`Superwall.configure`](/docs/android/sdk-reference/configure).

## Signature

```kotlin
class SuperwallOptions {
    var paywalls: PaywallOptions = PaywallOptions()
    var shouldObservePurchases: Boolean = false
    var networkEnvironment: NetworkEnvironment = NetworkEnvironment.Release()
    var eventTrackingBehavior: EventTrackingBehavior = EventTrackingBehavior.ALL
    @Deprecated("Use eventTrackingBehavior instead.")
    var isExternalDataCollectionEnabled: Boolean = true
    var localeIdentifier: String? = null
    var isGameControllerEnabled: Boolean = false
    var passIdentifiersToPlayStore: Boolean = false
    var enableExperimentalDeviceVariables: Boolean = false
    var logging: Logging = Logging()
    var useMockReviews: Boolean = false
    var testModeBehavior: TestModeBehavior = TestModeBehavior.AUTOMATIC
}
```

```java
// Java
public class SuperwallOptions {
    public PaywallOptions paywalls = new PaywallOptions();
    public boolean shouldObservePurchases = false;
    public NetworkEnvironment networkEnvironment = new NetworkEnvironment.Release();
    public EventTrackingBehavior eventTrackingBehavior = EventTrackingBehavior.ALL;
    @Deprecated
    public boolean isExternalDataCollectionEnabled = true;
    public @Nullable String localeIdentifier = null;
    public boolean isGameControllerEnabled = false;
    public boolean passIdentifiersToPlayStore = false;
    public boolean enableExperimentalDeviceVariables = false;
    public Logging logging = new Logging();
    public boolean useMockReviews = false;
    public TestModeBehavior testModeBehavior = TestModeBehavior.AUTOMATIC;
}
```

## Parameters

<TypeTable
  type="{
  paywalls: {
    type: &#x22;PaywallOptions&#x22;,
    typeDescriptionLink: &#x22;/android/sdk-reference/PaywallOptions&#x22;,
    description: &#x22;Controls paywall presentation, preload, and alert behavior.&#x22;,
    required: true,
  },
  shouldObservePurchases: {
    type: &#x22;Boolean&#x22;,
    description: &#x22;Set to `true` to have Superwall observe Google Play purchases you make outside the SDK.&#x22;,
    required: true,
  },
  networkEnvironment: {
    type: &#x22;NetworkEnvironment&#x22;,
    description: &#x22;Overrides the API environment. **Only change if instructed by Superwall.**&#x22;,
    required: true,
  },
  eventTrackingBehavior: {
    type: &#x22;EventTrackingBehavior&#x22;,
    description: &#x22;Controls which SDK events are sent to Superwall. `ALL` tracks everything, `SUPERWALL_ONLY` suppresses user-initiated tracking, trigger fires, and user-attribute updates, and `NONE` stops all event collection. Can also be changed at runtime via `Superwall.instance.eventTrackingBehavior`.&#x22;,
    default: &#x22;ALL&#x22;,
  },
  isExternalDataCollectionEnabled: {
    type: &#x22;Boolean&#x22;,
    description: &#x22;Deprecated. Use `eventTrackingBehavior` instead. Setting this to `false` maps to `SUPERWALL_ONLY`; setting it back to `true` maps to `ALL`.&#x22;,
    default: &#x22;true&#x22;,
  },
  localeIdentifier: {
    type: &#x22;String?&#x22;,
    description: &#x22;Overrides the locale used for rule evaluation (e.g., `\&#x22;en_GB\&#x22;`).&#x22;,
  },
  isGameControllerEnabled: {
    type: &#x22;Boolean&#x22;,
    description: &#x22;Forwards game controller events to paywalls.&#x22;,
    required: true,
  },
  passIdentifiersToPlayStore: {
    type: &#x22;Boolean&#x22;,
    description: &#x22;When `true`, Google Play receives the raw `userId` as `obfuscatedExternalAccountId`; otherwise Superwall sends a SHA-256 hash.&#x22;,
    required: true,
  },
  enableExperimentalDeviceVariables: {
    type: &#x22;Boolean&#x22;,
    description: &#x22;Enables experimental device variables (subject to change).&#x22;,
    required: true,
  },
  logging: {
    type: &#x22;Logging&#x22;,
    description: &#x22;Sets log level and scopes printed to Logcat.&#x22;,
    required: true,
  },
  useMockReviews: {
    type: &#x22;Boolean&#x22;,
    description: &#x22;Shows mock Google Play review dialogs for testing.&#x22;,
    required: true,
  },
  testModeBehavior: {
    type: &#x22;TestModeBehavior&#x22;,
    description: &#x22;Controls when test mode activates. `AUTOMATIC` enables test mode when an application ID mismatch is detected. `WHEN_ENABLED_FOR_USER` only activates when the user is marked as a test store user in the dashboard. `ALWAYS` forces test mode on. `NEVER` disables it entirely.&#x22;,
    default: &#x22;AUTOMATIC&#x22;,
  },
}"
/>

## How `passIdentifiersToPlayStore` affects Google Play

Superwall always calls `BillingFlowParams.Builder.setObfuscatedAccountId(Superwall.instance.externalAccountId)` when launching a billing flow.

* **Default (`false`)** – `externalAccountId` is a SHA-256 hash of the `userId`. Google Play displays the hashed value as `obfuscatedExternalAccountId`, and the same hash is sent back to your servers.
* **Enabled (`true`)** – Superwall forwards the exact `appUserId` you passed to [`identify()`](/docs/android/sdk-reference/identify). This makes it easier to correlate Google Play purchases with your users, but the value must comply with [Google's policy](https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setObfuscatedAccountId) and must not contain PII.

Configure it as part of your application startup:

```kotlin
val options = SuperwallOptions().apply {
    passIdentifiersToPlayStore = true
    logging.level = LogLevel.info
}

Superwall.configure(
    application = this,
    apiKey = "pk_your_api_key",
    options = options
)
```

## Related

* [`PaywallOptions`](/docs/android/sdk-reference/PaywallOptions)