{ "html": "
\n

Installation

\n

All packages are available via npm.

\n
$ npm install @sentry/electron --save\n$ npm install @sentry/wizard --save-dev\n
\n
\n

Run the wizard to help you finish your setup:\nWith yarn you can just call:

\n
$ yarn sentry-wizard --integration=electron\n
\n
\n

If you only have npm call:

\n
$ node node_modules/.bin/sentry-wizard --integration=electron\n
\n
\n

sentry-wizard will display recommended packages like electron-download which we need\nto symbolicate native crashes.\nThe wizard will also create a file called sentry.properties (which contains\nyour account information) and sentry-symbols.js which helps you with the symbol\nupload.

\n
\n\n\n
\n

Configuring the Client

\n

The following code should reside in the main process and all renderer processes:

\n
const { SentryClient } = require('@sentry/electron');\n\nSentryClient.create({\n  dsn: '___PRIVATE_DSN___',\n  // ...\n});\n
\n
\n

This configuration will also take care of unhandled Promise rejections, which can be\nhandled in various ways. By default, Electron uses the standard JS API.\nTo learn more about handling promises, refer to Promises documentation.

\n
\n

Uploading symbols

\n

The wizard should create a file called sentry-symbols.js which takes care of uploading\ndebug symbols to Sentry. Note that this is only necessary whenever you update your\nversion of electron. It usually takes quiet a while because it downloads debug symbols\nof electron and uploads them to Sentry so we can symbolicate your native crashes.\nYou can always execute the script by calling:

\n
$ node sentry-symbols.js\n
\n
\n
\n
\n", "link": "https://docs.getsentry.com/platforms/javascript/guides/electron/", "id": "javascript-electron", "name": "Electron" }