Electron + Sentry: Monitoring your production app with sourcemaps

What is Sentry?

Actual Meaning

Technical Meaning

Why @sentry/electron?

How to add sentry to your electron app?

// sentryInit.jsconst { init } = (process.type === 'browser'
? require('@sentry/electron/dist/main')
: require('@sentry/electron/dist/renderer'))
init({dsn: '__DSN__'});
plugins: [
// main process
new webpack.DefinePlugin({
'process.type': '"browser"'
}),
// renderer process
new webpack.DefinePlugin({
'process.type': '"renderer"'
}),
]
// main.js
import 'sentryInit.js';
// background.renderer.js
import 'sentryInit.js';

Why we should add SourceMap to Sentry?

How to add SourceMap in your app?

$ sentry-cli releases files <release_name> upload-sourcemaps path/to/sourcemaps/and/min/files --url-prefix '/url-prefix'

What we do at Requestly

Setup redirects, modify headers, switch hosts, insert user scripts and much more. Install it on Chrome & Firefox and join our family of more than 100,000 devs!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store