@kayn23/activitymonitor
v1.0.15
Published
A module that allows you to track the real time of user activity on the page
Downloads
5
Readme
Activity
This module provides a simple interface for tracking the actual user activity on the page.
Instalation
npm i @kayn23/activitymonitor
Usage
import { Activity } from "@kayn23/activitymonitor";
const event10 = new Activity({
achieveTime: 20,
cookieName: "test_event_20",
useMultiMode: true,
callback: () => {
console.log("achiev 20");
},
});
event10.init();
Init params
| field | defaul value | description | | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | | achieveTime | 60 | time expiration | | callback | function | callback call after expiration time | | cookieName | 'activity' | cookie name, unique | | forceStart | false | whether to run expired achievements when visiting the page again | | loop | false | re-track after oxpiration | | eventList | "touchmove blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error" | list of events to track | | testPeriod | 10 | user activity check interval | | userMultiMode | false | enable cookies for cross-page event checking | | watchEvery | 1 | verification speed |