
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
react-idle-timer-hook-ui
Advanced tools
A lightweight and customizable React component that tracks user inactivity and executes a logout (or custom action) after a specified idle period. Perfect for building secure session-based apps.
npm install react-idle-timer-hook-ui
import React from 'react';
import IdleTimer from 'react-idle-timer-hook-ui';
function App() {
const handleLogout = () => {
alert('You have been logged out due to inactivity.');
// Your logout logic here (e.g. redirect or token clear)
};
return (
<div>
<IdleTimer idleTime={5} logout={handleLogout} />
<h1>Welcome to My App</h1>
</div>
);
}
export default App;
idleTime={5}
The time (in seconds) that the user must be inactive before being considered "idle".
In this example, 5
means the user will be logged out after 5 seconds of no mouse, keyboard, or touch interaction.
logout={handleLogout}
A callback function that gets triggered when the user becomes idle for the defined duration.
You can perform any logic here, such as:
FAQs
A reusable React idle timer component with auto-logout
The npm package react-idle-timer-hook-ui receives a total of 42 weekly downloads. As such, react-idle-timer-hook-ui popularity was classified as not popular.
We found that react-idle-timer-hook-ui demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.