# 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

Configuration options for customizing Superwall SDK behavior.

## Purpose

Configures various aspects of the Superwall SDK including paywall behavior, logging, and network settings.

## Signature

```dart
class SuperwallOptions {
  PaywallOptions paywalls = PaywallOptions();
  NetworkEnvironment networkEnvironment = NetworkEnvironment.release;
  bool isExternalDataCollectionEnabled = true;
  String? localeIdentifier;
  bool isGameControllerEnabled = false;
  Logging logging = Logging();
  bool passIdentifiersToPlayStore = false;
  TestModeBehavior testModeBehavior = TestModeBehavior.automatic;
  bool shouldObservePurchases = false;
  bool shouldBypassAppTransactionCheck = false; // iOS only
  int maxConfigRetryCount = 6; // iOS only
  bool useMockReviews = false; // Android only
}
```

## Parameters

<TypeTable
  type="{
  paywalls: {
    type: &#x22;PaywallOptions&#x22;,
    typeDescriptionLink: &#x22;/flutter/sdk-reference/PaywallOptions&#x22;,
    description: &#x22;Configuration for paywall presentation behavior.&#x22;,
    required: true,
  },
  networkEnvironment: {
    type: &#x22;NetworkEnvironment&#x22;,
    description: &#x22;Network environment for API calls (release/releaseCandidate/developer). Only change when instructed by Superwall.&#x22;,
    required: true,
  },
  isExternalDataCollectionEnabled: {
    type: &#x22;bool&#x22;,
    description: &#x22;Enables external analytics collection.&#x22;,
    default: &#x22;true&#x22;,
  },
  localeIdentifier: {
    type: &#x22;String?&#x22;,
    description: &#x22;Override locale for paywall localization.&#x22;,
    default: &#x22;device locale&#x22;,
  },
  isGameControllerEnabled: {
    type: &#x22;bool&#x22;,
    description: &#x22;Enables game controller support.&#x22;,
    default: &#x22;false&#x22;,
  },
  logging: {
    type: &#x22;Logging&#x22;,
    description: &#x22;Configuration for SDK logging levels and behavior.&#x22;,
    required: true,
  },
  passIdentifiersToPlayStore: {
    type: &#x22;bool&#x22;,
    description: &#x22;When `true`, Android builds send the plain `appUserId` to Google Play as `obfuscatedExternalAccountId`.&#x22;,
    default: &#x22;false&#x22;,
  },
  testModeBehavior: {
    type: &#x22;TestModeBehavior&#x22;,
    description: &#x22;Controls when the SDK enters test mode. Options: `automatic`, `whenEnabledForUser`, `never`, `always`.&#x22;,
    default: &#x22;TestModeBehavior.automatic&#x22;,
  },
  shouldObservePurchases: {
    type: &#x22;bool&#x22;,
    description: &#x22;When `true`, Superwall observes StoreKit/Play Store transactions made outside of Superwall and reports them.&#x22;,
    default: &#x22;false&#x22;,
  },
  shouldBypassAppTransactionCheck: {
    type: &#x22;bool&#x22;,
    description: &#x22;Disables the app transaction check on SDK launch. iOS only.&#x22;,
    default: &#x22;false&#x22;,
  },
  maxConfigRetryCount: {
    type: &#x22;int&#x22;,
    description: &#x22;Number of times the SDK will attempt to get the Superwall configuration after a network failure before it times out. iOS only.&#x22;,
    default: &#x22;6&#x22;,
  },
  useMockReviews: {
    type: &#x22;bool&#x22;,
    description: &#x22;Enables mock review functionality. Android only.&#x22;,
    default: &#x22;false&#x22;,
  },
}"
/>

## Android-only: `passIdentifiersToPlayStore`

Flutter apps can target both iOS and Android. Google Play always consumes the identifier you send through `BillingFlowParams.Builder.setObfuscatedAccountId`, which the SDK sources from `Superwall.instance.externalAccountId`.

* When `passIdentifiersToPlayStore&#x60; is &#x2A;*`false`** (default) we SHA-256 hash your `userId` before sending it. Play Console and the Superwall backend will show the hashed value.
* When it is &#x2A;*`true`**, we pass the exact `appUserId` you supplied to `Superwall.shared.identify`. This only changes behavior on Android—the flag is ignored on iOS builds.

Set the option at configuration time when you specifically need the un-hashed identifier:

```dart
final options = SuperwallOptions()
  ..passIdentifiersToPlayStore = true;

await Superwall.configure(
  apiKey,
  options: options,
);
```

Make sure the identifier complies with [Google's policy](https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setObfuscatedAccountId) and never contains personally identifiable information.

## Usage

Basic options:

```dart
final options = SuperwallOptions()
  ..paywalls = PaywallOptions()
  ..logging = (Logging()..level = LogLevel.debug);

await Superwall.configure(
  'pk_your_api_key',
  options: options,
);
```

Production configuration:

```dart
final productionOptions = SuperwallOptions()
  ..paywalls = (PaywallOptions()
    ..shouldPreload = true
    ..automaticallyDismiss = true)
  ..networkEnvironment = NetworkEnvironment.release
  ..isExternalDataCollectionEnabled = true
  ..logging = (Logging()..level = LogLevel.warn);
```

Development configuration (with Play Store IDs on Android):

```dart
final developmentOptions = SuperwallOptions()
  ..paywalls = (PaywallOptions()
    ..shouldPreload = false
    ..automaticallyDismiss = false)
  ..networkEnvironment = NetworkEnvironment.developer
  ..logging = (Logging()
    ..level = LogLevel.debug
    ..scopes = {LogScope.all})
  ..passIdentifiersToPlayStore = true; // Android only
```

Custom locale:

```dart
final localizedOptions = SuperwallOptions()
  ..localeIdentifier = 'es_ES' // Spanish (Spain)
  ..paywalls = (PaywallOptions()..shouldPreload = true);
```

## Related

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