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.24.2/bundle.min.js"
  integrity="sha384-8x1Z8KjWCA4KJ7mh5cTEtm1Jngg4yEZDYTAU3A4HfHdtaiCYba4cCuJDHQ3zc2Qe"
  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.24.2/bundle.tracing.min.js"
  integrity="sha384-Epltozh7S1cJM2hcIRDJBbqiiVpZsNlFCciHxKIAfKN8mSTa+gMivtz7glp/30Mz"
  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()],
  tracesSampleRate: 1.0, // Be sure to lower this in production
});

Available Bundles

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

FileIntegrity Checksum
angular.jssha384-eYjSI6VPkp7fHkrmtyQBIG+15sHZR4quFOSqNouPtr3NSnDT8CLY4FJIWI4FKSEk
angular.min.jssha384-ug5Z6at3pUAd32KoO20DptJjRR68YGLn88sUPx/SeT/rzLn/ZNy+IwsrJGll9TDq
bundle.apm.jssha384-OfEbUzwgpXGh9D6KNweQ9Fh79H2dUl4PU2vUxh+c9ICbPmOusD5wxF+IHr9+CchO
bundle.apm.min.jssha384-CHoTm46hAmxFKUUuY/RH8hq3METo0tv8Zq0MMm0YY8UGj6fPd1/NB+JKJm+OCp/L
bundle.es6.jssha384-D8lMXc+P9lKuIWgNZrREkbV75+PWuu8Ciyk4HKrwg5KYsQBZ6F87MS9IbcXbBVY8
bundle.es6.min.jssha384-pUegjpSBtzSdJ8JR3NMkz2y4YRDUabqluWcBTpC+JmbrRnijB75Kocc2qexCRCEo
bundle.jssha384-fD1mBmYz1B6bRhJuagoApYZO+9PreU+opn3iFcsNP0QX8XpDiM9/HJ8Qs9cCKrJb
bundle.min.jssha384-8x1Z8KjWCA4KJ7mh5cTEtm1Jngg4yEZDYTAU3A4HfHdtaiCYba4cCuJDHQ3zc2Qe
bundle.tracing.jssha384-H9CAwVflJt2e3riMIe2bIut6gJ/Otm7dr7Zjj0JABo3hvsSFj0VVaj97H+sY2r19
bundle.tracing.min.jssha384-Epltozh7S1cJM2hcIRDJBbqiiVpZsNlFCciHxKIAfKN8mSTa+gMivtz7glp/30Mz
captureconsole.jssha384-8z0sASvRn+RHFRoDyM2HUFFRdqnMEqtYa2emgVe/CWKyoWfLAtS8Ydb9Xv8R5r/H
captureconsole.min.jssha384-kVSnSo3TkELFNBfVp8tB4zzw/7ZTIt0Uyc/o8n4uMaqX45tGOqsc8KxP07c+3Ix6
debug.jssha384-FQub9hUH/qC5HBwVZErKAgLGreo6yj7voUGA+5jHNmLfU88NWA4TJ1ZmwfYEhXKk
debug.min.jssha384-F97zFeXSA6uLeN7fHW8f736ORMxBbEcL+7mJ8Hpku53HXev4Lj7gYdzXnZKQp7d7
dedupe.jssha384-w30Nic/lP8/Lwg/nJr5WAydru2HshwlpwrbablyGtwy93SdrKOXBENhAbFar8U61
dedupe.min.jssha384-991Pgp/m4NC5gP7q/xzXphPFKPZI3iGG04gFtnoHlyH13gSiR/cQJVh+/5vjnULG
ember.jssha384-C1YNXNY5Z3amgnQqYf+Aiekf1KiuPz42by9UWrnGzmLIYCderW3QTTTs/53LLgq5
ember.min.jssha384-IVUzD0aGP5MQv3gkQxl5DvfVAMbQ9IYq2JzHJP8cM/GKk+rax/Eq/6OiynkRWux3
extraerrordata.jssha384-PpEpbC//gt9TVsHFVv51/JnF/pRHKj9rbYa+91SMsfx+A6DjOl3K74fkm8Xd1f8b
extraerrordata.min.jssha384-oyF1U5Y2J0GdVlibFTz8ECcGGvSRfEATS8ffUF97i+3+kWmnB1oGma+FcPMfSMVf
offline.jssha384-qlBBff4nxrFRIKH4Esi+s+wKOpakSxkVzzaeiv7sM1Nhvs5RfdkSVnBcaiz8dwd/
offline.min.jssha384-BZAC0jBUPGfdsuO/W0+1SE940KfPCdLjYxXUMAGhRhjoE/BpwbUMl5Wvt2FDyw3h
reportingobserver.jssha384-YaaZOYNGJchQ5FwzBbZP7eZQNl2Pz9cgJFQPpwLtduqAzT2DrO8idkZPyZSp7FgS
reportingobserver.min.jssha384-nGbVtxIBvghCRtjOhlVoVJAcHJi6dTb62aKBXNs7WSSDH5ngR+t7DUMrPDMq0pO4
rewriteframes.jssha384-GvvitZ/toG+iHvIBMEPJS0O9lFbpL2OYGIorUcJrxNAnBc84RFXfc8/ZsMLKoXBB
rewriteframes.min.jssha384-5rxdYmz5VZwWiI8QwrcorQ9s/0R9XAo7wkYe8NaMZ37BWlg7GL6HoVgoZLyRQnW1
sessiontiming.jssha384-9srvADRpjm3FrmiK6dY0NGV4wnTG4dt8onLWUx6LRVN1xhtw+oRJnQ1LtKi4kqGB
sessiontiming.min.jssha384-yy0Jah9kyZt8VCnKVBxDj92pIC/E9XFkw5G6NXx2+0ZJbTBn83Y3X32KqAZxhF9b
transaction.jssha384-KN4xQF97K+t2Zgsqg8FiZE5++QLb0PCD4+v0k0ZVg6rl47vvmUIiSueozKB29Gu1
transaction.min.jssha384-p+n3NUtytg2Zgunyx5gQNdbZk7AieZyquN8nOaL7+hbqbe0SZomZIQJ5apsiXuLd
vue.jssha384-VqS1BSATft5MZs/YZlidxuvTzjrYI7CrgbmdxQTz+IXLwDnDPn3imffhdcfdl60W
vue.min.jssha384-lD8tI9KCRQPr384eLRfYR3A+FxTdOA/gsgtjzueGb68mTJsUVUMLB0vvxWnHwWFW

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.