PlexNotificationsApi class

/:/websockets/notifications and /:/eventsource/notifications — server-push notifications.

Plex exposes the same notification stream over two transports. Use connectWebSocket for full-duplex (no extra polling overhead) or connectEventSource when WebSockets are blocked by an intermediate proxy.

The notification frames carry server state changes: playback progress, library scan progress, transcoder sessions, settings updates, etc. Each frame is exposed as a PlexNotification map with a type discriminator.

Constructors

PlexNotificationsApi(PlexConnection _http)
Construct from a PlexConnection. Typically obtained via PlexClient.notifications.

Properties

hashCode int
The hash code for this object.
no setterinherited
isEventSourceConnected bool
True while an EventSource (SSE) stream is open.
no setter
isWebSocketConnected bool
True while a WebSocket is open.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

closeEventSource() Future<void>
Close the EventSource stream and release resources.
closeWebSocket() Future<void>
Close the WebSocket and release resources.
connectEventSource({String? filter}) Stream<PlexNotification>
GET /:/eventsource/notifications — open a Server-Sent Events stream of notifications. SSE is a one-way (server → client) transport; use this when WebSockets are blocked.
connectWebSocket({String? filter}) Stream<PlexNotification>
GET /:/websockets/notifications — open a WebSocket and emit every notification as a PlexNotification.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited