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.4.0/bundle.min.js"
  integrity="sha384-Tm8L7AJ2+uA9xQUntCAkyIJWWLhX4R9AV9cF4oC7i86Ozuplz6BAJr/t7F65CPmy"
  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.4.0/bundle.tracing.min.js"
  integrity="sha384-1GDjLoBS360q5u/wYv44ld62L3lAXutFmbANiIXOuwZMEH3zDEEYex3fx89buG8Q"
  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-9IHmAOCPXPgMIv+8olwG5xZO8pF3di63lUq93VgDrPlvmuEVfLKhWjjjVs9YBTNI
angular.min.jssha384-jt+ayX3PGnMLPYzr+oe0BJV2bnmPrxvEzdJ1FjGxd1Ab0VlB8qrnmKNlZcpzfjct
bundle.es6.jssha384-YW076ZRYDhC+qhev6Yhq4WZoqRxdLeCcomDwY/XLp/z+2fXxk6Z6/PNnYgaSrul6
bundle.es6.min.jssha384-UDb/KE7uytkNpYLK3rZ5DLzuZdshoO6TZaf3tfCIGaC51KzWEWHf6ErR/0h3V/Je
bundle.jssha384-80PsXfBaXOsFxGYuGxADlA9sdGrGwuxquHkCnVdd9nG4yVYTPLgqcuNUTr30pRyn
bundle.min.jssha384-Tm8L7AJ2+uA9xQUntCAkyIJWWLhX4R9AV9cF4oC7i86Ozuplz6BAJr/t7F65CPmy
bundle.tracing.jssha384-US3sqPOLffzU6yo94sFlK+VH0vCAmAo/mbxJwKoJhIHrC/9Dqab8ztjyu/j/hkx5
bundle.tracing.min.jssha384-1GDjLoBS360q5u/wYv44ld62L3lAXutFmbANiIXOuwZMEH3zDEEYex3fx89buG8Q
captureconsole.jssha384-UYt0Vf2svpJVZCkwoUw4RrcplppK2zCTkL9b5dtKGC4bbJiCy6q6thiCsUelxw0V
captureconsole.min.jssha384-z1s64w7TcsfPRAfzAAE4ZIC7eMGjJhiLShN4I9W2gibmwZX4K8vaDKMH8mow61yf
debug.jssha384-5Ai5FzjuOTdeQcz3GDjqAc8kJAba04Fb0zFncHVZ5OWCpPz/4dojKRLwVDqVdNF1
debug.min.jssha384-kuPWCcyoewFF2GWJDBvaRQ1WfeGZeTxy28WlBSHRScSCquug27WpbI6/GnDqeFYo
dedupe.jssha384-w30Nic/lP8/Lwg/nJr5WAydru2HshwlpwrbablyGtwy93SdrKOXBENhAbFar8U61
dedupe.min.jssha384-991Pgp/m4NC5gP7q/xzXphPFKPZI3iGG04gFtnoHlyH13gSiR/cQJVh+/5vjnULG
ember.jssha384-nfR/z1jzCrky3jhu11Ucml2A2tNx5J72B4Ke/dpz6+hSYbz4hyErPRSYDciwTLvp
ember.min.jssha384-MhOMug+hzBaD4PcUtnMAEH3tqC6hh4bH2dezmGcUffGATpucZeNUAy0pAzqe7Z/K
extraerrordata.jssha384-bn01K3egMl1bhRvH7mVY0Wimnw4dAB/v/uyGt8Np/Ixw+Cw+5s1OgvgH/rFIEbkG
extraerrordata.min.jssha384-hz3P8MxDMgvCcI6CHMYUMWZvHjYM6pWvjC7MmjyVoNm4YsLvqysZPbkak+YwOF5S
offline.jssha384-wgxhKPZwk0lKlI53XfshKM4qmzCSH6DAa7Byd9VPCnL0WUhHI4UTXGp2EBwLkTc4
offline.min.jssha384-v7OtkrSRsx+5qqogLYxEz2XWa3GDzSW3FGS3wacaAhPQ7W2gvw9RrLziznxjPdRV
reportingobserver.jssha384-YmZmt/eo7TLmswYCkv1hkESpdyUfTmVeo1BW6Yh08Se4rG0KxeJ1UU1421069liC
reportingobserver.min.jssha384-Ya6Ygm7N4qv0QlrLB0XP7eW05KliB8LR/7MRanWZ+cvFCezxLqjD6s+gwdg251P2
rewriteframes.jssha384-yEnZWNiBGsr3FalzLZTFor1ihoiYAFvTvM2YnRuEIbPMJBcXDGavV+NOsuE5qct2
rewriteframes.min.jssha384-o5szBG0X1WswwEadvw33ULTm6vkzcGO/6btXgubP1X4CcR+da2tLEL0cgQ1kvY/7
sessiontiming.jssha384-9srvADRpjm3FrmiK6dY0NGV4wnTG4dt8onLWUx6LRVN1xhtw+oRJnQ1LtKi4kqGB
sessiontiming.min.jssha384-yy0Jah9kyZt8VCnKVBxDj92pIC/E9XFkw5G6NXx2+0ZJbTBn83Y3X32KqAZxhF9b
transaction.jssha384-KN4xQF97K+t2Zgsqg8FiZE5++QLb0PCD4+v0k0ZVg6rl47vvmUIiSueozKB29Gu1
transaction.min.jssha384-p+n3NUtytg2Zgunyx5gQNdbZk7AieZyquN8nOaL7+hbqbe0SZomZIQJ5apsiXuLd
vue.jssha384-9LR0Ew/bInd+a33ldV47/epfgev9aUPjaa7N340HB5YeBft6hZFnaUwPD5miQStq
vue.min.jssha384-IPI80tCgEPd0JXpgbVEKNPcLiaCm4v22ns5IL7fIzpLsq/gKvh8kQUoBSZ8buSkO

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
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").