
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@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 1,041,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.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.