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 {
  final PaywallOptions paywalls;
  final NetworkEnvironment networkEnvironment;
  final bool isExternalDataCollectionEnabled;
  final String? localeIdentifier;
  final bool isGameControllerEnabled;
  final Logging logging;
}

Parameters

PropertyTypeDescription
paywallsPaywallOptionsConfiguration for paywall presentation behavior.
networkEnvironmentNetworkEnvironmentNetwork environment for API calls (release/staging).
isExternalDataCollectionEnabledboolEnables external data collection for analytics. 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.

Usage

Basic options:

final options = SuperwallOptions(
  paywalls: PaywallOptions(
    shouldPreload: true,
    automaticallyDismiss: false,
  ),
  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:

final developmentOptions = SuperwallOptions(
  paywalls: PaywallOptions(
    shouldPreload: false, // Faster builds
    automaticallyDismiss: false, // Manual testing
  ),
  networkEnvironment: NetworkEnvironment.staging,
  logging: Logging(
    level: LogLevel.debug,
    scopes: [LogScope.all],
  ),
);

Custom locale:

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

How is this guide?

On this page