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
| Parameter | Type | Description |
|---|---|---|
context | Context | Android application context |
maestroEventDelegate | MaestroEventDelegate | Delegate interface for SDK callbacks |
params | MaestroSDKParameters | Configuration parameters |
MaestroSDKParameters Interface
data class MaestroSDKParameters(
val siteId: String,
val eventData: MaestroEventData? = null,
)
Returns
| Type | Description |
|---|---|
MaestroSDKInstance | The 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
siteIdparameter must match a valid Maestro site ID - The
contextshould typically be the application context to avoid memory leaks