Skip to content

Commit

Permalink
feat(electron): Disable sessions now autoSessionTracking has been r…
Browse files Browse the repository at this point in the history
…emoved (#12655)
  • Loading branch information
timfish authored Feb 20, 2025
1 parent c12b0fc commit 9cd7e5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ use the <PlatformLink
to="/configuration/integrations/browserwindowsession">BrowserWindowSession</PlatformLink>
integration in the renderer processes.

{/* TODO(v9): When electron does a new major, update this since autoSessionTracking got removed */}

Unless `autoSessionTracking` is set to `false`, this integration will be automatically added.
To disable sending sessions, filter the `MainProcessSession` from the default integrations:

```javascript
import * as Sentry from "@sentry/electron/main";

Sentry.init({
dsn: "___PUBLIC_DSN___",
autoSessionTracking: false,
integrations: (defaults) => defaults.filter((i) => i.name !== "MainProcessSession"),
});
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ Due to the nature of `crashed` and `abnormal` exits, these sessions are finished

To receive data on user adoption, such as users crash free rate percentage, and the number of users that have adopted a specific release, set the user on the [`initialScope`](/platforms/javascript/configuration/options/#initial-scope) when initializing the SDK.

{/* TODO(v9): When electron does a new major, update this since autoSessionTracking got removed */}

To disable sending sessions, set the `autoSessionTracking` flag to `false`:
To disable sending sessions, filter the `MainProcessSession` from the default integrations:

```javascript
import * as Sentry from "@sentry/electron/main";

Sentry.init({
autoSessionTracking: false, // default: true
dsn: "___PUBLIC_DSN___",
integrations: (defaults) => defaults.filter((i) => i.name !== "MainProcessSession"),
});
```

0 comments on commit 9cd7e5f

Please sign in to comment.