CDN

Sentry supports loading its JavaScript SDK via a CDN. Generally we suggest using our npm package (@sentry/browser) as utilizing a CDN create scenarios where Sentry is unable to load due to networking issues or common extensions like ad blockers. If you must use a CDN, take a look at loading Sentry lazily with our JS loader.

Copied
<script
  src="https://browser.sentry-cdn.com/6.2.5/bundle.min.js"
  integrity="sha384-+0tgGyP4idWu9/NA6Jbmnj3SApxIg65/GR1zo3qSieRNyzmmDQ/5a1Yu6mfmUw+v"
  crossorigin="anonymous"
></script>

Performance Bundle

To use Sentry's performance tracing an alternative bundle is needed. This allows us to keep the filesize down for users who only need error monitoring.

Copied
<script
  src="https://browser.sentry-cdn.com/6.2.5/bundle.tracing.min.js"
  integrity="sha384-xd/W0P7puokZpoEqk4srLDzK5R0WV2B2IZVlA0T4MEU4Fojxk+o+5KF6u43wkTL6"
  crossorigin="anonymous"
></script>

The most important thing to note here is that Sentry.Integrations has been made available, and can be referenced in your call to Sentry.init:

Copied
Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  release: "my-project-name@" + process.env.npm_package_version,
  integrations: [new Sentry.Integrations.BrowserTracing()],

  // We recommend adjusting this value in production, or using tracesSampler
  // for finer control
  tracesSampleRate: 1.0,
});

Available Bundles

A variety of bundles are provided which are optimized for Sentry's various integrations.

