AFK Module
AFK stands for Away From Keyboard
Overview
The AFK (Away-From-Keyboard) functionality detects when a user has been inactive for a configured amount of time. When inactivity is detected, the Pixel Streaming system can display a warning and eventually terminate the session - which is mainly relevant as cost saving functionality.
In the Arcware WebSDK, AFK events are emitted by the Epic Games Pixel Streaming Infrastructure and forwarded through the PixelStreaming instance. The Arcware SDK does not implement its own AFK logic but exposes the events so developers can react to them.
These events are available for both:
ArcwareInit (UI integration)
✔
CoreSetup (Headless integration)
✔
AFK behaviour such as timeout duration is primarily configured in the Arcware Cloud platform settings or project configuration.
Accessing AFK Events
AFK events can be listened to through the PixelStreaming instance using the standard Pixel Streaming event system.
Example:
PixelStreaming.addEventListener("eventName", callbackFunction);Example setup:
const { PixelStreaming } = ArcwareInit(
{ shareId: "<your-share-id>" },
configuration
);Available AFK Events
afkWarningActivate
AfkWarningActivateEvent
afkWarningDeactivate
AfkWarningDeactivateEvent
afkWarningUpdate
AfkWarningUpdateEvent
afkTimedOut
AfkTimedOutEvent
These events represent different stages of inactivity detection.
Event Lifecycle
The typical AFK lifecycle follows this sequence:
If the user interacts again before the timeout occurs:
Event Descriptions
afkWarningActivate
Triggered when the system detects inactivity and activates the AFK warning state.
Typical use cases:
show a custom AFK overlay
notify the user they are about to be disconnected
Example:
afkWarningDeactivate
Triggered when the AFK warning is cleared because user activity was detected.
Example:
Typical uses:
hide custom AFK overlays
reset inactivity timers
afkWarningUpdate
Triggered periodically while the AFK warning is active. This event is typically used to update a countdown display.
Example:
Typical payload (example):
Example usage:
afkTimedOut
Triggered when the AFK timeout has been reached and the session will be terminated.
Example:
Typical uses:
show a timeout message
redirect the user
offer a reconnect button
Example:
AFK Configuration
AFK behavior is usually configured in the Arcware Cloud platform rather than directly in the WebSDK.
Although Pixel Streaming exposes parameters such as:
these values may be overridden by backend configuration depending on the project or share settings.
For this reason, the recommended way to configure AFK behavior is through:
project settings
share configuration
Arcware Cloud platform controls
Default AFK Overlays
When using the Arcware UI integration (ArcwareInit), the Pixel Streaming infrastructure may automatically show default AFK warning overlays.
These overlays typically include:
inactivity warning messages
countdown timer
session termination notice
If you want to implement fully custom UI, you can ignore the default overlays and build your own using the AFK events described above.
The SDK also provides a configuration option that can hide the default AFK overlay:
Example: Custom AFK Overlay
Example implementation of a custom AFK overlay:
Example UI:
Notes
AFK events originate from the Epic Pixel Streaming Infrastructure.
The Arcware WebSDK exposes these events through the
PixelStreaminginstance.AFK timeout configuration is usually managed through the Arcware Cloud platform, not through the WebSDK itself.
Last updated