Fcmam5 / hamid.js

A library to trigger an action if the user is idle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HAMID.js

Mutation testing badge Known Vulnerabilities codecov npm

A library that triggers an action if the user is inactive after a period of time.

Use cases

Banking and payment services

PSD 2 regulation for example requires logging out the user if they're inactive for 5 minutes

The automatic logout after five minutes of inactivity is a regulatory requirement for banks and payment service providers under the PSD 2 regulation to increase security in online banking. See article 4(3)(d) of the DELEGATED REGULATION (EU) 2018/389 (RTS), https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX:32018R0389&from=EN ("the maximum time without activity by the payer after being authenticated for accessing its payment account online shall not exceed 5 minutes."). [commerzbank]

Chat and online games

Online chat rooms, and games may have a requirement of triggering an action if a user is inactive for a set period of time.

Usage

Install the library using npm with npm i hamid.js, or you can use it from a CDN with:

    <script src="https://unpkg.com/browse/hamid.js@0.0.1/dist/lib.js"></script>

Then in your script

      const logMeOut = () => alert('You shall be logged out my friend');
      new Hamid(logMeOut);

Origin of the library's name

It's a local meme in Algeria, especially in Oran. It's a scene from a famous comedy show called "Bila Houdoud" where a bus driver asked his tickets man (Hamid) to kick-out someone.

Hamid Ser7ah from Bila Houdoud

License

MIT

About

A library to trigger an action if the user is idle

License:MIT License


Languages

Language:TypeScript 81.2%Language:JavaScript 18.8%