
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@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 241,474 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 10 open source maintainers 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
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.