initialize

fun initialize(context: Context, publishableKey: String)

Initializes the Clerk SDK with the provided configuration.

This method must be called before using any other Clerk functionality. It configures the API client, initializes local storage, and begins the authentication state setup. Observe isInitialized to know when the SDK is ready.

Parameters

context

The application context used for initialization and storage setup.

publishableKey

The publishable key from your Clerk Dashboard that connects your app to Clerk.

Throws

if the publishable key format is invalid.


fun initialize(context: Context, publishableKey: String, options: ClerkConfigurationOptions? = null, theme: ClerkTheme? = null)

Initializes the Clerk SDK with the provided configuration.

This method must be called before using any other Clerk functionality. It configures the API client, initializes local storage, and begins the authentication state setup.

Parameters

context

The application context used for initialization and storage setup.

publishableKey

The publishable key from your Clerk Dashboard that connects your app to Clerk.

options

Optional configuration for enabling extra functionality. See ClerkConfigurationOptions for details.

theme

Optional theme to customize the appearance of Clerk UI components. See ClerkTheme for details.

Throws

if the publishable key format is invalid.