CDN

Sentry supports loading the JavaScript SDK from a CDN. Generally we suggest using our npm package (@sentry/browser) instead, as using the CDN can 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, which provides a deferred version of our minified ES5 browser bundle. To see what other bundles are available, see Available Bundles below.

Default Bundle

To use Sentry for error and performance monitoring, you can use the following bundle:

Copied
<script
  src="https://browser.sentry-cdn.com/7.45.0/bundle.tracing.min.js"
  integrity="sha384-3eSp2mmX0+DiH727hyDCiJsV+21D7/8YtcsQuhzpNTUTKJsYa16mVS5qfrdYjkoe"
  crossorigin="anonymous"
></script>

Performance & Replay Bundle

To use Sentry for error and performance monitoring, as well as for Session Replay, you can use the following bundle:

Copied
<script
  src="https://browser.sentry-cdn.com/7.45.0/bundle.tracing.replay.min.js"
  integrity="sha384-V5j1ffx+yGU9hesp+FydrNqN+6ASP81GUSuZ9Obp/zmnhoKTmwouet5Pry7uvYxu"
  crossorigin="anonymous"
></script>

Errors & Replay Bundle

To use Sentry for error monitoring, as well as for Session Replay, but not for performance monitoring, you can use the following bundle:

Copied
<script
  src="https://browser.sentry-cdn.com/7.45.0/bundle.replay.min.js"
  integrity="sha384-qIG/UjvqdBP4q8jlpu2d0wZGWJ5e97nnvkYUVrmrC+iQFUAPh4IzaTo0hXzRs0Wq"
  crossorigin="anonymous"
></script>

Errors-only Bundle

If you only use Sentry for error monitoring, and don't need performance

tracingThe process of logging the events that took place during a request, often across multiple services.
or replay functionality, you can use the following bundle:

Copied
<script
  src="https://browser.sentry-cdn.com/7.45.0/bundle.min.js"
  integrity="sha384-eB2/mQAt3oY62hGYFXiPg18greyp8WT/GvKHlsvdYbvSxBRGEhBqEX8L7giHxzvp"
  crossorigin="anonymous"
></script>

Usage & Configuration

Once you've included the Sentry SDK bundle in your page, you can use Sentry in your own bundle:

Copied
Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  // this assumes your build process replaces `process.env.npm_package_version` with a value
  release: "my-project-name@" + process.env.npm_package_version,
  integrations: [new Sentry.BrowserTracing()],

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

Available Bundles

Our CDN hosts a variety of bundles:

  • @sentry/browser (named bundle.<modifiers>.js)
  • @sentry/browser and @sentry/tracing together (named bundle.tracing.<modifiers>.js)
  • each of the integrations in @sentry/integrations (named <integration-name>.<modifiers>.js)

Each bundle is offered in both ES6 and ES5 versions, and for each version there are three bundle varieties: unminified, minified, and minified with debug logging. (That last version can be helpful for times when you need to debug an issue which only occurs in production. In a development environment, it makes most sense to use the unminified bundle, which always includes logging.)

For example:

  • bundle.js is @sentry/browser, compiled to ES6 but not minified, with debug logging included (as it is for all unminified bundles)
  • rewriteframes.es5.min.js is the RewriteFrames integration, compiled to ES5 and minified, with no debug logging
  • bundle.tracing.es5.debug.min.js is @sentry/browser and @sentry/tracing bundled together, compiled to ES5 and minified, with debug logging included
