Skip to main content

Installation and Integration with Maestro Web SDK

This section will walk you through the process of installing and integrating the Maestro Web SDK into your web application.

Prerequisites

Before you begin, ensure you have:

  • Your Maestro siteID
  • A web application where you want to integrate the SDK

Installation

Add the Maestro Web SDK to your project:

npm install @maestro_io/maestro-web-sdk

or with yarn:

yarn add @maestro_io/maestro-web-sdk

Basic Integration Steps

1. Import the SDK

The Maestro Web SDK follows a singleton pattern, providing a single instance that you can import and use throughout your application:

import SDK from "@maestro_io/maestro-web-sdk";

2. Configure the SDK

SDK.configure({
siteID: "your-site-id",
});

3. Initialize Event

const eventID = "your-event-id";
const delegate = new MaestroEventDelegate(); // Your implementation of IMaestroEventDelegate

const event = await SDK.userDidStartWatchingEvent(eventID, delegate);

For a complete example of integration, refer to our Example Repo (coming soon) for the Maestro Web SDK.