javascript.json 2.8 KB

123456
  1. {
  2. "html": "<div class=\"section\" id=\"installation\">\n<h2>Installation</h2>\n<p>The easiest way to load Raven.js is to load it directly from our CDN. This script tag should\nbe included after other libraries are loaded, but before your main application code (e.g. app.js):</p>\n<div class=\"highlight-html\"><div class=\"highlight\" style=\"background: #ffffff\"><pre style=\"line-height: 125%\"><span></span><span style=\"color: #111111\">&lt;</span><span style=\"color: #2eb0f7\">script</span> <span style=\"color: #a47ac6\">src</span><span style=\"color: #4b4f5c\">=</span><span style=\"color: #e8535a\">&quot;https://cdn.ravenjs.com/3.20.1/raven.min.js&quot;</span> <span style=\"color: #a47ac6\">crossorigin</span><span style=\"color: #4b4f5c\">=</span><span style=\"color: #e8535a\">&quot;anonymous&quot;</span><span style=\"color: #111111\">&gt;&lt;/</span><span style=\"color: #2eb0f7\">script</span><span style=\"color: #111111\">&gt;</span>\n</pre></div>\n</div>\n<p>For installation using npm or other package managers, see <a class=\"reference internal\" href=\"https://docs.getsentry.com/clients/javascript/install/\"><em>Installation</em></a>.</p>\n</div>\n\n\n<div class=\"section\" id=\"configuring-the-client\">\n<h2>Configuring the Client</h2>\n<p>Next you need to configure Raven.js to use your <a class=\"reference external\" href=\"https://docs.sentry.io/clients/javascript/config/\">Sentry DSN</a>:</p>\n<div class=\"highlight-javascript\"><div class=\"highlight\" style=\"background: #ffffff\"><pre style=\"line-height: 125%\"><span></span><span style=\"color: #111111\">Raven.config(</span><span style=\"color: #e8535a\">&#39;___PUBLIC_DSN___&#39;</span><span style=\"color: #111111\">).install()</span>\n</pre></div>\n</div>\n<p>It is additionally recommended (but not required) to wrap your application start using <cite>Raven.context</cite>.\nThis can help surface additional errors in some execution contexts.</p>\n<div class=\"highlight-javascript\"><div class=\"highlight\" style=\"background: #ffffff\"><pre style=\"line-height: 125%\"><span></span><span style=\"color: #111111\">Raven.context(</span><span style=\"color: #2eb0f7\">function</span> <span style=\"color: #111111\">()</span> <span style=\"color: #111111\">{</span>\n <span style=\"color: #111111\">initMyApp();</span>\n<span style=\"color: #111111\">});</span>\n</pre></div>\n</div>\n<p>At this point, Raven is ready to capture any uncaught exception.</p>\n<p>Once you have Raven up and running, it is highly recommended to check out <a class=\"reference internal\" href=\"https://docs.getsentry.com/clients/javascript/config/\"><em>Configuration</em></a>\nand <a class=\"reference internal\" href=\"https://docs.getsentry.com/clients/javascript/usage/\"><em>Usage</em></a>.</p>\n</div>\n",
  3. "link": "https://docs.getsentry.com/clients/javascript/install/",
  4. "id": "javascript",
  5. "name": "JavaScript"
  6. }