@groundcover/browser 0.0.77-rc.0 → 0.0.77-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -140,7 +140,16 @@ export interface SDKOptions {
140
140
  }
141
141
  ```
142
142
 
143
- `sessionMaxDuration` caps wall-clock session length (default 4 hours, must be between 1 minute and 8 hours). The cap is enforced lazily: when the next user/business event is produced after the cap has elapsed, the SDK flushes pending events under the current session id, generates a fresh id, and resumes replay recording if it had been active. A dormant tab that produces no further events keeps its session id (session replay batches don't count, so a backgrounded recording won't spawn empty sessions). The flush is best-effort and the rotation always proceeds regardless of delivery success. Values outside that range or otherwise invalid fall back to the default with a `console.warn`.
143
+ `sessionMaxDuration` sets a **target** maximum wall-clock session length (default 4 hours, must be between 1 minute and 8 hours).
144
+
145
+ It is enforced **lazily, on activity — not by a background timer**, so it is **not a hard upper bound**. Once the cap has elapsed, the *next* user/business event (click, navigation, log, custom, network, exception, …) flushes pending events under the current session id, generates a fresh id, and resumes replay recording if it had been active.
146
+
147
+ Because rotation is activity-gated, a session that goes idle keeps its id past the cap until the next qualifying event:
148
+
149
+ - A dormant or backgrounded tab that produces no further events stays on the same session id — by design, so the SDK doesn't mint "phantom" sessions for tabs nobody is using.
150
+ - **Session-replay batches don't count as activity** (rrweb emits a snapshot heartbeat every ~30s regardless of interaction), so a tab that's only recording replay won't rotate on that alone. Such a tab is ultimately bounded by the 30-minute replay-inactivity stop, not by this cap.
151
+
152
+ The flush is best-effort and the rotation always proceeds regardless of delivery success. Values outside the allowed range or otherwise invalid fall back to the default with a `console.warn`.
144
153
 
145
154
  You can pass the values by calling the init function:
146
155
 
package/dist/index.d.mts CHANGED
@@ -205,16 +205,30 @@ interface SDKOptions {
205
205
  blockedSelectors?: string[];
206
206
  };
207
207
  /**
208
- * Maximum wall-clock duration of a session, in milliseconds. The cap is
209
- * enforced lazily: the next user/business event after the cap has elapsed
210
- * flushes buffered events under the current session id, then generates a
211
- * fresh session id and restarts replay recording if it was active. Session
212
- * replay batches never trigger this on their own. The flush is best-effort
213
- * and the rotation always proceeds it does not wait for or depend on
214
- * successful delivery, so if that network request fails the batch may be
215
- * lost while the new session id still takes effect. Defaults to 4 hours when
216
- * omitted; must be between 1 minute and 8 hours. Values outside that range
217
- * or otherwise invalid fall back to the 4-hour default with a `console.warn`.
208
+ * Target maximum wall-clock duration of a session, in milliseconds.
209
+ *
210
+ * Enforced LAZILY, on activity not by a background timer. Once the cap has
211
+ * elapsed, the next user/business event (click, navigation, log, custom,
212
+ * network, exception, …) flushes buffered events under the current session
213
+ * id, then mints a fresh session id and restarts replay recording if it was
214
+ * active.
215
+ *
216
+ * Because it is activity-gated, this is NOT a hard upper bound: a session
217
+ * only rotates when the next qualifying event arrives. An idle or
218
+ * backgrounded tab that produces no such events — including one that is only
219
+ * emitting session-replay heartbeats, which never trigger rotation on their
220
+ * own — keeps the same session id past the cap until activity resumes. This
221
+ * is deliberate: it avoids minting "phantom" sessions for dormant tabs. (An
222
+ * idle tab with replay on is ultimately bounded by the 30-minute
223
+ * replay-inactivity stop, not by this cap.)
224
+ *
225
+ * The flush is best-effort and the rotation always proceeds — it does not
226
+ * wait for or depend on successful delivery, so if that network request
227
+ * fails the batch may be lost while the new session id still takes effect.
228
+ *
229
+ * Defaults to 4 hours when omitted; must be between 1 minute and 8 hours.
230
+ * Values outside that range or otherwise invalid fall back to the 4-hour
231
+ * default with a `console.warn`.
218
232
  */
219
233
  sessionMaxDuration?: number;
220
234
  }
package/dist/index.d.ts CHANGED
@@ -205,16 +205,30 @@ interface SDKOptions {
205
205
  blockedSelectors?: string[];
206
206
  };
207
207
  /**
208
- * Maximum wall-clock duration of a session, in milliseconds. The cap is
209
- * enforced lazily: the next user/business event after the cap has elapsed
210
- * flushes buffered events under the current session id, then generates a
211
- * fresh session id and restarts replay recording if it was active. Session
212
- * replay batches never trigger this on their own. The flush is best-effort
213
- * and the rotation always proceeds it does not wait for or depend on
214
- * successful delivery, so if that network request fails the batch may be
215
- * lost while the new session id still takes effect. Defaults to 4 hours when
216
- * omitted; must be between 1 minute and 8 hours. Values outside that range
217
- * or otherwise invalid fall back to the 4-hour default with a `console.warn`.
208
+ * Target maximum wall-clock duration of a session, in milliseconds.
209
+ *
210
+ * Enforced LAZILY, on activity not by a background timer. Once the cap has
211
+ * elapsed, the next user/business event (click, navigation, log, custom,
212
+ * network, exception, …) flushes buffered events under the current session
213
+ * id, then mints a fresh session id and restarts replay recording if it was
214
+ * active.
215
+ *
216
+ * Because it is activity-gated, this is NOT a hard upper bound: a session
217
+ * only rotates when the next qualifying event arrives. An idle or
218
+ * backgrounded tab that produces no such events — including one that is only
219
+ * emitting session-replay heartbeats, which never trigger rotation on their
220
+ * own — keeps the same session id past the cap until activity resumes. This
221
+ * is deliberate: it avoids minting "phantom" sessions for dormant tabs. (An
222
+ * idle tab with replay on is ultimately bounded by the 30-minute
223
+ * replay-inactivity stop, not by this cap.)
224
+ *
225
+ * The flush is best-effort and the rotation always proceeds — it does not
226
+ * wait for or depend on successful delivery, so if that network request
227
+ * fails the batch may be lost while the new session id still takes effect.
228
+ *
229
+ * Defaults to 4 hours when omitted; must be between 1 minute and 8 hours.
230
+ * Values outside that range or otherwise invalid fall back to the 4-hour
231
+ * default with a `console.warn`.
218
232
  */
219
233
  sessionMaxDuration?: number;
220
234
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@groundcover/browser",
3
- "version": "0.0.77-rc.0",
3
+ "version": "0.0.77-rc.1",
4
4
  "description": "groundcover browser SDK",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -66,4 +66,4 @@
66
66
  "limit": "82 kB"
67
67
  }
68
68
  ]
69
- }
69
+ }