Skip to main content

configure

Initializes a new Maestro SDK instance.

Overview

The configure() method is the first method you should call when integrating the SDK. It sets up the SDK with your site ID, delegate, and parameters. Only one instance can be configured at a time; any previously initialized instances will be detached and should not be used anymore.

Syntax

fun configure(
context: Context,
maestroEventDelegate: MaestroEventDelegate,
params: MaestroSDKParameters
): MaestroSDKInstance

Parameters

ParameterTypeDescription
contextContextAndroid application context
maestroEventDelegateMaestroEventDelegateDelegate interface for SDK callbacks
paramsMaestroSDKParametersConfiguration parameters

MaestroSDKParameters Interface

data class MaestroSDKParameters(
val siteId: String,
val eventData: MaestroEventData? = null,
)

Returns

TypeDescription
MaestroSDKInstanceThe initialized SDK instance representing the configured SDK session

Example

val sdk = MaestroSDK.configure(
context = applicationContext,
maestroEventDelegate = this,
params = MaestroSDKParameters(
siteId = "your-site-id",
eventData = null,
),
)

Notes

  • Call this method before any other SDK operations
  • Only one instance can be active at a time
  • Previous instances are automatically detached
  • The siteId parameter must match a valid Maestro site ID
  • The context should typically be the application context to avoid memory leaks