Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
65d9d16
feat!: vNext
timfish Aug 19, 2026
8a919ba
Oopsie
timfish Aug 19, 2026
be8bf1b
Update to `alpha.1`
timfish Aug 20, 2026
4fc7f03
feat: Update Sentry SDKs to v11.0.0-alpha.2
claude Aug 31, 2026
40fc6b7
test: Update browser pageload segment name for v11 SDK
claude Aug 31, 2026
a7b791f
refactor: Rename integration `captureLogs` option to `logs`
claude Sep 1, 2026
6ecd927
Merge branch 'master' into feat/vNext
claude Sep 1, 2026
87c7956
Merge remote-tracking branch 'origin/master' into feat/vNext
claude Sep 1, 2026
04af5a3
feat!: Raise minimum supported Electron to v35
claude Sep 1, 2026
3def511
feat: Update Sentry SDKs to v11.0.0-beta.1
timfish Sep 8, 2026
f441f62
Merge branch 'master' into feat/vNext
timfish Sep 8, 2026
c5ba14d
ci: allow-list electron devDependency advisories in dependency-review
timfish Sep 8, 2026
564d3dd
feat: Update Sentry SDKs to v11.0.0-rc.0
timfish Sep 16, 2026
2896750
refactor: Drop pre-Electron-35 fallbacks in electron-normalize
timfish Sep 17, 2026
8cb2cf5
refactor: Drop dead pre-Electron-35 version gates
timfish Sep 17, 2026
34769d6
Merge branch 'master' into feat/vNext
timfish Sep 17, 2026
d05c517
fix(ci): bump transitive nanoid to 3.3.18 to clear dependency-review
timfish Sep 17, 2026
6fb72d0
Merge branch 'master' into feat/vNext
timfish Sep 21, 2026
992be5c
feat: Update Sentry SDKs to v11.0.0-rc.1
timfish Sep 22, 2026
61fbe81
feat: Update Sentry SDKs to v11.0.0
timfish Sep 23, 2026
7e280c6
Merge branch 'master' into feat/vNext
timfish Sep 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/dependency-review-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Configuration for the org-level dependency-review workflow.
#
# electron is a devDependency only (used to build and test the SDK, it is never
# shipped to consumers) so these Electron advisories do not affect downstream
# apps, which pin their own Electron version. They are flagged against the floor
# of our supported range (35.7.5); newer Electron versions we test against are
# patched.
fail-on-severity: 'high'
allow-ghsas:
- GHSA-v3j7-r9gq-3gjw # Electron: custom protocol supportFetchAPI cross-origin reads
- GHSA-9wfr-w7mm-pc7f # Electron: renderer command-line switch injection
- GHSA-jjp3-mq3x-295m # Electron: use-after-free in PowerMonitor
- GHSA-8337-3p73-46f4 # Electron: use-after-free in WebContents permission callbacks
- GHSA-h7rp-cf8h-j98x # Electron: context isolation bypass via Function.prototype.bind
- GHSA-532v-xpq5-8h95 # Electron: use-after-free in offscreen paint callback
- GHSA-9f4c-93c8-jc8g # Electron: sandboxed iframe allow-popups bypass
8 changes: 8 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
This document details the changes between major versions of the Sentry Electron
SDK.

