Skip to content

Feature Request: Expose a method to programmatically signal user activity (Custom Activity Trigger) #193

Description

@porshkevich

Description

Currently, oidc-spa automatically detects user activity based on native peripheral events (like mouse and keyboard actions) to manage the idle timeout.

However, there are common scenarios where a user is actively using the application without physical interaction for extended periods (5-10 minutes). The most prominent examples are:

  • Video Conferences / Webinars: Users are actively engaged in a call but don't touch the mouse or keyboard.
  • Media Playback: Users are watching embedded training videos or presentations.

In these cases, the library triggers a false-positive idle timeout and logs the user out mid-session. To make the idle tracking more flexible, it would be highly beneficial to have a way to manually tell the library that the user is still active.

Proposed Solution

Expose a method in the oidc instance API (for example, oidc.signalActivity()) that developers can call programmatically from their application logic (e.g., inside a WebRTC session or media player event loop).

When called, this method should reset the internal idle timeout timer exactly as a mouse movement or keypress currently does.

Thank you for this amazing library!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions