Skip to main content

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.

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",
maestroManagerDelegate: <reference to your implementation of MaestroManagerDelegate>,
maestroWorkingEnvironment: .prod
)

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:

ParameterTypeDescriptionExample
siteIDStringA unique identifier for your Maestro site. It must be provided at launch."exampleSiteID"
jwtString (optional)A JWT token used for authentication with MaestroKit services."exampleJWTToken"
maestroManagerDelegateMaestroManagerDelegateA delegate for handling SDK-scoped callbacks.A reference to your implementation of this delegate
maestroWorkingEnvironmentMaestroWorkingEnvironmentThe working environment (qa/prod) the SDK will run in..prod

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:

EnvironmentDescription
.testFor testing and development purposes.
.qaFor staging and quality assurance.
.prodFor live applications in production.