Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

Config: { full_trace?: boolean; idle_brief_timeout?: number; idle_long_timeout?: number; off_page_long_timeout?: number; report_timeout?: number; silent?: boolean }

The configuration for the app.

Type declaration

  • Optional full_trace?: boolean

    Should the full trace be reported along with the summary metrics? Defaults to false.

  • Optional idle_brief_timeout?: number

    How long (ms) the user must be inactive before being considered idle. Defaults to 2 minutes.

  • Optional idle_long_timeout?: number

    How long (ms) the user can be idle before being considered off-page. Defaults to 15 minutes.

  • Optional off_page_long_timeout?: number

    How long (ms) the user must be off-page while before being considered away for a long time. Defaults to 15 minutes.

  • Optional report_timeout?: number

    The length of time (ms) between reports. Defaults to 10 seconds.

  • Optional silent?: boolean

    Should messages to the console be suppressed?

Report: { time_engaged: number; time_idle_brief: number; time_idle_long: number; time_off_page_brief: number; time_off_page_long: number; trace?: Trace }

The report payload sent to connected callbacks. The payload contains information about how the user spent their time on the page: either engaged or idle. The idle time is split into four additive subdivisions, which are described below. They are additive in that all periods classified as within that subdivision have their times lumped together into a single cumulative metric, and because adding all of the subdivisions together will yield the full time the user was monitored.

  • time_engaged: active time on the page
  • time_idle_brief: inactive time on the page for shorter periods
  • time_idle_long: inactive time on the page for longer periods
  • time_off_page_brief: inactive time off of the page for shorter periods
  • time_off_page_long: inactive time off of the page for longer periods

Type declaration

  • time_engaged: number

    The cumulative amount of time (ms) the user has been considered active during the monitoring session.

  • time_idle_brief: number

    The cumulative amount of time (ms) the user has been in a brief idle state while on page (idle lasting more than idle_brief_timeout and less than idle_long_timeout).

  • time_idle_long: number

    The cumulative amount of time (ms) the user has been in a long idle state while on page (idle lasting more than idle_long_timeout).

  • time_off_page_brief: number

    The cumulative amount of time (ms) the user has been off page for short periods of time (lasting less than off_page_long_timeout).

  • time_off_page_long: number

    The cumulative amount of time (ms) the user has been off page for long periods of time (lasting more than off_page_long_timeout).

  • Optional trace?: Trace

    A timestamped log of the user's move through different activity states. Only included if full_trace is turned on.

Trace: TraceEntry[]

An array of timestamped logs of the user's move through different activity states.

TraceEntry: { switched_to: TraceName; timestamp: Date }

A trace entry is an indication that the user switched state, the time the switch occured, and the state the user switched_to.

Type declaration

TraceName: "page_close" | keyof typeof States

Trace names are the names of the states a user can switch to with the addition of 'page_close' which occurs when the user navigates away from the page, closes it, or refreshes (i.e. on the 'pageunload' event).

Generated using TypeDoc