Core SDK
Introduction
The Core SDK provides the fundamental fields and methods for initializing and configuring the Maestro Roku SDK. These configurable fields and functions serve as the entry point for integrating the SDK into your Roku application and allow you to configure behavior, manage event lifecycles, and control the panel.
SDK Component
The Maestro Roku SDK is distributed as a remote ComponentLibrary. Once loaded, you create the main panel component:
m.lib = createObject("roSGNode", "MaestroPanelLib:MaestroPanel")
Key Responsibilities
SDK Configuration: The
configfield initializes the SDK with your site ID, event ID, authentication tokens, and environment settings. This is typically set after configuring other fields and triggers the API requests.Event Lifecycle Management: The
userDidStartWatchingEventfield manages the lifecycle of events, triggering a new panel session when a user switches to different content.Panel Control: Fields like
width,height,displayQRCodes, and functions likesetPanelFocus()control the panel's appearance and behavior.Data Management: The
setDataToPanelfield allows you to push external data into specific panels, whilegetDataFromPanel()retrieves data using a polling model.Resource Cleanup: The
destroySDK()function performs a clean teardown, removing all field observers and hiding the panel when you're done with the SDK. UserestartSDK()to reset and re-initialize the SDK without recreating the node.
Configurable Fields
These fields are set by the client application to control SDK behavior:
| Field | Type | Description |
|---|---|---|
| config | assocArray | Primary configuration object; triggers Maestro config fetch |
| configuration | assocArray | Passes runtime configuration to SDK panels, overriding server-side defaults |
| displayQRCodes | boolean | Enables/disables QR code display |
| fetchDataOnInit | boolean | Fetch panel data on load (default: true) |
| handleLoadingSceneAction | string | Communicates loading actions to your app |
| height | integer | Panel height; alias of panelManagerView.height |
| sendTestOverlay | string | "fantasy" or "bet" triggers an overlay test event |
| setDataToPanel | assocArray | Pushes external data into panel (depends on panel type) |
| userDidStartWatchingEvent | string | Used when user switches content; triggers new panel session |
| userSettings | assocArray | Override default panel/overlay/user behavior |
| width | integer | Panel width; alias of panelManagerView.width |
Public Functions
These functions can be called to control SDK behavior:
| Function | Description |
|---|---|
| destroySDK() | Clean teardown; removes all listeners |
| fetchMaestroModule() | Returns configured SDK overlay modules for mounting in the host scene |
| getDataFromPanel() | Returns panel data (polling model) |
| onPlayerTimeCodeUpdated() | Passes player timecode to SDK |
| setConfiguration() | Applies runtime configuration to SDK panels |
| restartSDK() | Destroys and re-initializes the SDK without removing the node |
| setPanelFocus() | Moves Roku focus into the panel |
Usage Pattern
The typical initialization pattern follows these steps:
- Load the ComponentLibrary
- Create the MaestroPanel node
- Observe essential fields (trackingEvent, errorInformation, etc.)
- Set configurable fields (width, height, displayQRCodes)
- Set the config object (triggers initialization)
- Append the panel to your scene
sub onLibraryLoadStatusChanged()
if m.componentLibrary.loadStatus = "ready"
m.lib = createObject("roSGNode", "MaestroPanelLib:MaestroPanel")
' Observe fields
m.lib.observeField("trackingEvent", "onTrackingEvent")
m.lib.observeField("errorInformation", "onErrorInformation")
' Set dimensions
m.lib.width = 1280
m.lib.height = 720
' Configure (must be last)
m.lib.config = {
siteID: "your-site-id",
eventID: "your-event-id",
useProdEnv: true
}
m.top.appendChild(m.lib)
end if
end sub