npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

electron-sentry-modtest

v1.1.3

Published

JavaScript and native crash reporting from Electron to Sentry

Readme

JavaScript and native crash reporting from Electron to Sentry

Breadcrumbs and JavaScript instrumentation for native crashes too!

Simply call ElectronSentry.start() as early as possible in the main AND renderer processes.

  • Starts the Electron native crashReporter in both processes and points it at the new Sentry.io minidump endpoint
  • Starts raven-js in the renderer process
    • Breadcrumbs and exceptions are passed to the main process. This means we can still report both if the renderer terminates due to a native crash.
    • Exception URLs are normalised to the app base so Sentry can group them correctly

      NOTE: This normalisation only works with asar packaged apps!

  • Starts raven-node in the main process
    • Hooks most app, BrowserWindow, webContents, screen and powerMonitor events and records breadcrumbs
    • Breadcrumbs from all processes are combined
    • If a render crashes due to a native exception, the native crash id is sent along with breadcrumbs so the two can be linked. Currently two errors are reported in Sentry and linking the two is manual.

TODO

  • Offline support
  • Spectron tests
  • Better multiple renderer support?
    • Means to identify identify renderers
    • Keep breadcrumbs from different renderer separate

Import it like this:

const { ElectronSentry } = require('electron-sentry');
// or
import { ElectronSentry } from 'electron-sentry';

If you don't supply any options, the sentry node in the root of your package.json is used. This can be your non-public DSN string or an options object (options and defaults at bottom).

ElectronSentry.start();
// or
ElectronSentry.start('https://xxxxxxx:[email protected]/xxxxx');
// or
ElectronSentry.start({
  dsn: 'https://xxxxxxx:[email protected]/xxxxx',
  native: false,
  // ...
});

There are some helpers available which check for, save and delete an empty file in userData to signify if reporting should be enabled or disabled. You can call these from either process but changes to the reporting state will not take effect until the app is restarted. This keeps things simple as the native reporter cannot be stopped once its started on Windows.

if (ElectronSentry.isEnabled()) {
  ElectronSentry.start();
}

// Disable error reporting, I don't like to help devs...
ElectronSentry.setEnabled(false);

Config & Defaults

import { app } from 'electron';

const defaults = {
  // Sentry non-public DSN
  // We need the non-public one for raven-node
  dsn: string = undefined,

  // productName || appName from package.json
  // https://electronjs.org/docs/api/app#appgetname
  appName: string = app.getName(),

  // Defaults to the same as appName
  companyName: string: app.getName(),

  // Start the native crash reporter
  native: boolean = true,

  // Used by Sentry to identify this release
  // It's common to use git hashes but for Electron the
  // app version makes more sense
  release: string = app.getVersion(),

  // Environment string passed to Sentry
  // process.defaultApp is undefined when the app is packaged
  environment: string = process.defaultApp == undefined
                          ? 'production'
                          : 'development'

  // Extra tags passed through the crash reporters
  // Only first level properties make it through the native crash reporter
  tags: any = undefined
};

Example configuration in package.json

{
  "name": "example-app",
  "displayName": "Example App",
  "version": "1.0.0",
  "sentry": {
    "dsn": "https://xxxxxxxxxxxxxxxxxxxxxxx:[email protected]/xxxxxx",
    "native": false
    ...
  },
  "dependencies": {
    "sentry-electron": "^1.0.0"
  }
}