# 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

# Configuring

## Expo-specific options

Expo apps inherit the native Superwall option surface. The following fields were added in release 1.0.0 and later and live directly on the `options` object that you pass to `<SuperwallProvider />`.

<TypeTable
  type="{
  shouldObservePurchases: {
    type: &#x22;boolean&#x22;,
    description: &#x22;Reports StoreKit and Play Store transactions that happen outside of Superwall so you can use observer mode (iOS and Android).&#x22;,
    default: &#x22;false&#x22;,
  },
  shouldBypassAppTransactionCheck: {
    type: &#x22;boolean (iOS only)&#x22;,
    description: &#x22;Skips the AppTransaction lookup that can trigger an Apple ID prompt during configuration. Helpful for CI or kiosk/testing environments.&#x22;,
    default: &#x22;false&#x22;,
  },
  maxConfigRetryCount: {
    type: &#x22;number (iOS only)&#x22;,
    description: &#x22;How many times the SDK retries downloading the remote configuration before surfacing an error.&#x22;,
    default: &#x22;6&#x22;,
  },
  useMockReviews: {
    type: &#x22;boolean (Android only)&#x22;,
    description: &#x22;Enables mock Play Store review flows so you can test in development without Play Store services.&#x22;,
    default: &#x22;false&#x22;,
  },
  testModeBehavior: {
    type: '&#x22;automatic&#x22; | &#x22;whenEnabledForUser&#x22; | &#x22;never&#x22; | &#x22;always&#x22;',
    description: &#x22;Controls when the SDK enters test mode. When active, purchases are simulated and product data is retrieved from the Superwall dashboard. Set to \&#x22;always\&#x22; during development to test your entire paywall flow without StoreKit or Play Store.&#x22;,
    default: '&#x22;automatic&#x22;',
  },
  localResources: {
    type: &#x22;Record<string, LocalResource>&#x22;,
    description: &#x22;A mapping of local resource IDs to local assets. The paywall webview can reference these via the `swlocal://<id>` URL scheme. Accepts a Metro `require()` result, a file URI string, or a `{ uri: string }` object. Resolved at configure time.&#x22;,
  },
}"
/>

```tsx
import { SuperwallProvider } from "expo-superwall";

export function App() {
  return (
    <SuperwallProvider
      apiKeys={{ ios: "ios_key", android: "android_key" }}
      options={{
        shouldObservePurchases: true,
        maxConfigRetryCount: 4,
        useMockReviews: __DEV__,
        testModeBehavior: "automatic",
      }}
    >
      {/* your app */}
    </SuperwallProvider>
  );
}
```

### Logging

Logging is enabled by default in the SDK and is controlled by two properties: `level` and `scopes`.

`level` determines the minimum log level to print to the console. There are five types of log level:

1. **debug**: Prints all logs from the SDK to the console. Useful for debugging your app if something isn't working as expected.
2. **info**: Prints errors, warnings, and useful information from the SDK to the console.
3. **warn**: Prints errors and warnings from the SDK to the console.
4. **error**: Only prints errors from the SDK to the console.
5. **none**: Turns off all logs.

The SDK defaults to `info`.

