Skip to main content

Maestro SDK Bets Implementation

Overview

The Maestro SDK enables betting-related features in Jetpack Compose Android applications. The SDK makes API calls for bet data using the eventId provided via MaestroManager.userDidStartWatchingEvent(). The client app supplies authentication data using needAuthDataForBets() in the MaestroEventDelegate. The panel is displayed using MaestroPanel().

Usage

1. Starting an Event Session and Displaying the Panel

Provide the eventId using userDidStartWatchingEvent() to let the SDK fetch bet data:

In your MaestroEVentDelegate please provide the swid and jwttoken("x-p13n-auth")

    override fun needAuthDataForBets(): StateFlow<AuthData?> {
val betSwidFlow: MutableStateFlow<AuthData?> = MutableStateFlow(null)
lifecycleScope.launch {
betSwidFlow.emit(
AuthData(
swid = "%7B45636D22-B82E-494E-B0BD-DBF25AB34BB5%7D",
jwtToken = ""
)
)
}
return betSwidFlow.asStateFlow()
}


// to direclty open the bets panel without clicking to it
maestroEventViewModel.didShowPanel(MaestroPanelType.Bets())


Notes The SDK uses the eventId to make API calls for bet data. Ensure needAuthDataForBets() provides valid authentication data to avoid API call failures.