BrowserWindowSession

Requires @sentry/electron version 4.11.0 or higher.

Captures sessions linked to the focus of Electron BrowserWindows. Capturing sessions makes it possible to show release health statistics in Sentry.

Adding this integration disables the MainProcessSession session integration.

Copied
import * as Sentry from "@sentry/electron";

Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  integrations: [new Sentry.Integrations.BrowserWindowSession()],
});

By default, sessions are ended when no window has had focus for 30 seconds. You can adjust this timeout via the backgroundTimeoutSeconds option:

Copied
import * as Sentry from "@sentry/electron";

Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  integrations: [
    new Sentry.Integrations.BrowserWindowSession({
      backgroundTimeoutSeconds: 120,
    }),
  ],
});
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").