Configuration ============= We must first configure Sentry to allow certain hosts to report errors. This prevents abuse so somebody else couldn't start sending errors to your account from their site. **Note**: Without setting this, all messages will be rejected! This can be found under the *Project Details* page in Sentry. .. image:: https://i.imgur.com/S09MeSM.png Now need to set up Raven.js to use your Sentry DSN. .. code-block:: javascript Raven.config('https://public@getsentry.com/1').install() At this point, Raven is ready to capture any uncaught exception. Although, this technically works, this is not going to yield the greatest results. It's highly recommended to next check out :doc:`/usage/index`. Optional settings ~~~~~~~~~~~~~~~~~ ``Raven.config()`` can be passed an optional object for extra configuration. logger ------ The name of the logger used by Sentry. Default: ``javascript`` .. code-block:: javascript { logger: 'javascript' } release ------- Track the version of your application in Sentry. .. code-block:: javascript { release: '721e41770371db95eee98ca2707686226b993eda' } Can also be defined with ``Raven.setReleaseContext('721e41770371db95eee98ca2707686226b993eda')``. .. _config-whitelist-urls: tags ---- Additional `tags `__ to assign to each event. .. code-block:: javascript { tags: {git_commit: 'c0deb10c4'} } whitelistUrls ------------- The inverse of ``ignoreUrls``. Only report errors from whole urls matching a regex pattern or an exact string. ``whitelistUrls`` should match the url of your actual JavaScript files. It should match the url of your site if and only if you are inlining code inside `` TraceKit specific optional settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Usually there is no need to touch these settings, but they exist in case you need to tweak something. fetchContext ------------ Enable TraceKit to attempt to fetch source files to look up anonymous function names, this can be useful to enable if you don't get the context for some entries in the stack trace. Default value is ``false``. .. code-block:: javascript { fetchContext: true } linesOfContext -------------- The count of lines surrounding the error line that should be used as context in the stack trace, default value is ``11``. Only applicable when ``fetchContext` is enabled. .. code-block:: javascript { linesOfContext: 11 } collectWindowErrors ------------------- Enable or disable the TraceKit ``window.onerror`` handler, default value is ``true``. .. code-block:: javascript { collectWindowErrors: true }