Hello and welcome to IdleTimer. If you are new here, you can get a detailed overview of how to use IdleTimer on this page. Check out the examples in the features section.


Inside your React project directory, install IdleTimer by running either of the following:

npm i react-idle-timer
yarn add react-idle-timer

Legacy Browser Support#

IdleTimer supports legacy browsers for both esm and cjs projects. With a modern node.js runtime you can import IdleTimer like this:

import { useIdleTimer } from 'react-idle-timer/legacy'

For older versions of node which lack support for package.json exports, you will have to import the full path.

For CommonJS:

import { useIdleTimer } from 'react-idle-timer/dist/index.legacy.cjs.js'

For ECMAScript Modules:

import { useIdleTimer } from 'react-idle-timer/dist/index.legacy.esm.js'


To see what has updated in a given version of IdleTimer, you can check the changelog or the github releases.


Please see our contribution guidelines to learn how you can contribute to this project.


IdleTimer is MIT Licensed. You can view the license here. A copy of the license is also shipped with every installation from NPM.

Made withby Randy Lebeau