# configure()

A static function that configures a shared instance of Superwall for use throughout your app.

> **Note**

This is a static method called on the `Superwall` class itself, not on the shared instance. The Android SDK requires an Application context for initialization.



Purpose [#purpose]

Configures the shared instance of Superwall with your API key and optional configurations, making it ready for use throughout your Android app.

```kotlin Android
public fun configure(
    applicationContext: Application,
    apiKey: String,
    purchaseController: PurchaseController? = null,
    options: SuperwallOptions? = null,
    activityProvider: ActivityProvider? = null,
    completion: ((Result<Unit>) -> Unit)? = null
)
```

Parameters [#parameters]

<TypeTable
  type="{
  applicationContext: {
    type: &#x22;Application&#x22;,
    description: &#x22;Your Android Application instance, required for SDK initialization and lifecycle management.&#x22;,
    required: true,
  },
  apiKey: {
    type: &#x22;String&#x22;,
    description: &#x22;Your Public API Key from the Superwall dashboard settings.&#x22;,
    required: true,
  },
  purchaseController: {
    type: &#x22;PurchaseController?&#x22;,
    description: &#x22;Optional object for handling all subscription-related logic yourself. If `null`, Superwall handles subscription logic.&#x22;,
    default: &#x22;null&#x22;,
  },
  options: {
    type: &#x22;SuperwallOptions?&#x22;,
    typeDescriptionLink: &#x22;/android/sdk-reference/SuperwallOptions&#x22;,
    description: &#x22;Optional configuration object for customizing paywall appearance and behavior.&#x22;,
    default: &#x22;null&#x22;,
  },
  activityProvider: {
    type: &#x22;ActivityProvider?&#x22;,
    description: &#x22;Optional provider that supplies the current Activity when needed by the SDK.&#x22;,
    default: &#x22;null&#x22;,
  },
  completion: {
    type: &#x22;((Result<Unit>) -> Unit)?&#x22;,
    description: &#x22;Optional completion handler called when Superwall finishes configuring. Result contains success or failure.&#x22;,
    default: &#x22;null&#x22;,
  },
}"
/>

Returns / State [#returns--state]

Configures the Superwall instance which is accessible via [`Superwall.instance`](/docs/android/sdk-reference/Superwall).

```kotlin Android
class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        Superwall.configure(
            applicationContext = this,
            apiKey = "pk_your_api_key"
        )
    }
}
```

With custom options:

```kotlin
class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        
        val options = SuperwallOptions().apply {
            paywalls.shouldShowPurchaseFailureAlert = false
        }
        
        Superwall.configure(
            applicationContext = this,
            apiKey = "pk_your_api_key",
            options = options
        ) {
            println("Superwall configured successfully")
        }
    }
}
```