The Wayback Machine - https://web.archive.org/web/20190316232208/https://github.com/getsentry/sentry-electron
Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
The official Sentry SDK for Electron
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
example
scripts
src fix: tsc build Feb 26, 2019
test
.craft.yml
.gitignore ref: Migrate to Sentry SDK Core (#7) Feb 23, 2018
.npmignore build: Update sentry packages Mar 14, 2018
.prettierrc
.travis.yml ci: Cache electron download Nov 21, 2018
CHANGELOG.md meta: prepare 0.16.0 Feb 26, 2019
LICENSE license: Add Sentry copyright Mar 6, 2018
README.md
appveyor.yml feat: Add Windows and macOS CI (#23) Feb 28, 2018
package.json release: 0.16.0 Feb 26, 2019
tsconfig.build.json
tsconfig.json fix: Expose main/renderer for deep import (#148) Jan 11, 2019
tslint.json
yarn.lock meta: prepare 0.16.0 Feb 26, 2019

README.md


Official Sentry SDK for Electron (Beta)

Travis AppVeyor npm version license

deps deps dev deps peer

NOTE: This package is still in beta. It is part of an early access preview for the next generation of Sentry JavaScript SDKs. While we try to keep breaking changes to a minimum, interfaces might change between minor releases before the first stable 1.x release.

Features

  • Captures Node errors in the main process (using @sentry/node)
  • Captures JavaScript errors in renderer processes (using @sentry/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

Usage

To 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 processees you spawn. This will initialize the SDK and hook into the environment. Note that you can turn off almost all side effects using the respective options.

import { init } from '@sentry/electron';

init({
  dsn: '__DSN__',
  // ...
});

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';

// Set user information, as well as tags and further extras
Sentry.configureScope(scope => {
  scope.setExtra('battery', 0.7);
  scope.setTag('user_mode', 'admin');
  scope.setUser({ id: '4711' });
  // scope.clear();
});

// 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: [
    // ...
  ],
});

Deep Dive

Resources

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.