IdleDetectorService

Detects user idle state and screen lock status using the Idle Detection API. Useful for auto-logout, presence indicators, or pausing resource-intensive tasks.

API Variant
TypeScriptexample.ts
import { IdleDetectorService } from '@angular-helpers/browser-web-apis'

# Methods

MethodSignatureReturnsDescription
isSupportedisSupported(): booleanbooleanPublic method isSupported.
requestPermissionrequestPermission(): Promise<PermissionState>Promise<PermissionState>Public method requestPermission.
watchwatch(options: IdleDetectorOptions): Observable<IdleState>Observable<IdleState>Starts tracking idle state. Emits the current state and subsequent changes. Note: You must call requestPermission() and be granted access before starting.
LCP N/A
CLS N/A
INP N/A