end-user-activity-monitor
EUAMonitor is a fast, lightweight and flexible library that detects when user becomes idle or active. Can be used as ES2015 module import or can be loaded with script tag.
Installation
npm i end-user-activity-monitor
Usage
ES2015 module import:
;// ... const activityDetectorAgent = idleInterval: 5000 ;//start activity monitoringactivityDetectorAgent;//subscribe to activity changes: active/idleactivityDetectorAgent;//stop activity monitoring after 30 secs;
The consumer also can use the library by loading it via a script tag:
...
API
//create acrivity detector with idle interval in milliseconds
const agent = idleInterval: 5000 ;
//start activity monitroing
agent;
//stop activity monitroing
agent;
//subscribe to activity changes
agent;
//check if end user is active
agent;
//check if end user is idle
agent;