SuperwallOptions
Options for configuring the Superwall SDK.
Deprecated SDK
We strongly recommend migrating to the new Superwall Expo SDK, see our migration guide for details.
Purpose
Options for configuring the Superwall SDK. Use this to customize the appearance and behavior of paywalls, logging, and other SDK features.
Signature
export class SuperwallOptions {
paywalls: PaywallOptions = new PaywallOptions()
networkEnvironment: NetworkEnvironment = NetworkEnvironment.Release
isExternalDataCollectionEnabled = true
localeIdentifier?: string
isGameControllerEnabled = false
logging: LoggingOptions = new LoggingOptions()
collectAdServicesAttribution = false
passIdentifiersToPlayStore = false
storeKitVersion?: "STOREKIT1" | "STOREKIT2"
enableExperimentalDeviceVariables = false
}Properties
Prop
Type
Usage
Create options when configuring the SDK:
import { SuperwallOptions, PaywallOptions, LoggingOptions, NetworkEnvironment, LogLevel, LogScope } from "@superwall/react-native-superwall"
// Build logging options (must be an instance so toJson exists)
const logging = new LoggingOptions()
logging.level = LogLevel.Debug
logging.scopes = [LogScope.All]
// Build paywall options (set properties after construction)
const paywalls = new PaywallOptions()
paywalls.shouldShowPurchaseFailureAlert = false
paywalls.isHapticFeedbackEnabled = true
const options = new SuperwallOptions({
networkEnvironment: NetworkEnvironment.Developer,
isExternalDataCollectionEnabled: true,
localeIdentifier: "en_US",
logging,
paywalls
})
await Superwall.configure({
apiKey: "pk_your_api_key",
options: options
})Network Environment
Use different network environments for different build configurations:
// Development builds
const devOptions = new SuperwallOptions({
networkEnvironment: NetworkEnvironment.Developer
})
// Release candidate builds
const rcOptions = new SuperwallOptions({
networkEnvironment: NetworkEnvironment.ReleaseCandidate
})
// Production builds
const prodOptions = new SuperwallOptions({
networkEnvironment: NetworkEnvironment.Release
})Related
PaywallOptions- Paywall-specific optionsconfigure()- Configure the SDK with options
How is this guide?
Edit on GitHub