@sentry/electron
Official Sentry SDK for capturing crashes, errors, and native crash reports in Electron applications
Repository Health
Technical Analysis
@sentry/electron is Sentry’s official SDK for Electron apps, instrumenting both the main and renderer processes to capture JavaScript exceptions, unhandled rejections, and — critically — native process crashes via Electron’s crashReporter and minidump upload pipeline. It wires together Sentry’s Node.js SDK in the main process with a browser-style SDK in the renderer, bridging events across Electron’s IPC boundary so a single Sentry project sees a unified stream of errors from every process.
Maintained directly by Sentry (getsentry), the SDK also supports Electron’s context-isolation and preload security model, and ships breadcrumbs for Electron-specific events like app lifecycle, window creation, and IPC calls, making it the standard way to add crash reporting to a production Electron desktop application.
What You Get
- Main-process and renderer-process SDK entry points (
@sentry/electron/main,@sentry/electron/renderer) that share one Sentry project - Native crash capture via Electron’s
crashReporter, uploading minidumps automatically on process crash - IPC-safe integration compatible with Electron’s
contextIsolationand preload-script security model - Electron-specific breadcrumbs for app lifecycle, window management, and IPC events
- Source-map support for both bundled main-process code and renderer web bundles
Common Use Cases
- Capturing unhandled exceptions and promise rejections across an Electron app’s main and renderer processes
- Collecting native crash reports (segfaults, out-of-memory kills) via minidump upload for desktop app stability monitoring
- Correlating errors from context-isolated renderer processes back to the main process in a single Sentry issue stream
- Instrumenting Electron Forge/Vite/webpack-based apps for production error monitoring, per the SDK’s bundled example projects
Under The Hood
Architecture
The SDK is split by Electron process boundary — src/main initializes Sentry in the main process and manages native crash-reporter wiring, src/renderer provides a browser-like client for renderer processes, src/preload bridges renderer error/breadcrumb data across IPC when context isolation is enabled, and src/common holds shared types/transport logic while src/native and src/utility handle native crash-dump collection and helper utilities respectively.
Tech Stack
TypeScript throughout, built on top of @sentry/node and @sentry/browser as underlying SDKs, targeting Electron’s multi-process model; ships both CommonJS and ESM builds (index.js / esm/) with full .d.ts type definitions, and includes six example projects (electron-forge, electron-vite, webpack context-isolation variants) demonstrating integration patterns.
Code Quality
The repository has both test/unit and test/e2e suites, the latter exercising real Electron app scenarios rather than just mocked units, which is notable given the complexity of cross-process crash capture; the codebase is actively maintained with frequent releases and clear separation of concerns by process type.
API Design
Initialization mirrors other Sentry SDKs (Sentry.init({ dsn: '...' })) called once per process, keeping the getting-started experience consistent with Sentry’s broader JS SDK family; supporting context-isolated Electron apps requires an extra preload-script wiring step, documented via the bundled examples, which adds some setup complexity beyond a single-process web SDK.
Used by 8 apps in this directory
AFFiNE
Collaboration · Note Taking · Productivity
Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.
agent-orchestrator
AI Agents · AI Code Assistants · Developer Tools
A local desktop workspace that gives every coding task its own agent, Git branch, and worktree, then tracks tasks, pull requests, CI, and reviews for 27 coding agents on one live Kanban board.
AionUi
AI Agents · Productivity
Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.
Cate
AI Code Assistants
A desktop IDE built on an infinite canvas — spread code editors, terminals, browsers, docs, and AI agents across freeform space instead of stacking windows and tabs, with layouts restored automatically.
Element Web
Collaboration · Team Chat
A polished, self-hostable Matrix client for secure, decentralized messaging and collaboration that puts your organization in full control of its data.
Joplin
Note Taking
The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.
Responsively App
Design Tools · Developer Tools
Preview and interact with your responsive web design across every device size simultaneously — no more manual resizing.
superset
AI Code Assistants · AI Development
Orchestrate an army of AI coding agents—Claude Code, Codex, Gemini CLI, and more—running simultaneously in isolated git worktrees from a single Electron desktop app.