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.8
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ActivityTracker

用于追踪用户状态工具类

Installtion
npm i actr
Usage
import Actr from 'actr'

const tracker = new Actr({
  idleThreshold: 10000,
  onIdle: () => console.log('空闲状态')
})

// 记录操作
tracker.track('clicked_button')
Props
参数名说明类型必填默认值
idleThreshold空闲阈值number10000(毫秒)
onActive非空闲回调function(d: { name: string, timestamp: number }) => {}
onIdle空闲回调function() => {}
Method
方法名描述参数
track记录方法name: string
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