Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,14 @@ Sentry.init({
integrations: [Sentry.browserSessionIntegration()],
});
```

## Configuration Options

<SdkOption name="lifecycle" type="'route' | 'page'" defaultValue="'route'" availableSince="10.39.0">

Controls how long one session lasts and when a new session is started.

- `'route'`: A new session is started when the route changes, based on the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API). This is the default behavior. If you're building a single-page application (SPA), this will result in one session being created per soft navigation.
- `'page'`: A new session is started when the page changes on a hard page reload or navigation. This is useful if you're building a single-page application (SPA) and want to track one session across multiple routes as users navigate through your application.

</SdkOption>