@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 +10 -1
- package/dist/index.d.mts +24 -10
- package/dist/index.d.ts +24 -10
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -140,7 +140,16 @@ export interface SDKOptions {
|
|
|
140
140
|
}
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
`sessionMaxDuration`
|
|
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
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
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
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
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