Skip to main content

configure

Starts a new core SDK session.

Overview​

MaestroCoreSDK.configure() is the first method you call when integrating the core SDK. It sets up a session from your parameters and reports to your delegate. Only one session runs at a time: configuring again detaches the previous session, which should not be used anymore.

Syntax​

fun configure(
context: Context,
params: CoreSDKParameters,
delegate: CoreEventDelegate,
): CoreMaestroSDK.Instance

Parameters​

ParameterTypeDescription
contextContextAndroid context. The SDK keeps only its application context.
paramsCoreSDKParametersConfiguration parameters
delegateCoreEventDelegateReceives callbacks from the SDK

Returns​

TypeDescription
CoreMaestroSDK.InstanceThe configured session. Pass it to MaestroCorePanel and MaestroCoreOverlays, and call the session methods listed in the API Reference on it.

Example​

val sdk = MaestroCoreSDK.configure(
context = applicationContext,
params = CoreSDKParameters(
siteId = "your-site-id",
pageId = "your-page-id",
configBaseUrl = "https://static.gcp.maestro.io",
),
delegate = MyCoreDelegate(),
)

Notes​

  • Call this method before any other SDK operation
  • Only one session is active at a time; configuring again detaches the previous session
  • Start sessions with MaestroCoreSDK.configure() from com.maestro.uitoolkit.core. CoreMaestroSDK, the type of the session it returns, also has a configure(), which is internal to the SDK