Represents a command to reset the user inactivity (AFK) timer.
This class sends a message to the Metabox API to restart the inactivity countdown,
keeping the session alive when activity is detected programmatically.
What does it unlock?
Resets the AFK inactivity timer, preventing an imminent disconnect when the countdown is active.
Practical Application
Used to programmatically signal user activity and reset the inactivity countdown.
Pair with the userInactivityDetected event to show a custom "Stay connected?" prompt
and call this command when the user confirms, dismissing the countdown.
AI Coding Best Practices
Call api.sendCommandToMetabox(new ResetUserInactivityTimer()). No parameters.
Typically triggered from a "Stay connected" or "I'm still here" button rendered when
userInactivityDetected.countdownVisible is true.
Example
import { ResetUserInactivityTimer, Communicator } from'@3dsource/metabox-front-api'; window.env3DSource.apiReady = (api: Communicator) => { api.addEventListener('userInactivityDetected', ({ countdownVisible }) => { if (countdownVisible) { // show custom UI, then on user confirmation: api.sendCommandToMetabox(newResetUserInactivityTimer()); } }); };
Represents a command to reset the user inactivity (AFK) timer. This class sends a message to the Metabox API to restart the inactivity countdown, keeping the session alive when activity is detected programmatically.
What does it unlock?
Resets the AFK inactivity timer, preventing an imminent disconnect when the countdown is active.
Practical Application
Used to programmatically signal user activity and reset the inactivity countdown. Pair with the
userInactivityDetectedevent to show a custom "Stay connected?" prompt and call this command when the user confirms, dismissing the countdown.AI Coding Best Practices
Call
api.sendCommandToMetabox(new ResetUserInactivityTimer()). No parameters. Typically triggered from a "Stay connected" or "I'm still here" button rendered whenuserInactivityDetected.countdownVisibleistrue.Example