Skip to main content

Overview

As soon as your app launches, you need to configure the SDK with your API Key. You’ll receive your public API key from the Encore Dashboard to configure and identify your app.

Initialize Encore in Your App

Call configure() in your Application.onCreate() so the SDK is ready before any Activity starts.
// YourApplication.kt

import android.app.Application
import com.encorekit.encore.Encore

class YourApplication : Application() {
    override fun onCreate() {
        super.onCreate()

        // Configure Encore with your API key
        Encore.shared.configure(this, apiKey = "pk_your_api_key_here")
    }
}
Make sure your custom Application class is registered in AndroidManifest.xml:
<application
    android:name=".YourApplication"
    ... >
This configures a shared instance of Encore, the primary class for interacting with the SDK’s API. Make sure to replace pk_your_api_key_here with your public API key.
If you don’t have access to your API key, please contact your Encore representative.

Next Steps

Now that Encore is configured, you’re ready to: