From db1e08be3f7ebd9d2445f6e570922f4c432a3d98 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Sat, 28 Mar 2026 21:35:57 +0100 Subject: [PATCH 1/2] fix(electron): Detail main process only options --- .../javascript/common/configuration/options.mdx | 15 +++++++++++++-- .../electron/configuration/environments.mdx | 15 --------------- 2 files changed, 13 insertions(+), 17 deletions(-) delete mode 100644 docs/platforms/javascript/guides/electron/configuration/environments.mdx diff --git a/docs/platforms/javascript/common/configuration/options.mdx b/docs/platforms/javascript/common/configuration/options.mdx index 9761465d6983a..74735250924f5 100644 --- a/docs/platforms/javascript/common/configuration/options.mdx +++ b/docs/platforms/javascript/common/configuration/options.mdx @@ -12,6 +12,10 @@ sidebar_order: 1 ## Core Options + + **Note:** Electron `main` process only. + + The DSN tells the SDK where to send the events. If this is not set, the SDK will not send any events. Learn more about [DSN utilization](/product/sentry-basics/dsn-explainer/#dsn-utilization). @@ -36,6 +40,9 @@ Turns debug mode on or off. If debug is enabled SDK will attempt to print out us + + **Note:** Electron `main` process only. + Sets the release. Release names are strings, but some formats are detected by Sentry and might be rendered differently. Learn more about how to send release data so Sentry can tell you about regressions between releases and identify the potential source in [the releases documentation](/product/releases/) or the sandbox. @@ -57,6 +64,9 @@ Sets the release. Release names are strings, but some formats are detected by Se + + **Note:** Electron `main` process only. + Sets the environment. Defaults to `development` or `production` depending on whether the application is packaged. @@ -249,8 +259,8 @@ Options used to configure the transport. This is an object with the following po The Electron SDK provides built-in offline support that queues events when the app is offline and automatically sends them once the connection is restored. These options let you configure the following behavior: -- `maxAgeDays`: The maximum number of envelopes to keep in the queue. -- `maxQueueSize`: The maximum number of days to keep an envelope in the queue. +- `maxAgeDays`: The maximum number of days to keep an envelope in the queue. +- `maxQueueSize`: The maximum number of envelopes to keep in the queue. - `flushAtStartup`: Whether the offline store should flush shortly after application startup. Defaults to `false`. - `shouldSend`: Called before the SDK attempts to send an envelope to Sentry. If this function returns false, `shouldStore` will be called to determine if the envelope should be stored. Defaults to `() => true`. - `shouldStore`: Called before an event is stored. Return `false` to drop the envelope rather than store it. Defaults to `() => true`. @@ -283,6 +293,7 @@ This means the SDK detected that the library hasn't been wrapped for automatic p +**Note:** Electron `main` process only. Inter-process communication mode to receive event and scope updates from renderer processes. diff --git a/docs/platforms/javascript/guides/electron/configuration/environments.mdx b/docs/platforms/javascript/guides/electron/configuration/environments.mdx deleted file mode 100644 index 91b7cd1da2943..0000000000000 --- a/docs/platforms/javascript/guides/electron/configuration/environments.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: Environments -sidebar_order: 5 -description: "Learn how to configure your SDK to tell Sentry about your environments." ---- - -Sentry automatically creates environments when it receives an event with the environment tag. Environments are case-sensitive. The environment name can't contain newlines, spaces or forward slashes, can't be the string "None", or exceed 64 characters. You can't delete environments, but you can [hide](/product/sentry-basics/environments/#hidden-environments) them. - -The Electron SDK automatically sets the `environment` to `development` or `production` depending on whether the application is packaged. - -You can override this default for other environments: - - - -Environments help you better filter issues, releases, and user feedback in the Issue Details page of sentry.io, which you learn more about in our [documentation that covers using environments](/product/sentry-basics/environments/). From d32e203fabbb55fc874cc60adc3f5804a98c5421 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Sun, 5 Apr 2026 15:02:49 +0200 Subject: [PATCH 2/2] More Electron specific options details --- .../common/configuration/options.mdx | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/docs/platforms/javascript/common/configuration/options.mdx b/docs/platforms/javascript/common/configuration/options.mdx index 74735250924f5..640605fb770f7 100644 --- a/docs/platforms/javascript/common/configuration/options.mdx +++ b/docs/platforms/javascript/common/configuration/options.mdx @@ -98,6 +98,10 @@ This variable controls the total amount of breadcrumbs that should be captured. + + Enabled per Electron process. + + When enabled, stack traces are automatically attached to all messages logged. Stack traces are always attached to exceptions; however, when this option is set, stack traces are also sent with messages. This option, for instance, means that stack traces appear next to all messages captured with `Sentry.captureMessage()`. Grouping in Sentry is different for events with stack traces and without. As a result, you will get new groups as you enable or disable this flag for certain events. @@ -115,12 +119,17 @@ Most SDKs will attempt to auto-discover this value. +**Note:** Electron `main` process only. + When not set to `false`, the SDK tracks sessions linked to the lifetime of the Electron main process. + + **Note:** Electron `main` process only. + Data to be set to the initial scope. Initial scope can be defined either as an object or a callback function, as shown below. @@ -206,6 +215,10 @@ See + + Controls breadcrumb capture in the Electron process where callback is set. + + This function is called with a breadcrumb object before the breadcrumb is added to the scope. When nothing is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the first argument, which contains the breadcrumb object. The callback gets a second argument (called a "hint") which contains the original object from which the breadcrumb was created to further customize what the breadcrumb should look like. @@ -213,7 +226,9 @@ The callback gets a second argument (called a "hint") which contains the origina -The JavaScript SDK uses a transport to send events to Sentry. On modern browsers, most transports use the browsers' fetch API to send events. Transports will drop an event if it fails to send due to a lack of connection. + + The JavaScript SDK uses a transport to send events to Sentry. On modern browsers, most transports use the browsers' fetch API to send events. Transports will drop an event if it fails to send due to a lack of connection. + In the browser, a `fetch`-based transport is used by default. @@ -223,6 +238,10 @@ The JavaScript SDK uses a transport to send events to Sentry. On modern browsers On the server, a `https`-based transport is used by default. + + In the Electron `main` process, the default transport handles queuing events when the users device is offline. In Electron `renderer` processes, the default transport forwards events to the main process. + + @@ -342,6 +361,10 @@ If the callback is not set, or it returns `undefined`, the default naming scheme Configures the sample rate for error events, in the range of `0.0` to `1.0`. The default is `1.0`, which means that 100% of error events will be sent. If set to `0.1`, only 10% of error events will be sent. Events are picked randomly. + + In the Electron `main` process `sampleRate` applies to events captured all processes. In Electron `renderer` processes, the `sampleRate` only applies to that process. + + @@ -350,6 +373,10 @@ This function is called with an SDK-specific message or error event object, and By the time `beforeSend` is executed, all scope data has already been applied to the event. Further modification of the scope won't have any effect. + + In the Electron `main` process `beforeSend` is called for events captured in all processes. In Electron `renderer` processes, `beforeSend` only applies to that process. + + @@ -368,6 +395,10 @@ Available options: + + In the Electron `main` process `ignoreErrors` applies to events captured in all processes. In Electron `renderer` processes, `ignoreErrors` applies only to that process. + + @@ -404,6 +435,10 @@ For example, the Sentry Nuxt SDK does not attach an error handler as it's captur ## Tracing Options + + **Note:** For Electron, tracing options apply to the process where these options are set. + + A number between `0` and `1`, controlling the percentage chance a given transaction will be sent to Sentry. (`0` represents 0% while `1` represents 100%.) Applies equally to all transactions created in the app. Either this or `tracesSampler` must be defined to enable tracing. @@ -539,6 +574,10 @@ See De ## Logs Options + + **Note:** For Electron, log options apply to the process where these options are set. + + Set this option to `true` to enable log capturing in Sentry. Only when this is enabled will the `logger` APIs actually send logs to Sentry.