`scopes` defines the scope of logs to print to the console. For example, you might only care about logs relating to `paywallPresentation` and `paywallTransactions`. This defaults to `.all`. Check out [LogScope](https://sdk.superwall.me/documentation/superwallkit/logscope) for all possible cases.

You set these properties like this:

:::expo
```typescript
const options = new SuperwallOptions()
options.logging.level = LogLevel.Warn
options.logging.scopes = [LogScope.PaywallPresentation, LogScope.PaywallTransactions]

Superwall.configure(
  "MY_API_KEY",
  null,
  options: options
);

// Or you can set:
await Superwall.shared.setLogLevel(LogLevel.Warn)
```
:::

### Preloading Paywalls

Paywalls are preloaded by default when the app is launched from a cold start. The paywalls that are preloaded are determined by the list of placements that result in a paywall for the user when [registered](/docs/sdk/quickstart/feature-gating). Preloading is smart, only preloading paywalls that belong to audiences that could be matched.

Paywalls are cached by default, which means after they load once, they don't need to be reloaded from the network unless you make a change to them on the dashboard. However, if you have a lot of paywalls, preloading may increase network usage of your app on first load of the paywalls and result in slower loading times overall.

> **Tip:** To make an onboarding or first-launch paywall load before the rest of your campaigns, prioritize the campaign from the dashboard with [Priority Placements](/docs/dashboard/dashboard-campaigns/campaigns-placements-prioritized). Use the SDK methods below when you need to disable automatic preloading or manually preload specific placements.

You can turn off preloading by setting `shouldPreload` to `false`:

:::expo
```typescript
const options = new SuperwallOptions()
options.paywalls.shouldPreload = false

Superwall.configure(
  "MY_API_KEY",
  null,
  options: options
);

// Or you can set:
Superwall.instance.logLevel = LogLevel.Warn
```
:::

Then, if you'd like to preload paywalls for specific placements you can use `preloadPaywalls(forPlacements:)`:

:::expo
```typescript
var placements = {"campaign_trigger"};
Superwall.shared.preloadPaywalls(placements);
```
:::

If you'd like to preload all paywalls you can use `preloadAllPaywalls()`:

:::expo
```typescript
// Coming soon
```
:::

Note: These methods will not reload any paywalls that have already been preloaded.

### Event Tracking Behavior

By default, Superwall allows the SDK to send event collection that supports paywall analytics, reporting, and targeting. Use the platform-specific options below when your app needs to control which SDK events are sent to Superwall.

:::expo
Expo currently uses `isExternalDataCollectionEnabled`. Setting it to `false` suppresses user-initiated tracking, trigger-fire events, and user-attribute updates while keeping internal Superwall event collection enabled.

```typescript
const options = SuperwallOptions()
options.isExternalDataCollectionEnabled = false

Superwall.configure(
  "MY_API_KEY",
  options: options
);
```
:::

### Automatically Dismissing the Paywall

By default, Superwall automatically dismisses the paywall when a product is purchased or restored. You can disable this by setting `automaticallyDismiss` to `false`:

:::expo
```typescript
const options = SuperwallOptions()
options.paywalls.automaticallyDismiss = false

Superwall.configure(
  "MY_API_KEY",
  null,
  options: options
);
```
:::

To manually dismiss the paywall , call `Superwall.shared.dismiss()`.

### Custom Restore Failure Message

You can set the title, message and close button title for the alert that appears after a restoration failure:

:::expo
```typescript
const options = SuperwallOptions()
options.paywalls.restoreFailed.title = "My Title"
options.paywalls.restoreFailed.message = "My message";
options.paywalls.restoreFailed.closeButtonTitle = "Close";

Superwall.configure(
  "MY_API_KEY",
  null,
  options: options
);
```
:::

### Haptic Feedback

On iOS, the paywall uses haptic feedback by default after a user purchases or restores a product, opens a URL from the paywall, or closes the paywall. To disable this, set the `isHapticFeedbackEnabled` `PaywallOption` to false:

:::expo
```typescript
const options = SuperwallOptions()
options.paywalls.isHapticFeedbackEnabled = false;

Superwall.configure(
  "MY_API_KEY",
  null,
  options: options
);
```
:::

Note: Android does not use haptic feedback.

### Transaction Background View

During a transaction, we add a `UIActivityIndicator` behind the view to indicate a loading status. However, you can remove this by setting the `transactionBackgroundView` to `nil`:

:::expo
```typescript
const options = SuperwallOptions()
options.paywalls.transactionBackgroundView = TransactionBackgroundView.none

Superwall.configure(
  "MY_API_KEY",
  null,
  options: options
);
```
:::

### Purchase Failure Alert

When a purchase fails, we automatically present an alert with the error message. If you'd like to show your own alert after failure, set the `shouldShowPurchaseFailureAlert` `PaywallOption` to `false`:

:::expo
```typescript
const options = SuperwallOptions()
options.paywalls.shouldShowPurchaseFailureAlert = false;

Superwall.configure(
  "MY_API_KEY",
  null,
  options: options
);
```
:::

### Web Purchase Confirmation Alert

When a user completes a purchase via web checkout (app2web flow), you can control whether to show a confirmation alert. By default, this is set to `false` to prevent duplicate alerts. Set `shouldShowWebPurchaseConfirmationAlert` to `true` if you want to show the native confirmation alert:

:::expo
```typescript
const options = new SuperwallOptions()
options.paywalls.shouldShowWebPurchaseConfirmationAlert = true

Superwall.configure(
  "MY_API_KEY",
  null,
  options: options
);
```
:::

### Locale Identifier

When evaluating rules, the device locale identifier is set to `autoupdatingCurrent`. However, you can override this if you want to test a specific locale:

:::expo
```typescript
const options = SuperwallOptions()
options.localeIdentifier = "en_GB";

Superwall.configure(
  "MY_API_KEY",
  null,
  options: options
);
```
:::

For a list of locales that are available on iOS, take a look at [this list](https://gist.github.com/jacobbubu/1836273). You can also preview your paywall in different locales using [In-App Previews](/docs/sdk/quickstart/in-app-paywall-previews).

### Game Controller

If you're using a game controller, you can enable this in `SuperwallOptions` too. Check out our [Game Controller Support](/docs/sdk/guides/advanced/game-controller-support) article.

Take a look at [SuperwallOptions](https://sdk.superwall.me/documentation/superwallkit/superwalloptions) in our SDK reference for more info.