CDN

Sentry supports loading it's 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/5.25.0/bundle.min.js"
  integrity="sha384-2p7fXoWSRPG49ZgmmJlTEI/01BY1LgxCNFQFiWpImAERmS/bROOQm+cJMdq/kmWS"
  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/5.25.0/bundle.tracing.min.js"
  integrity="sha384-MxPEqyePOMqaz3prq1TexMEXtfnxqvet9uhebPAm5SI4Pz3Ga9HwbmE5FY2Bah20"
  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-SNhVmGBfEogNuvLH6gTpL2NLxEB0G+eiCCspXYweVrUlIFL5YXqfGNxHZv8OT6Zk
angular.min.jssha384-GeYI8l+CNFIhNiXyebqMrEKZWkPnlonSxVDdOwZ6TxZdGKtOHJ6nWqKdDoPepxnZ
bundle.apm.jssha384-xyBIMU+CGxaJ2DTHBbbPzBC9XV+CMr1oCpL5C19Rhv05QSOXcfcYP91ra2pe1cqZ
bundle.apm.min.jssha384-z9ZCcp/kQxmEIed6seCD6NjNQ/y3bbocFpzsbYY1uBZyrQCN6uW+NJrIYBH3CRWg
bundle.es6.jssha384-iaf5/oo1/EAkqoa+QXg9brSx5H6BRIInPByvon6w+KM1OSPT+40y49tbGfw8g0yX
bundle.es6.min.jssha384-hkwF8uNuWxp222vkQQyQsLKwSz/v/SRtfePmH0clVFwqLuxWcaKlWnQtJXegxQaR
bundle.jssha384-Rps3ZsNOOzIXwYrVu5fuRGL1tLXHl8+0QeJD1VTH6dOy/UZrbJRe6eTUasroskGc
bundle.min.jssha384-2p7fXoWSRPG49ZgmmJlTEI/01BY1LgxCNFQFiWpImAERmS/bROOQm+cJMdq/kmWS
bundle.tracing.jssha384-LLknJNY7CsZFOsOil7YJfyH3tVVHQayrGyl1NlVvioPAZCnpJOThDVIp2FMmAlfg
bundle.tracing.min.jssha384-MxPEqyePOMqaz3prq1TexMEXtfnxqvet9uhebPAm5SI4Pz3Ga9HwbmE5FY2Bah20
captureconsole.jssha384-LQAi1o6iXXJtIAMkccoO09jbCkDuqrVYddox64evlBkNjeIHLxi+kfMoQweJj4Kl
captureconsole.min.jssha384-23IGo+A1GZEPY5w2XxdwoqCrxFTdSyLbqEaRrFEDgX/pByb3Um11dHN2V54ICA3T
debug.jssha384-CzFfkxQdU/85sLu1YXX2lWrZU/pJEkSB7qiwkIwFwHQn/+dWp9Qz8YADcVNlwpUY
debug.min.jssha384-gfwqW2T9/pJzXG5kGMjh219m8NxYr4sFdNEmk8Kcmm03LLR3e7u0MUCJtF+BvwlA
dedupe.jssha384-w30Nic/lP8/Lwg/nJr5WAydru2HshwlpwrbablyGtwy93SdrKOXBENhAbFar8U61
dedupe.min.jssha384-991Pgp/m4NC5gP7q/xzXphPFKPZI3iGG04gFtnoHlyH13gSiR/cQJVh+/5vjnULG
ember.jssha384-uIwfFqGm1HIvIFAzmFi7+254jT3en0RDGQBep5yjZlUM5m5+wkxlV3iwtxbRSiDL
ember.min.jssha384-AoDWDCFzGgUlcjpTPIOucLHY0TcDkJISfQTounFvJC9id+SLfT+LMV/omYXeSxtk
extraerrordata.jssha384-gjKqgV48X/Nk5NZjF1bMDFCzfTU7xV3QlkmIARCandpzOqhT4amXWzEklWTXqdzi
extraerrordata.min.jssha384-4FyWD6sRoHviXGGNjFNK3IoFDpXdu3ebnmUYBSfxZ+rKiHmjyLSGkZFdeSuCCelw
offline.jssha384-6AWlLn2pEAwsHjZOeLUKhHPtfAzzAC7GXXYpFW1XZQ1OChliYYUvWwSfrmEPe+R8
offline.min.jssha384-nOHWW5k4teYVTgdr9pem7/0/N/mt6DLwL/vipeoYd/0u0lh3Ld9IiRAIWgk+ubid
reportingobserver.jssha384-ZtU5drTUdMPOWXuUZvgv4QyqMxkDNdiBiEbj8aD5CmwABHCI/XUFd2eC3iRRlc+p
reportingobserver.min.jssha384-c8fGh3K1+dBi9WNNtK2eVmaEgfoM3Rq1gY6KeRoA/WSi7RlhxRkUmVK37DJTwr7F
rewriteframes.jssha384-k1F/xgCZmOcziSivt8QoKMaELWZmjNJFm+n2PX/2MEKWrszB2IL6S4q+JDJ7o/8N
rewriteframes.min.jssha384-22utNfjd1bJOgWt7yrPsUIWR7gluO23PO7d2m30lqrmnj5DH3OmVa8fwcwZhbfPp
sessiontiming.jssha384-9srvADRpjm3FrmiK6dY0NGV4wnTG4dt8onLWUx6LRVN1xhtw+oRJnQ1LtKi4kqGB
sessiontiming.min.jssha384-yy0Jah9kyZt8VCnKVBxDj92pIC/E9XFkw5G6NXx2+0ZJbTBn83Y3X32KqAZxhF9b
transaction.jssha384-KN4xQF97K+t2Zgsqg8FiZE5++QLb0PCD4+v0k0ZVg6rl47vvmUIiSueozKB29Gu1
transaction.min.jssha384-p+n3NUtytg2Zgunyx5gQNdbZk7AieZyquN8nOaL7+hbqbe0SZomZIQJ5apsiXuLd
vue.jssha384-dy+CQ7fSXmIZEzMPlfZ6d4KJvRzMHRGpAEAgJpkieDoerreQ+Z5IgvNstng1Tk15
vue.min.jssha384-2N7Ym5Xq2tbEGuDRYVYY1fmAj2zZgR38wcPnX8nFwtOqL7Cjk0avM2R0GJ/ywIxq

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.