ConnectorClient is for synchronous pipelines (no async/await). The SSE stream reader
and your callback run on separate threads, so slow calls (vector store writes, embedding
APIs, databases) never stall the stream.
For async pipelines, use AsyncConnectorClient instead.
Constructor
Full URL to
GET /stream/{product_id} on the connector.Unkey API key (
uk_live_...). Leave empty to connect without authentication.Maximum events buffered between the stream reader and worker threads.
When full, new events are dropped and counted in
dropped_count.Callbacks
All registration methods returnself for chaining.
.on_actions(fn)
Called on a worker thread every time a batch of UI actions arrives.
.on_summary(fn)
Called on a worker thread every time a session summary arrives.
.on_drop(fn)
Called when events are dropped because the queue is full (backpressure).
Called with the raw dropped payload and the running total of dropped events.
Lifecycle
.run()
Connect and block until stopped. Reconnects with exponential backoff (1 s → 30 s).
.run_in_background()
Start on a daemon thread and return immediately.
threading.Thread.
.stop()
Signal the client to stop after the current event.
Observability
dropped_count means your callback is slower than the event rate.
Increase max_queue_size or optimise the callback.