FileIntegrity Checksum
angular.jssha384-8sZUm8Tqvr2JSpthJf0A8ybpqIqAcxgEIc87nebRhIhvnQbaCotvih8EpvoVLPhr
angular.min.jssha384-AKkPf7HOQW4gMqhYQM83lqT3eYqMwDGIIXfHFqsJUOtzOk6YeMIGl/sSMraKmQ7Z
bundle.es6.jssha384-phNmLtLk2DySbE61LdpdkJ2nG+UXYDe9jkIt6KRQu+1oi+AyAzx8zetxuOYc5ZAn
bundle.es6.min.jssha384-JFG0to+gv9tRtZpfb1N/q1CvRK3ugmXruQlvwPeaNJcB2hWm0WXR96KNeUFHInr3
bundle.jssha384-t4K7K1vpizSl4O+fQ4jBc6rdvRO5JzNmTyM8Npz1PwJfrU8bn7ZkFZ4VPFjUTiBy
bundle.min.jssha384-+0tgGyP4idWu9/NA6Jbmnj3SApxIg65/GR1zo3qSieRNyzmmDQ/5a1Yu6mfmUw+v
bundle.tracing.jssha384-ypqlO0yCVcd0AXCx6d0eVvC+qMuS7oq9MwFXNFAgyRbHXqEKJp12ylZW2tALGR+f
bundle.tracing.min.jssha384-xd/W0P7puokZpoEqk4srLDzK5R0WV2B2IZVlA0T4MEU4Fojxk+o+5KF6u43wkTL6
captureconsole.jssha384-r24Yfw1MgJLjPCH3sSBzTrbSg3jUHL2e1U7KZ2MlpjgaZoWvPc6Lp4e8oLz6/rSc
captureconsole.min.jssha384-rOil1zT4BvvpT69J8YdkDn5XMvdYsNNDwdFJra2aX62d+TPwgr9qBhdxOzGjrjne
debug.jssha384-bveFKIcyx9Z6aXDm2qeS/u3B/VoYOvUqHDeoGT2MwNKfvXt3M1jEVxWDmIStPhEH
debug.min.jssha384-h8BMdUl9U9pVRnrgY09Wp3Ek08jwom4ojs6FErMWZLAmrfzab83Fn/fa9fAoD9Gk
dedupe.jssha384-w30Nic/lP8/Lwg/nJr5WAydru2HshwlpwrbablyGtwy93SdrKOXBENhAbFar8U61
dedupe.min.jssha384-991Pgp/m4NC5gP7q/xzXphPFKPZI3iGG04gFtnoHlyH13gSiR/cQJVh+/5vjnULG
ember.jssha384-9vAjYqq7l3Fxq4dULYVVyKsKYkqL6NAk6pOL/BFZgArqu7qbcTNcxiU+L3c2iwue
ember.min.jssha384-EvjKq5FnEV0iOJfLXCKe5K5n6/7Qiyn8moH5pD62K7PJkcbYhUX7zLrqvkyNt5o9
extraerrordata.jssha384-lm6cT6iwXkNAOhM+KBG3kVd0U24jl9TYAmJL/Va+PpxGGx4cfAaeR6PIEufQMrlA
extraerrordata.min.jssha384-3ckAEIWMF1Dv336nW+RfdH89nUuQzEk3jUpxKMwZWtkS543Xtl9c6rcY0it9Ahbd
offline.jssha384-mbntm/GiBCU1dNJtQpTOgg4mx7wbKNOyESPq45qxDgEwiG0JE/HFPh/SQchnCqep
offline.min.jssha384-Sa8aIHjMKgM56LTRHw/tu2zxcCmBIoL+Tz+lWvxTFZe6LKFvQpch6fzlRlPyvj5I
reportingobserver.jssha384-Ibk9FIYI3FjrTh5vLrNhIbd38NatZ4UAaBW4NHFFMhW9hTzNezR9kzW5siyVWbZY
reportingobserver.min.jssha384-p1Q5N3xDXKf0+Dt0H6JZwPrh/m1Lqf4zPoF+0QG12oHWHWxTBq1rF8JqKnbD4JbJ
rewriteframes.jssha384-BjTehDODLT632jQUYqJ5rHNdbL0g0RDeaPjLWPJM4ukcBhUhtTl/wk062YgDNaei
rewriteframes.min.jssha384-s1pCwVB5uPJbIp8zX1y6s8W7Ar7Zm1JXkuubTcqg8FmBFdA2Nfkt2px+EBksqxGl
sessiontiming.jssha384-9srvADRpjm3FrmiK6dY0NGV4wnTG4dt8onLWUx6LRVN1xhtw+oRJnQ1LtKi4kqGB
sessiontiming.min.jssha384-yy0Jah9kyZt8VCnKVBxDj92pIC/E9XFkw5G6NXx2+0ZJbTBn83Y3X32KqAZxhF9b
transaction.jssha384-KN4xQF97K+t2Zgsqg8FiZE5++QLb0PCD4+v0k0ZVg6rl47vvmUIiSueozKB29Gu1
transaction.min.jssha384-p+n3NUtytg2Zgunyx5gQNdbZk7AieZyquN8nOaL7+hbqbe0SZomZIQJ5apsiXuLd
vue.jssha384-GD4V1uCI4vZgaDykyB2WTzjbIfvpBvP6brGsf7tCRecE0hr4JI3YLFtFFwliB6UW
vue.min.jssha384-yL0vqnQj1Cf3DxuidpDA2dGDXLqTKOGUALDeJcFOBmuF0cd/vajsGKoy63imGiMm

Additional Configuration

Using defer

If you include defer in your script your app, to make sure it can monitor everything that follows it. We strongly recommend that if you use defer, you both place the script tag for the browser SDK first and also mark it -- and all of your other scripts -- defer (but not async), guaranteeing that it’s executed before any of the others.

Without doing this you will find that it's possible for errors to occur before Sentry is loaded, which means you'll be flying blind to those issues.

Content Security Policy

If you have a Content Security Policy (CSP) set up on your site, you will need to add the script-src of wherever you're loading the SDK from, and the origin of your DSN. For example:

  • script-src: https://browser.sentry-cdn.com
  • connect-src: *.sentry.io
You can edit this page on GitHub.