Configure MaestroKit
MaestroKit must be configured at application launch to ensure that all SDK components work correctly. This involves setting up key parameters and specifying the environment. In this chapter, we explore how to instantiate MaestroKit and detail the configuration parameters.
The configure method signature changed in SDK version 10.4.3. A new required parameter showHelloWorld was inserted between jwt and maestroWorkingEnvironment. Update all configure call sites to include this parameter.
Instantiating MaestroKit
MaestroKit utilizes a singleton pattern through the MaestroManager.shared instance. To configure the SDK, simply call its configure method:
MaestroManager.shared.configure(
siteID: "your_site_id",
jwt: "your_jwt_token",
showHelloWorld: false,
maestroWorkingEnvironment: .prod,
defaultPanel: .stats
)
This call sets up the necessary parameters for the SDK to operate, including authenticating network requests and managing internal state.
Configuration Parameters
The following table summarizes the configuration parameters required by MaestroKit:
| Parameter | Type | Description | Example |
|---|---|---|---|
siteID | String | A unique identifier for your Maestro site. It must be provided at launch. | "exampleSiteID" |
jwt | String (optional) | A JWT token used for authentication with MaestroKit services. | "exampleJWTToken" |
showHelloWorld | Bool | True if the SDK should display a verification panel when no content panels are available; false otherwise. | false |
maestroWorkingEnvironment | MaestroWorkingEnvironment | The working environment (qa/prod) the SDK will run in. | .prod |
defaultPanel | MaestroPanelType | The default panel/tab to display when the SDK initializes. | .stats |
Environment Setup
MaestroKit’s internal NetworkManager is initialized with an environment setting that dictates the API endpoints and other configurations. By default, MaestroKit is set to use the development environment. Here are the environment settings available via the MaestroWorkingEnvironment enum:
| Environment | Description |
|---|---|
.test | For testing and development purposes. |
.qa | For staging and quality assurance. |
.prod | For live applications in production. |