Documentation Index
Fetch the complete documentation index at: https://mintlify.com/AslamSDM/mentiq-sdk/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheuseSessionTracking hook provides real-time access to user session data including session ID, activity status, duration, page views, clicks, and scroll depth.
Usage
Returns
Unique identifier for the current session
Whether the session is currently activeReturns
true if the user is actively engaged, false otherwise. Defaults to false if no session data is available.Session duration in millisecondsTime elapsed since the session started. Defaults to
0 if no session data is available.Number of pages viewed in the current sessionDefaults to
0 if no session data is available.Number of clicks recorded in the current sessionDefaults to
0 if no session data is available.Maximum scroll depth as a percentage (0-100)Indicates how far down the page the user has scrolled. Defaults to
0 if no session data is available.Complete session data objectContains all session metrics including the fields above plus additional metadata.
Type Definitions
SessionData
Examples
Display Session Timer
Engagement Warning
Notes
Session data is automatically tracked when the analytics SDK is initialized. This hook provides reactive access to that data.
Related Hooks
- useAnalytics - Access core analytics methods
- useErrorTracking - Track errors during sessions
- usePerformanceTracking - Track performance metrics