Skip to content

Commit 9cd7e5f

Browse files
authored
feat(electron): Disable sessions now autoSessionTracking has been removed (#12655)
1 parent c12b0fc commit 9cd7e5f

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

docs/platforms/javascript/guides/electron/configuration/integrations/mainprocesssession.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@ use the <PlatformLink
1212
to="/configuration/integrations/browserwindowsession">BrowserWindowSession</PlatformLink>
1313
integration in the renderer processes.
1414

15-
{/* TODO(v9): When electron does a new major, update this since autoSessionTracking got removed */}
16-
17-
Unless `autoSessionTracking` is set to `false`, this integration will be automatically added.
15+
To disable sending sessions, filter the `MainProcessSession` from the default integrations:
1816

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

2220
Sentry.init({
2321
dsn: "___PUBLIC_DSN___",
24-
autoSessionTracking: false,
22+
integrations: (defaults) => defaults.filter((i) => i.name !== "MainProcessSession"),
2523
});
2624
```
2725

platform-includes/configuration/auto-session-tracking/javascript.electron.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ Due to the nature of `crashed` and `abnormal` exits, these sessions are finished
1010

1111
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.
1212

13-
{/* TODO(v9): When electron does a new major, update this since autoSessionTracking got removed */}
14-
15-
To disable sending sessions, set the `autoSessionTracking` flag to `false`:
13+
To disable sending sessions, filter the `MainProcessSession` from the default integrations:
1614

1715
```javascript
16+
import * as Sentry from "@sentry/electron/main";
17+
1818
Sentry.init({
19-
autoSessionTracking: false, // default: true
19+
dsn: "___PUBLIC_DSN___",
20+
integrations: (defaults) => defaults.filter((i) => i.name !== "MainProcessSession"),
2021
});
2122
```

0 commit comments

Comments
 (0)