Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Electron docs #211

Merged
merged 3 commits into from
Mar 13, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions design/less/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,13 @@ div.platform-node h1:before {
color: #2d292f;
}

li p.platformlink-electron a:first-child:before,
div.platform-electron h1:before {
content: "\e801";
background: #2b2e3b;
color: #9feaf9;
}

li p.platformlink-react-native a:first-child:before,
div.platform-react-native h1:before {
content: "\e801";
Expand Down
73 changes: 73 additions & 0 deletions docs/clients/electron/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
.. sentry:edition:: hosted, on-premise

.. class:: platform-electron

Electron
========

This is the documentation for the Electron SDK.
`Sentry Wizard <https://github.com/getsentry/sentry-wizard>`_ helps you with the correct
setup. Under the hood we use `raven-node <https://github.com/getsentry/raven-node>`_
and `raven-js <https://github.com/getsentry/raven-js>`_.

We also do support native crashes via Minidumps.

Installation
------------

All packages are available via npm.

.. code-block:: sh

$ npm install @sentry/electron --save

This will also install `@sentry/wizard`. Run the wizard the help you finish your setup:
With ``yarn`` you can just call:

.. code-block:: sh

$ yarn sentry-wizard --integration=electron

If you only have ``npm`` call:

.. code-block:: sh

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

``sentry-wizard`` will display recommended packages like `electron-download` which we need
to symbolicate native crashes.
The wizard will also create a file called ``sentry.properties`` (which does contain
you account information) and ``sentry-symbols.js`` which helps you with the symbols
upload.


Configuring the Client
----------------------

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

.. code-block:: javascript

const { SentryClient } = require('@sentry/electron');

SentryClient.create({
dsn: '___PRIVATE_DSN___',
// ...
});

This configuration will also take care of unhandled Promise rejections, which can be
handled in various ways. By default, Electron uses the standard JS API.
To learn more about handling promises, refer to :ref:`raven-js-promises` documentation.

Uploading symbols
~~~~~~~~~~~~~~~~~

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

.. code-block:: sh

$ node sentry-symbols.js
3 changes: 3 additions & 0 deletions docs/clients/electron/sentry-doc-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"support_level": "production"
}
1 change: 1 addition & 0 deletions docs/clients/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ discussion about supporting it on our `community forum <https://forum.sentry.io>
java/index
javascript/index
node/index
electron/index
react-native/index
perl/index
php/index
Expand Down
8 changes: 6 additions & 2 deletions docs/clients/table.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@

* .. class:: platformlink-js

:doc:`/clients/javascript/index` Including React, Angular, Electron, Ember, Vue, and Backbone.
:doc:`/clients/javascript/index` Including React, Angular, Ember, Vue, and Backbone.

* .. class:: platformlink-node

:doc:`/clients/node/index` Including Express, Koa, Loopback, Sails and Connect.

* .. class:: platformlink-electron

:doc:`/clients/electron/index` For Electron apps.

* .. class:: platformlink-react-native

:doc:`/clients/react-native/index` For iOS and Android.
Expand Down Expand Up @@ -50,4 +54,4 @@

* .. class:: platformlink-cordova

:doc:`/clients/cordova/index` Including Ionic.
:doc:`/clients/cordova/index` Including Ionic.