Skip to main content

userDidStopWatchingEvent

Indicates that a user has stopped watching an event and cleans up resources.

Overview

When a user stops watching an event, call this method to properly clean up resources and reset the SDK state. This method is typically called when the user navigates away from the event view or closes the application.

It tears down the entire current session: it unmounts any active panel, ends all analytics sessions, releases the event view model (after which getMaestroEventViewModel() will throw until you start a new event), clears all loaded page configs, and stops global-config polling.

note

The eventId and pageId fields on SDKStopEventParams are currently not used — the call always ends the whole session regardless of what you pass. They are reserved for future per-event teardown. To stop one event in a multi-event session today, call userDidStartWatchingEvent again with the reduced set of IDs.

Method Signature

userDidStopWatchingEvent(params: SDKStopEventParams): Promise<void>

Parameters

ParameterTypeDescription
paramsSDKStopEventParamsAn object containing the necessary fields to shut down and clean up resources related to this event/page

SDKStopEventParams Interface

export type SDKStopEventParams = {
/**
* Event ID for the event being stopped.
*/
eventId?: string;
/**
* Page ID for the event being stopped.
*/
pageId?: string;
};

Return Value

This method returns a Promise that resolves when cleanup is complete.

Notes

  • Call this method when the user stops watching an event to ensure proper resource cleanup.