@@ -5,17 +5,17 @@ import { WINDOW } from '../helpers';
55
66interface BrowserSessionOptions {
77 /**
8- * Controls when sessions are created.
8+ * Controls the session lifecycle - when new sessions are created.
99 *
10- * - `'single'`: A session is created once when the page is loaded. Session is not
10+ * - `'route'`: A session is created on page load and on every navigation.
11+ * This is the default behavior.
12+ * - `'page'`: A session is created once when the page is loaded. Session is not
1113 * updated on navigation. This is useful for webviews or single-page apps where
1214 * URL changes should not trigger new sessions.
13- * - `'navigation'`: A session is created on page load and on every navigation.
14- * This is the default behavior.
1515 *
16- * @default 'navigation '
16+ * @default 'route '
1717 */
18- mode ?: 'single ' | 'navigation ' ;
18+ lifecycle ?: 'route ' | 'page ' ;
1919}
2020
2121/**
@@ -25,7 +25,7 @@ interface BrowserSessionOptions {
2525 * Note: In order for session tracking to work, you need to set up Releases: https://docs.sentry.io/product/releases/
2626 */
2727export const browserSessionIntegration = defineIntegration ( ( options : BrowserSessionOptions = { } ) => {
28- const mode = options . mode ?? 'navigation ' ;
28+ const lifecycle = options . lifecycle ?? 'route ' ;
2929
3030 return {
3131 name : 'BrowserSession' ,
@@ -43,7 +43,7 @@ export const browserSessionIntegration = defineIntegration((options: BrowserSess
4343 startSession ( { ignoreDuration : true } ) ;
4444 captureSession ( ) ;
4545
46- if ( mode === 'navigation ' ) {
46+ if ( lifecycle === 'route ' ) {
4747 // We want to create a session for every navigation as well
4848 addHistoryInstrumentationHandler ( ( { from, to } ) => {
4949 // Don't create an additional session for the initial route or if the location did not change
0 commit comments