FileIntegrity Checksum
bundle.debug.min.jssha384-q8TClUARhhNSL7oV7Bii9Xu1OvlXBLOiPVc+fzh02Cpsf+avzap3nRDJhKE/QMOC
bundle.es5.debug.min.jssha384-zJgCkwYjbqnXoRkk32IUnrHeCHFiAt/XU7I4abva7sqn3slQXfKMx2kljV2qoI3R
bundle.es5.jssha384-xBXcTQ9Ngx37YqUZLt0M10cqMdrsUtKrZldKGm3g94oojkw7g4JRjYpnXKlUFMy/
bundle.es5.min.jssha384-0GT+02f89/KosqinbJJ9emqUr6o1a4P2Fy5hyhxS4ysVQsONc7HQy9hCq3gwrVi5
bundle.jssha384-5YHtXSAt0MkHHJYv6sN7OZQefzfOeNezgqcwgk8C9qLybYYLyANFrLVHBF247C0K
bundle.min.jssha384-eB2/mQAt3oY62hGYFXiPg18greyp8WT/GvKHlsvdYbvSxBRGEhBqEX8L7giHxzvp
bundle.replay.debug.min.jssha384-1hZQ0sW6SdEX2CWPQH/Z0JglR9Vu+5NS9tx4lg3F43mingV6q/ex/w8TPiliuyj5
bundle.replay.jssha384-Yz0ykr+wBF5bJfO/qKxJZ9js7TEmz+DXUiwUjBtcHKBDUpWJQbpmimORKA/TW7Ay
bundle.replay.min.jssha384-qIG/UjvqdBP4q8jlpu2d0wZGWJ5e97nnvkYUVrmrC+iQFUAPh4IzaTo0hXzRs0Wq
bundle.tracing.debug.min.jssha384-5QVLkbL44cOdZNTFsOmVD+HbOWqpvDu5xfth0Ksv1aTCntyNUZoKZzKl3bb9XovO
bundle.tracing.es5.debug.min.jssha384-ZhzxLHFfNWNz4IbRiMcW3gwFkCHxOHjTE8vsNhpmajpUkfRKNfAklyl3c6UVUFSY
bundle.tracing.es5.jssha384-Ot24BO5RhdL6z/XAcAHZNFyGohsqsKHY1eSgcamBYkn8FaNyeZ7O4aAMWSX+QVG0
bundle.tracing.es5.min.jssha384-XSnIGNuhZx5J5XUU/f/Y5WbAwfumm+RDkrU+Ylh0PBZvrek++Y6xkXkXUiYhyCAH
bundle.tracing.jssha384-QdtuukrbqnWW+Gq4fLQEMJykcsyh6D/PEDsRkmLpot/kXhEAtz4aBj6j99D1kTU7
bundle.tracing.min.jssha384-3eSp2mmX0+DiH727hyDCiJsV+21D7/8YtcsQuhzpNTUTKJsYa16mVS5qfrdYjkoe
bundle.tracing.replay.debug.min.jssha384-fPRiuSC5zWtA9qFcCuR8SOpcsy36vlYYr7MDUqgIIm2s9yyBT0QHZfxna42l/SD3
bundle.tracing.replay.jssha384-LyQe09W4NwYONw4Xgb2EMLFgfBi5WZzbkRNtb1xVOH6GgdcTIQvu4W5R8UAWGw7G
bundle.tracing.replay.min.jssha384-V5j1ffx+yGU9hesp+FydrNqN+6ASP81GUSuZ9Obp/zmnhoKTmwouet5Pry7uvYxu
captureconsole.debug.min.jssha384-R9Y/XeG+p/CGFnpVtgmtcHeawnDNuCdox1p8gY6aVGw7V37xdzwAu400AmLp7Y1s
captureconsole.es5.debug.min.jssha384-V3xgieWVA1YtfA0K4GOJKywCKhJlHLxnv6CbKF9eJdYK9m5p1y4iR5Xkop9+iJS6
captureconsole.es5.jssha384-yi7IdlGpejtPhmlBahr0/DXw28gN28NXvKCmt5u8+XKkd+RX5zmXoKfwAw+75jox
captureconsole.es5.min.jssha384-69BIFkejho3cu9Ia6/20+hgapBhpcuEkSJS7S179JscBtaJjIfaUdsos0QfSSCDk
captureconsole.jssha384-rPYchtR2vTRwuSPTGjNTqfAnX0aMPaN9OHqozmdJH0ojmc/PuX/CdAcT6AOb7oSO
captureconsole.min.jssha384-+hZPQUG09dfxk2bFymOGmFDkUOnBxYcVYZMHWKKAxQW5UEHgLXmOVPIBsJgHdnzb
debug.debug.min.jssha384-9/hau7kHbn2fm8/dpc3761xB1DLoulZhU7uxTyyl6IVbEXXP3TJ+sPV/94p81sfI
debug.es5.debug.min.jssha384-t+sXrIzmeqMnO2rx3bQ1qz5BtbdTsvFwq0hcOW/B/9ux5s5CjP4o0PDuJKFkJKY5
debug.es5.jssha384-UZhTPrIBXP3eIfjVTFguq0bZmF+wsprmEsTYIP1Fy2RbztB/ja4joUpi1Ff9eB7d
debug.es5.min.jssha384-mpRb1SWwxeptv658xZgjONg/VDM8Q55A6wKG+4gRUtSAa/2Mttt1SKCRkN0Kfjwi
debug.jssha384-iznyGUeX0R0uP+LizRh4KTqV8aVDvcqoecJYG0hD3S/RUcH9fM0VGAgFWJw0k8ej
debug.min.jssha384-K0Mz4zn5EPPB+G42DdFjome4CqX4KUzP/mhwwcoDw/jPzUQFRkPjljLka8x2f+uh
dedupe.debug.min.jssha384-hKY98ZfYdQnEFS4LT6RtK2rJ63u4Wmq+aXaTq0S12r+BMv3u/WrO+mTGT7GrL7gO
dedupe.es5.debug.min.jssha384-py1LAgxZRHnNjsJMfvZjyTalIzSa3CEx+LuEegan3d3Uz9QFNuQf0DkCiqiCNspq
dedupe.es5.jssha384-T1R1jy2cq7MfKnFcRjwXWchlBw1vL3p2yQn/io9yvQdn7PLALSmSjPc0Ls/IiHQm
dedupe.es5.min.jssha384-B1SKyl77i85rMZlnrmtoy25lEzvbGzdKbwrILtk9pkFsqTIQ+O5rFjBL/MoeAHW6
dedupe.jssha384-MM2+Ag+ZZZjiKe5cmWR2qhz3qz9/DaOmGor+A0kvlT16XO9HUCoiFrIxrF0IzBXz
dedupe.min.jssha384-C0YExFz5kApxwrY+ZJLCrr2xYmCPCdlvedJ6MP68SxHl2I/96XABqVYaaujLsn9Y
extraerrordata.debug.min.jssha384-t1702qfasoDL4xSp+sBy9Avt455sw9xGeqnfnD+8wksgSAyatAor2LC9DMcudoVS
extraerrordata.es5.debug.min.jssha384-s3dQqr5OjWa+T/GUMbDaytUYue4S/Z4Prqrw8XsB5ozZ4flwuaiBffS/mtkhoK8s
extraerrordata.es5.jssha384-DF4u4bqbzo+Fk2V8vRKD9FFIm6CEpa7SJr9k8SwK5R42GiFn9fS6Xnd0rsss+4qh
extraerrordata.es5.min.jssha384-yg4s9B9yYnFEy+kbguTFwDVpZFtJ806BbzReJ569AvBbJBc4uYxljMKkXNvTsmTN
extraerrordata.jssha384-PnAh8DfByKOtDvumfaWlukbcor29tNPptvdxtyJxMekKf+1DrA5Bb1MU7inu1zp9
extraerrordata.min.jssha384-xDprMZFGr7GZ/dgFwTvYAQNWMXFWkbWvnSoGv4Q0GCopMjOvNbhXhzvGrGtRfq9U
httpclient.debug.min.jssha384-Rlgt9QaBKT564159de4ul8mcFraNBRhcoIPdqkJ3AU+Go8oM87+OQr/WNPkezEA+
httpclient.es5.debug.min.jssha384-yxBecufw1s6pCWExK2fj/4acN/WLTC51v6NVSCuD9TCqrWRubcLB7gzCTZMRpXCA
httpclient.es5.jssha384-g1fp5rKiSgmQ4nTn3eN43eUr7NQ2jm8g0447p7udlkvi/Wa/BP1BiTrLVXgZMvWK
httpclient.es5.min.jssha384-vk1abHP7PGdHipEVDYR8KY9hnuuQeht5Aa8dsn9EJ4Jh21s8PiNBfvLtarlKnrhu
httpclient.jssha384-KYIsczPm8jkPdTyzdSqsKSwYzfIxLaUlelGrDdDnaD8WhoiMRvMftKyH5Uw5GBWa
httpclient.min.jssha384-8ZKWyHbVtLXUa8hEqR4/9QHzpNsRIJsv5JJjac1z7QVZ2rsFcWwL/p530jUrNBaX
offline.debug.min.jssha384-qp/qBbsR4bKf++8X7UD8XHQZnuf+qmtKtQzbFRYpaiTxTmVGdnc5eO+yPFidqENq
offline.es5.debug.min.jssha384-eWh146Se/O4Y7mXB1o0vmfP0hyiqjCwbgTRb586KlrgKMW8ZlDtZJtKZ3lj7hmu6
offline.es5.jssha384-HeK2pcGR8iwjJETcLguBHqMDkKgmLumErQ+xLvA8bxkx2tJvQO+UaYl+M+t6O3r9
offline.es5.min.jssha384-djYRtuOgoWnccJluEfyRZ5ZkPN4YX75srRlxJRs4CjYAa8+El7lHysIQJZAIs1+j
offline.jssha384-7rV1c9pP8t/U2w+Thfg9pUf/fY0erKZen3dBBERioasrNqaF6B6vFu0KRcxNp0/9
offline.min.jssha384-jGrRa3e/NqiCQ1J47xaRGWL7kFzYb3P6z7/dI24BIQdjo16UGUbwEFq5XcNDfTCW
replay.debug.min.jssha384-uPLEbvAlgpSQ/6Kw6JT2N1zerS9KhYq6+lob8MBzKY1/4Z0tC9wZjNut4BQIfqRC
replay.jssha384-m/l6XntRmvtKJ07ELiqLhuzwqSvmidBsLwvfGYu/8p3ocAcoMyJ4LsGRGEtjWF+i
replay.min.jssha384-OyijgDSvsvb+KX1VDi8ziL9uCN0xLSrE6qM/7sJ+Bq+e1ujXDIaWQbW+U46SKfMD
reportingobserver.debug.min.jssha384-s85ovDPRQR0feLGjbmb5BXb5XLWdN2CH6t66j0IM16hy6vh8hTfjLfVrKRT9yIBe
reportingobserver.es5.debug.min.jssha384-Zymw21zN5Ngp/Fia5XyeeGDZtDFimTc26sxbQTxgAYfwYYCcnlOtI7Dvv+hWKDFu
reportingobserver.es5.jssha384-edw45Y7F6p+4riOeBXu0gKeJyc/5DxqG1y5h/MpVgYd7oGl0cXjnMZfZdgQw4vuV
reportingobserver.es5.min.jssha384-tRXi+fxP18QjUQBOCev0cjsO72psZjfHFwy+vICwnqbtOg482I3v00E5098ZD/9Y
reportingobserver.jssha384-3D3XJmP/X4767y+rOxYaWbNdKtmuP8GdTFfk7HOLSkNtu2SXQP2nYjwR8QqUa7EB
reportingobserver.min.jssha384-Fa9tPhadWhjF77jU5MqYYkkvYMw6ODOrXJ9vbiC/9ozfc+0eBZxsIZr8z0yD3S+k
rewriteframes.debug.min.jssha384-SBz5aW+iUKxPqfwkQ8MWA5XhFWwWjmBv1uT+9wEe/mKuOzdZ6C16OBevy4+LdI9E
rewriteframes.es5.debug.min.jssha384-ywaj/SY5m7xFGwitQPC2v6hZVCmOkpLIXfzhw41miOSiKfVOZWpwXbt7qx2oHDhp
rewriteframes.es5.jssha384-iZXXxk3YmHNhcn3mI7uBrBmFmWlLp/lo2EJJeClGe3ILUQZmJ1T8siseNllNw9PC
rewriteframes.es5.min.jssha384-R39m+BOrMvONrExqmOzRiDQrbRL/n3kClxKO4TSrRnPF0TsK4phPhIxcygWFxn4p
rewriteframes.jssha384-D4O55jCey5yrPqGC3mmAEL2ob5J3Ns4QoA22QUxsuAr6MzA/9AsBwkHO++6oxCKL
rewriteframes.min.jssha384-m1kRQsSdJkB99lz+1ZvWWjrj0SPH0wXH8y7gvdjHAtKBP8lrLrcv9iF7fOQGL8I0
sessiontiming.debug.min.jssha384-zHXTnVchQ3K7GIZsDBE8go+x10paH+tnblsDq7b9gVI2e1g7OBu7dCZ3U04QO8VL
sessiontiming.es5.debug.min.jssha384-moYMgdXOdy5PV1hd8zxvUQHJNr7OQU7Cok289jCWC7yvPafMU5yoU/7xWgo5bdqR
sessiontiming.es5.jssha384-icwkizRgC7ysOjq9x1uHVWM6hHPgUn7g7Okw3aj1C2CHWD2hs45YQ/JONtKfV3QF
sessiontiming.es5.min.jssha384-AaAw/zC4Isegg1IWuqIrdm4TmLDaxHWxoh8022QYXdXgyzO0blHFc6OBN+019eGy
sessiontiming.jssha384-2DzoZX9v0P8w9KkHGt+9GQmA5cNiNVew24yxUN94D3dGYczv+vWbqRpCkvMWh9RM
sessiontiming.min.jssha384-bScZ1U4iR0TWMcbl6yG0fLv8ZYcaesjYcwoJ1RrvkmrN4dBCJbd9rERBNkB7Y/ZW
transaction.debug.min.jssha384-yFkCRpV3j6BLIeZfmbSPdwFdPIAWHqTjqX8ej8fz6vOwBYbCBSyYX++LvMWjECAl
transaction.es5.debug.min.jssha384-+yvfbmG0JE4kZ8vflAJb/vcRROD7Xcv3xOyBoFwAJp6M8LcUdWzsoHszJq8zb00F
transaction.es5.jssha384-OmXvYkH5pEhX3mjXWjpkZ2ezRyvp1ij4PDqw1g8HWYgadQ2Ylbc5TiYKF8tbxcyS
transaction.es5.min.jssha384-FHrb3ye18vZ7889fOQ0yu+LmcEGsn/QGWhIQ7VA5zL5PetD1qi0mBXnZgJ5AlR5o
transaction.jssha384-HpjpR4RWsAQkWwszETzF1+Easl6zBRB87B6HiDISzl3e+Pst3Rm9i9UCD2tVuWU2
transaction.min.jssha384-u0kl3537APi4of7OzzaLVuOs3LYhpA9xgy6UlqN5ZQrLwyPP/CRepwQRXYX39oqm

Additional Configuration

Using defer

If you use the defer script attribute, we strongly recommend that you place the script tag for the browser SDK first and mark all of your other scripts with defer (but not async). This will guarantee that that the Sentry SDK is 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").