AFK detection disconnects inactive viewers to free up workers. The timeout is a project-level setting — applied to every session whether the viewer connects via the share link, an iframe, or the Web SDK. See Session rules for the dashboard configuration. What the SDK adds is runtime hooks: events you can listen for to render a custom warning UI before the disconnect, or override the default timeout for SDK-based sessions.Documentation Index
Fetch the complete documentation index at: https://docs.streampixel.io/llms.txt
Use this file to discover all available pages before exploring further.
Video tutorial
Configuration
Set the timeout duration in seconds (1-7200):How it works
- The SDK monitors user input (mouse, keyboard, touch, gamepad)
- After
afktimeoutseconds of inactivity, a warning is shown - If the user interacts during the warning countdown, the timer resets
- If the countdown reaches zero, the stream disconnects
Events
afkWarningActivate
Fires when the AFK warning should be displayed. Provides a countdown value and a dismiss function.
afkWarningUpdate
Fires every second during the countdown with the updated value.
afkWarningDeactivate
Fires when the user interacts during the warning, dismissing it.
afkTimedOut
Fires when the countdown reaches zero and the session ends.
Custom AFK overlay
The SDK includes a default AFK overlay. To replace it with your own, hide the default and use the events above:You can hide the SDK’s built-in AFK overlay with
#afkOverlay { display: none !important; } in your CSS and build a fully custom overlay using the AFK events listed above.Full example
Next steps
Queue system
Show waiting users their position when all UE instances are busy.
Reconnection
Recover from unexpected WebSocket drops automatically.