New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

actr

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

actr

ActivityTracker 是一个 TypeScript 类,用于监视用户活动并检测 Web 应用程序中的空闲状态。它记录指定类型的用户交互并跟踪每个事件的时间戳。该类使用时间阈值来确定用户是否空闲,基于自上次交互以来经过的时间来判断。这对于实现自动注销、会话超时或不活动警报等功能非常有用。

  • 1.0.5
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

ActivityTracker

用于监视用户活动并检测应用程序中的空闲状态。

Installtion
npm i actr
Usage
import Actr from 'actr'

const tracker = new Actr()

// Call the track method whenever the user performs an activity
tracker.track({ name: 'clicked_button' })

// Check if the user is idle
if (tracker.isIdle) {
  // Do something if the user is idle
}
Props
参数名说明类型必填默认值
idleThreshold用户空闲时间的阈值,单位为毫秒number20000
onActive新的动作触发回调function() => {}
Method
NameDescription
track记录用户活动,接收一个对象参数表示用户的活动内容
destroy清空用户活动信息

Keywords

FAQs

Package last updated on 03 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc