AFK (Away From Keyboard) detection disconnects inactive users to free up UE instance resources for others. This page covers configuration, the AFK event sequence, and how to build a custom warning overlay.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.