Skip to content

IdleManager

Defined in: idle-manager.ts:35

Detects if the user has been idle for a duration of idleTimeout ms, and calls onIdle and registered callbacks. By default, the IdleManager will log a user out after 10 minutes of inactivity. To override these defaults, you can pass an onIdle callback, or configure a custom idleTimeout in milliseconds.

IdleManager is a singleton: multiple calls to create() return the same instance, registering any new onIdle callback. Call exit() to tear down the singleton.

exit(): void

Defined in: idle-manager.ts:140

Tears down listeners, fires all callbacks, and clears the singleton.

void


registerCallback(callback): void

Defined in: idle-manager.ts:133

IdleCB

function to be called when user goes idle

void


static create(options?): IdleManager

Defined in: idle-manager.ts:54

Creates or returns the singleton IdleManager. If the instance already exists, any provided onIdle callback is registered on the existing instance.

Optional configuration

boolean

capture scroll events

Default

false

number

timeout in ms

Default

10 minutes [600_000]

() => unknown

Callback after the user has gone idle

See

IdleCB

number

scroll debounce time in ms

Default

100

IdleManager

IdleManagerOptions