initialize

fun initialize(apiKey: String, userInput: StorytellerUserInput? = null, eventTrackingOptions: Storyteller.StorytellerEventTrackingOptions = StorytellerEventTrackingOptions(), onSuccess: () -> Unit = {}, onFailure: (StorytellerError) -> Unit = {})

Initializes the Storyteller SDK with the provided API key and optional user input. This method should be called once, typically in your Application's onCreate method. Initialization is asynchronous. The onSuccess callback is invoked upon successful initialization, and onFailure is invoked if an error occurs. For details on providing user information, see the Storyteller User Management Documentation. For a general guide on SDK setup, refer to the Getting Started Guide.

Parameters

apiKey

Your Storyteller API key.

userInput

Optional StorytellerUserInput containing details about the current user, if set to null SDK will handle this internally.

eventTrackingOptions

StorytellerEventTrackingOptions for configuring privacy and tracking settings. Defaults to all tracking enabled.

onSuccess

Callback invoked when initialization is successful.

onFailure

Callback invoked if an error occurs during initialization, the StorytellerError object provides details about the failure.