Superwall

SuperwallOptions

Configuration options for customizing Superwall SDK behavior.

Purpose

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

Signature

class SuperwallOptions {
  PaywallOptions paywalls = PaywallOptions();
  NetworkEnvironment networkEnvironment = NetworkEnvironment.release;
  bool isExternalDataCollectionEnabled = true;
  String? localeIdentifier;
  bool isGameControllerEnabled = false;
  Logging logging = Logging();
  bool passIdentifiersToPlayStore = false;
}

Parameters

PropertyTypeDescription
paywallsPaywallOptionsConfiguration for paywall presentation behavior.
networkEnvironmentNetworkEnvironmentNetwork environment for API calls (release/releaseCandidate/developer). Only change when instructed by Superwall.
isExternalDataCollectionEnabledboolEnables external analytics collection. Defaults to true.
localeIdentifierString?Override locale for paywall localization. Defaults to device locale.
isGameControllerEnabledboolEnables game controller support. Defaults to false.
loggingLoggingConfiguration for SDK logging levels and behavior.
passIdentifiersToPlayStoreboolWhen true, Android builds send the plain appUserId to Google Play as obfuscatedExternalAccountId. Defaults to false.

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 is 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 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:

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

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

Make sure the identifier complies with Google's policy and never contains personally identifiable information.

Usage

Basic options:

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

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

Production configuration:

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):

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:

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

How is this guide?

Edit on GitHub