Skip to main content

Core SDK Overview

Introduction to Core SDK

The Core SDK of MaestroKit provides the essential functions that form the backbone of the framework. These functions are responsible for configuring the SDK, managing the event lifecycle, and handling user authentication. By using these core functions, your app can communicate efficiently with MaestroKit, ensuring a seamless integration and a responsive user experience.

Interface

public protocol MaestroManagerInterface {
nonisolated func configure(siteID: String, jwt: String)
nonisolated func userDidStartWatchingEvent(
eventID: String,
delegate: MaestroEventDelegate
) async -> MaestroEventInterface
nonisolated func userDidStopWatchingEvent(_ eventID: String) async
nonisolated func getCurrentSiteID() async -> String?
nonisolated func getCurrentAuthToken() async -> String?
nonisolated func getCurrentUserID() async -> String?
}

Table of Contents

Key Responsibilities

  • Event Lifecycle Management:
    Functions like userDidStartWatchingEvent and userDidStopWatchingEvent allow you to notify the SDK when a user opens or closes an event. This ensures that the SDK can manage resources and state appropriately during an event's lifecycle.

  • Configuration and State Retrieval:
    With functions such as getCurrentSiteID, getCurrentAuthToken, and getCurrentUserID, you can retrieve the current configuration and authentication details at any point. This is vital for maintaining consistent state and for debugging purposes.

  • Asynchronous Integration:
    All the functions in the Core SDK are asynchronous, ensuring they integrate smoothly with Swift's concurrency model. This helps maintain a responsive UI and efficient background processing.