npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-session-timeout-alert

v2.1.0

Published

A Session Timeout Alert alert component to display after a set idle timeout of a user

Downloads

81

Readme

React Session Timeout Alert

NPM version npm downloads GitHub license

A Session Timeout Alert component to display after a set idle time for a user. The primary purpose for the alert is to logout a authenticated user after a set time of no interaction with the UI.

Install

npm install react-session-timeout-alert

Available Props

| Name | Type | Default | Description | | -------------------- | -------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | | alertActionsClass | String | rst-alert-actions | Class for Alert Modal actions | | alertContainerClass | String | rst-alert | Class for Alert Modal container | | alertContentClass | String | rst-alert-content | Class for Alert Modal content | | alertTimerClass | String | rst-alert-timer | Class for Alert Modal timer | | alertTitle | String | null | Title for Alert Modal | | alertDescription | String | null | Description for Alert Modal | | cancelBtn | Object | {class: "rst-btn rst-btn-danger", text: "Stay Logged In", type: "button"} | Title and Text for Alert cancel button | | confirmBtn | Object | {class: "rst-btn rst-btn-primary", text: "Logout", type: "submit"} | Title and Text for Alert submit button | | debounceTime | Number | 500 | delay in ms before timer starts back due to user inactivity proceeding re-activity | | handleSessionTimeout | Function | () => alert("logging out") | Function to call on Alert submit button click and alert timer end | | idleTime | Number | 5 | Number of minutes before displaying alert modal | | | modalTimeout | Number | 20 | Number of seconds for countdown before hiding alert modal and calling handleSessionTimeout method |

Basic Usage

import { ReactSessionTimeoutAlert } from 'react-session-timeout-alert';

<ReactSessionTimeoutAlert
  idleTime={5}
  modalTimeout={20}
  alertTitle={"Idle Timeout Warning"}
  alertDescription={"You are about to be logged out due to inactivity"}
  cancelBtn={{
    text: "Cancel",
    class: "rst-btn rst-btn-danger"
  }}
  handleSessionTimeout = {() => alert("logging out")}
/>

Story Book

git clone [email protected]:EvanMiller12/react-session-timeout-alert.git

cd react-session-timeout-alert

make sure to use Node >=16.0.0

npm install

npm run storybook

Simple Example

git clone [email protected]:EvanMiller12/react-session-timeout-alert.git

cd react-session-timeout-alert/example

make sure to use Node >=16.0.0

npm install

npm run start

License

MIT license, Copyright (c) 2024 Evan Miller. For more information see LICENSE.