
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
@sentry/electron
Advanced tools
@sentry/node)@sentry/browser)electron >= v23To use this SDK, call init(options) as early as possible in the entry modules in the main process as well as all
renderer processes or further sub processes you spawn. This will initialize the SDK and hook the environment.
In the Electron main process:
import { init } from '@sentry/electron/main';
init({
dsn: '__DSN__',
// ...
});
In all Electron renderer processes:
// In the Electron renderer processes
import { init } from '@sentry/electron/renderer';
init();
If you are using a framework specific Sentry SDK, you can pass that init function as the second parameter in the
renderer and the two SDKs functionalities will be combined:
import { init } from '@sentry/electron/renderer';
import { init as reactInit } from '@sentry/react';
init(
{
/* config */
},
reactInit,
);
To set context information or send manual events, use the exported functions of @sentry/electron. Note that these
functions will not perform any action before you have called init():
import * as Sentry from '@sentry/electron/main';
// Set user information, as well as tags and further extras
const scope = Sentry.getCurrentScope();
scope.setExtra('battery', 0.7);
scope.setTag('user_mode', 'admin');
scope.setUser({ id: '4711' });
// Add a breadcrumb for future events
Sentry.addBreadcrumb({
message: 'My Breadcrumb',
// ...
});
// Capture exceptions, messages or manual events
Sentry.captureMessage('Hello, world!');
Sentry.captureException(new Error('Good bye'));
Sentry.captureEvent({
message: 'Manual',
stacktrace: [
// ...
],
});
Thanks to everyone who contributed to the Sentry Electron SDK!
electron-log is a package for logging in Electron applications. Unlike @sentry/electron, it focuses on logging messages to files, console, and remote endpoints without providing error tracking or performance monitoring capabilities.
Winston is a versatile logging library for Node.js applications, including Electron. It provides logging capabilities but lacks the integrated error tracking and performance monitoring features of @sentry/electron.
log4js is another logging library for Node.js that can be used in Electron applications. It offers logging features similar to winston but does not include the error tracking and performance monitoring functionalities of @sentry/electron.
FAQs
Official Sentry SDK for Electron
The npm package @sentry/electron receives a total of 482,521 weekly downloads. As such, @sentry/electron popularity was classified as popular.
We found that @sentry/electron demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.