- [Upgrading from 7.x to 8.x](#upgrading-from-7x-to-8x)
- [Upgrading from 6.x to 7.x](#upgrading-from-6x-to-7x)
- [Upgrading from 5.x to 6.x](#upgrading-from-5x-to-6x)
- [Upgrading from 4.x to 5.x](#upgrading-from-4x-to-5x)

# Upgrading from 7.x to 8.x

## Supported Electron Versions

The Sentry Node SDK now requires Node >= 20.19.0 which means the Sentry Electron
SDK now supports Electron >= 35.0.0.

# Upgrading from 6.x to 7.x

Most users won't notice many breaking API changes in v7 but it's worth checking
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Test](https://github.com/getsentry/sentry-electron/actions/workflows/build.yml/b
[`@sentry/browser`](https://github.com/getsentry/sentry-javascript/tree/master/packages/browser))
- Captures **native crashes** (Minidump crash reports) from renderers and the main process
- Collects **breadcrumbs and context** information along with events across renderers and the main process
- Supports `electron >= v23`
- Supports `electron >= v35`

## Usage

Expand Down
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,14 @@
"e2e": "xvfb-maybe vitest run --root=./test/e2e --silent=false --disable-console-intercept"
},
"dependencies": {
"@sentry/browser": "10.75.0",
"@sentry/conventions": "^0.16.0",
"@sentry/core": "10.75.0",
"@sentry/node": "10.75.0"
"@sentry/browser": "11.0.0",
"@sentry/conventions": "^0.23.0",
"@sentry/core": "11.0.0",
"@sentry/node": "11.0.0",
"@sentry/server-utils": "11.0.0"
},
"peerDependencies": {
"@sentry/node-native": "10.75.0"
"@sentry/node-native": "11.0.0"
},
"peerDependenciesMeta": {
"@sentry/node-native": {
Expand All @@ -120,14 +121,14 @@
},
"devDependencies": {
"@rollup/plugin-typescript": "^12.1.3",
"@sentry/eslint-plugin-sdk": "10.75.0",
"@sentry/node-native": "10.75.0",
"@sentry/eslint-plugin-sdk": "11.0.0",
"@sentry/node-native": "11.0.0",
"@types/busboy": "^1.5.4",
"@types/koa": "^2.0.52",
"@types/koa-bodyparser": "^4.3.0",
"@types/tmp": "^0.2.2",
"busboy": "^1.6.0",
"electron": "^25.9.8",
"electron": "^35.7.5",
"extract-zip": "^2.0.1",
"koa": "^3.0.1",
"koa-bodyparser": "^4.3.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-electron-versions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const result = spawnSync('npm', ['view', 'electron', 'dist-tags', '--json'], { e
const allTags = JSON.parse(result.stdout);

const versions = [];
let startVersion = 23;
let startVersion = 35;

while (true) {
const versionTag = `${startVersion}-x-y`;
Expand Down
70 changes: 10 additions & 60 deletions src/main/electron-normalize.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import { parseSemver } from '@sentry/core';
import type { Session } from 'electron';
import { app } from 'electron';
import { join } from 'path';
import { RENDERER_ID_HEADER } from '../common/ipc.js';

const parsed = parseSemver(process.versions.electron);
const version = { major: parsed.major || 0, minor: parsed.minor || 0, patch: parsed.patch || 0 };

export const ELECTRON_MAJOR_VERSION = version.major;

export const EXIT_REASONS = [
'clean-exit',
'abnormal-exit',
Expand All @@ -26,13 +20,6 @@ export function getSentryCachePath(): string {
return join(app.getPath('userData'), 'sentry');
}

/**
* Electron >= 25 support `protocol.handle`
*/
function supportsProtocolHandle(): boolean {
return version.major >= 25;
}

interface InternalRequest {
windowId?: string;
url: string;
Expand All @@ -42,64 +29,27 @@ interface InternalRequest {
/**
* Registers a custom protocol to receive events from the renderer
*
* Uses `protocol.handle` if available, otherwise falls back to `protocol.registerStringProtocol`
*
* The response body is whatever the callback resolves with, or empty
*/
export function registerProtocol(
protocol: Electron.Protocol,
scheme: string,
callback: (request: InternalRequest) => Promise<string | void>,
): void {
if (supportsProtocolHandle()) {
protocol.handle(scheme, async (request) => {
const body = await callback({
windowId: request.headers.get(RENDERER_ID_HEADER) || undefined,
url: request.url,
body: Buffer.from(await request.arrayBuffer()),
});

return new Response(body || '');
});
} else {
// TODO: Remove this branch when the minimum supported Electron version is v25
// eslint-disable-next-line deprecation/deprecation
protocol.registerStringProtocol(scheme, (request, complete) => {
callback({
windowId: request.headers[RENDERER_ID_HEADER],
url: request.url,
body: request.uploadData?.[0]?.bytes,
}).then(
(body) => complete(body || ''),
() => complete(''),
);
protocol.handle(scheme, async (request) => {
const body = await callback({
windowId: request.headers.get(RENDERER_ID_HEADER) || undefined,
url: request.url,
body: Buffer.from(await request.arrayBuffer()),
});
}
}

type PreloadScriptRegistration = {
// Context type where the preload script will be executed.
type: 'frame' | 'service-worker';
// Unique ID of preload script. Defaults to a random UUID.
id?: string;
// Path of the script file. Must be an absolute path.
filePath: string;
};

type SessionMaybeSupportingRegisterPreloadScript = Session & {
registerPreloadScript?: (script: PreloadScriptRegistration) => void;
};
return new Response(body || '');
});
}

/**
* Adds a preload script to the session.
*
* Electron >= v35 supports new `registerPreloadScript` method and `getPreloads` and `setPreloads` are deprecated.
*/
export function setPreload(sesh: SessionMaybeSupportingRegisterPreloadScript, path: string): void {
if (sesh.registerPreloadScript) {
sesh.registerPreloadScript({ type: 'frame', filePath: path });
} else {
const existing = sesh.getPreloads();
sesh.setPreloads([path, ...existing]);
}
export function setPreload(sesh: Session, path: string): void {
sesh.registerPreloadScript({ type: 'frame', filePath: path });
}
33 changes: 17 additions & 16 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export {
addIntegration,
amqplibIntegration,
anthropicAIIntegration,
applyDiagnosticsChannelInjectionIntegrations,
bindScopeToEmitter,
buildLaunchDarklyFlagUsedHandler,
captureCheckIn,
Expand All @@ -33,21 +32,23 @@ export {
captureMessage,
captureSession,
close,
connectIntegration,
consoleIntegration,
consoleLoggingIntegration,
contextLinesIntegration,
continueTrace,
createConsolaReporter,
createFlueInstrumentation,
createGetModuleFromFilename,
createLangChainCallbackHandler,
createSentryWinstonTransport,
createTransport,
cron,
dataloaderIntegration,
dedupeIntegration,
diagnosticsChannelInjectionIntegrations,
endSession,
eveConversationHook,
eveInstrumentation,
eveIntegration,
eventFiltersIntegration,
expressErrorHandler,
expressIntegration,
Expand All @@ -58,14 +59,15 @@ export {
flush,
fsIntegration,
functionToStringIntegration,
generateInstrumentOnce,
genericPoolIntegration,
getActiveSpan,
getAutoPerformanceIntegrations,
getClient,
getCurrentScope,
getGlobalScope,
getInstrumentedModuleNames,
getIsolationScope,
getOtlpTracesEndpoint,
getRootSpan,
getSpanDescendants,
getSpanStatusFromHttpCode,
Expand All @@ -74,24 +76,21 @@ export {
googleGenAIIntegration,
growthbookIntegration,
graphqlIntegration,
groqIntegration,
hapiIntegration,
honoIntegration,
httpHeadersToSpanAttributes,
httpIntegration,
httpServerIntegration,
httpServerSpansIntegration,
// eslint-disable-next-line deprecation/deprecation
inboundFiltersIntegration,
initOpenTelemetry,
instrumentAnthropicAiClient,
instrumentGoogleGenAIClient,
instrumentLangChainEmbeddings,
instrumentLangGraph,
instrumentMistralAiClient,
instrumentOpenAiClient,
instrumentStateGraph,
instrumentStateGraphCompile,
instrumentSupabaseClient,
isDiagnosticsChannelInjectionEnabled,
isEnabled,
isInitialized,
kafkaIntegration,
Expand All @@ -105,7 +104,9 @@ export {
localVariablesIntegration,
logger,
lruMemoizerIntegration,
mastraIntegration,
metrics,
mistralAIIntegration,
modulesIntegration,
mongoIntegration,
mongooseIntegration,
Expand All @@ -119,6 +120,7 @@ export {
openAIIntegration,
OpenFeatureIntegrationHook,
openFeatureIntegration,
openTelemetryIntegration,
parameterize,
pinoIntegration,
postgresIntegration,
Expand All @@ -129,11 +131,10 @@ export {
requestDataIntegration,
rewriteFramesIntegration,
Scope,
SentryMastraExporter,
SEMANTIC_ATTRIBUTE_SENTRY_OP,
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
SentryContextManager,
setAttribute,
setAttributes,
setConversationId,
Expand All @@ -143,19 +144,18 @@ export {
setExtras,
setHttpStatus,
setMeasurement,
setNodeAsyncContextStrategy,
setOpenTelemetryContextAsyncContextStrategy,
setTag,
setTags,
setupConnectErrorHandler,
setupExpressErrorHandler,
setupFastifyErrorHandler,
setupHapiErrorHandler,
setupHonoErrorHandler,
setupKoaErrorHandler,
setUser,
spanStreamingIntegration,
spanToBaggageHeader,
spanToJSON,
spanToStaticSpanJSON,
spanToTraceHeader,
spotlightIntegration,
startInactiveSpan,
Expand All @@ -168,17 +168,18 @@ export {
suppressTracing,
systemErrorIntegration,
tediousIntegration,
togetherAIIntegration,
trpcMiddleware,
unleashIntegration,
updateSpanName,
experimentalUseDiagnosticsChannelInjection,
validateOpenTelemetrySetup,
winterCGHeadersToDict,
withActiveSpan,
withIsolationScope,
withMonitor,
withScope,
withStaticSpan,
withStreamedSpan,
workerThreadsIntegration,
wrapMcpServerWithSentry,
zodErrorsIntegration,
} from '@sentry/node';
Expand Down
Loading
Loading