@3dsource/metabox-front-api
    Preparing search index...

    Class ResetUserInactivityTimer

    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.

    Resets the AFK inactivity timer, preventing an imminent disconnect when the countdown is active.

    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.

    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.

    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(new ResetUserInactivityTimer());
    }
    });
    };
    Index

    Constructors

    Properties

    Constructors

    Properties

    data: ToMetaBoxMessageEnvelope

    The message envelope populated by subclass constructors and sent via Communicator.sendCommandToMetabox.