Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v9] Use session storage for sessions #14478

Open
lforst opened this issue Nov 26, 2024 · 1 comment
Open

[v9] Use session storage for sessions #14478

lforst opened this issue Nov 26, 2024 · 1 comment
Labels
Feature: Sessions Package: browser Issues related to the Sentry Browser SDK

Comments

@lforst
Copy link
Member

lforst commented Nov 26, 2024

Description

Session updates we send from the Browser SDK should no longer be per pageview. They should have the same lifetime as a Session Replay session.

@AbhiPrasad AbhiPrasad added Package: browser Issues related to the Sentry Browser SDK Feature: Sessions labels Nov 28, 2024
@lforst lforst changed the title [v9] Update how sessions work in the browser [v9] Use session storage for sessions Dec 2, 2024
@lforst
Copy link
Member Author

lforst commented Dec 2, 2024

Strawman proposal: We add a sessioIntegration() with the following options:

interface SessionIntegrationOptions {
  /**
   * The storage type that the SDK uses to store a Session ID that is used for Sessions and Release Health in Sentry.
   * 
   * Possible values:
   * 
   * - `"sessionStorage"` (default) The Session ID is persisted to the browser's `sessionStorage`. Sessions will persist across hard-navigations on the same origin.
   * - `"memory"` The Session ID is stored in memory. Hard-navigations will produce new sessions.
   * 
   * Defaults to `"sessionStorage"`.
   */
  persistence?: 'sessionStorage' | 'memory'
}

The persistence name coincides with a similar/same option and behavior in Posthog. It's just a great name for this option: https://posthog.com/docs/libraries/js#persistence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Sessions Package: browser Issues related to the Sentry Browser SDK
Projects
None yet
Development

No branches or pull requests

2 participants