UNPKG

@embrace-io/web-sdk

Version:
43 lines (42 loc) 2.75 kB
//#region src/managers/EmbraceUserSessionManager/constants.ts const EMBRACE_USER_SESSION_STATE_KEY = "embrace_user_session_state"; /** * Bump when UserSessionState's shape changes incompatibly. Persisted blobs * whose schemaVersion doesn't match are discarded on read. */ const USER_SESSION_STATE_SCHEMA_VERSION = 1; const EMBRACE_USER_SESSION_NUMBER_KEY = "embrace_user_session_number"; const EMBRACE_SESSION_PART_NUMBER_KEY = "embrace_session_part_number"; const EMBRACE_PERMANENT_PROPERTIES_KEY = "embrace_permanent_properties"; const EMBRACE_LAST_END_USER_SESSION_TS_KEY = "embrace_last_end_user_session_ts"; const SESSION_PART_SPAN_NAME = "emb-session-part"; /** * Part end reasons that also terminate the enclosing user session, so the * part is stamped as the final one (`emb.is_final_session_part`). */ const FINAL_SESSION_PART_END_REASONS = /* @__PURE__ */ new Set(["user_session_ended", "web_foreground_inactivity"]); const DEFAULT_USER_SESSION_MAX_DURATION_SECONDS = 720 * 60; const MIN_USER_SESSION_MAX_DURATION_SECONDS = 3600; const MAX_USER_SESSION_MAX_DURATION_SECONDS = 1440 * 60; const DEFAULT_USER_SESSION_INACTIVITY_TIMEOUT_SECONDS = 1800; const MIN_USER_SESSION_INACTIVITY_TIMEOUT_SECONDS = 30; const MAX_USER_SESSION_INACTIVITY_TIMEOUT_SECONDS = 1440 * 60; const DEFAULT_USER_SESSION_FOREGROUND_INACTIVITY_TIMEOUT_SECONDS = 1800; const MIN_USER_SESSION_FOREGROUND_INACTIVITY_TIMEOUT_SECONDS = 30; const MAX_USER_SESSION_FOREGROUND_INACTIVITY_TIMEOUT_SECONDS = 1440 * 60; const END_USER_SESSION_COOLDOWN_MS = 5 * 1e3; /** * Default upper bound on how often the activity handler runs; prevents * mousemove from re-arming the inactivity timer for every sub-second event. */ const DEFAULT_ACTIVITY_THROTTLE_MS = 30 * 1e3; /** Default input events that count as user interaction with a foreground tab. */ const DEFAULT_ACTIVITY_EVENTS = [ "keydown", "mousedown", "mousemove", "scroll" ]; //#endregion export { DEFAULT_ACTIVITY_EVENTS, DEFAULT_ACTIVITY_THROTTLE_MS, DEFAULT_USER_SESSION_FOREGROUND_INACTIVITY_TIMEOUT_SECONDS, DEFAULT_USER_SESSION_INACTIVITY_TIMEOUT_SECONDS, DEFAULT_USER_SESSION_MAX_DURATION_SECONDS, EMBRACE_LAST_END_USER_SESSION_TS_KEY, EMBRACE_PERMANENT_PROPERTIES_KEY, EMBRACE_SESSION_PART_NUMBER_KEY, EMBRACE_USER_SESSION_NUMBER_KEY, EMBRACE_USER_SESSION_STATE_KEY, END_USER_SESSION_COOLDOWN_MS, FINAL_SESSION_PART_END_REASONS, MAX_USER_SESSION_FOREGROUND_INACTIVITY_TIMEOUT_SECONDS, MAX_USER_SESSION_INACTIVITY_TIMEOUT_SECONDS, MAX_USER_SESSION_MAX_DURATION_SECONDS, MIN_USER_SESSION_FOREGROUND_INACTIVITY_TIMEOUT_SECONDS, MIN_USER_SESSION_INACTIVITY_TIMEOUT_SECONDS, MIN_USER_SESSION_MAX_DURATION_SECONDS, SESSION_PART_SPAN_NAME, USER_SESSION_STATE_SCHEMA_VERSION }; //# sourceMappingURL=constants.js.map