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.

Copied
<script
  src="https://browser.sentry-cdn.com/7.14.0/bundle.min.js"
  integrity="sha384-fAxe413fRnr65qPVF9enoAhxS3Y1Irb56LW7uHE8ANEFX2/lhEY0RFLl0ysW75th"
  crossorigin="anonymous"
></script>

Performance Bundle

To use Sentry's performance

tracingThe process of logging the events that took place during a request, often across multiple services.
, 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/7.14.0/bundle.tracing.min.js"
  integrity="sha384-JN8he2zrOBJXN7OwYop+PvPNavIEBaRIFZHQVup0bOSH5A65MBTbFT+8ysxAa/VK"
  crossorigin="anonymous"
></script>

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-Gy4zF99IOEx5WMFS5AVJtsG2dyvBLdA9RYsrsqtwTxBBkB42IPCOh2WJ6wPR3cE0
bundle.es5.debug.min.jssha384-sbKTmiFDtLiJzczJmaRjaTj1gBlsn/vtgdZQu39afjh9nzfphr2k8n8Hm1Pza4RO
bundle.es5.jssha384-k38BoS4A3JyKgBIvsveXGxJq4kSwJuyqYHL/ZpGsAR6ur3Hm/xejKR3Ueius/qc6
bundle.es5.min.jssha384-sqIyel3VP3jqCd69XhKP+//v13RH+dMmrWowOFjqzjXi/HT5T/yRBZueaIVK286E
bundle.jssha384-Iq56NKupBBYCUgTLP13BUCaPpu394Km/WpnsE1FlKKI2sXjJkNQydQO0OwQRPOmA
bundle.min.jssha384-fAxe413fRnr65qPVF9enoAhxS3Y1Irb56LW7uHE8ANEFX2/lhEY0RFLl0ysW75th
bundle.tracing.debug.min.jssha384-biUyhyBgDUFWn/doDKkmbGbnn1KDoOkie7IiVfAEQx7Qvl0+xRPgpIfrjISzYnhM
bundle.tracing.es5.debug.min.jssha384-AhSSGUKny+RovJ7l5kle8PGhhPYLL++lMtPDwAouuJvUSPezcwML0rrIQ8va2au+
bundle.tracing.es5.jssha384-4g+4bz+2bXKWN6dD33ND7v8aKZgILKHDPiQS3rnfk3yiRuUOuddwoIvDJ5IJJK0p
bundle.tracing.es5.min.jssha384-0zDioe/1uUuLu3brwhtViIdv5KSYL9GfFzQAR610VDbSkZFARwnS0CpMFkgXwtj9
bundle.tracing.jssha384-YtsSgIiRFulwm8wNToT4nvMrWSQrGztPOKbeZd+U52hW8IwWmrMY8Y6gQUS0TPS1
bundle.tracing.min.jssha384-JN8he2zrOBJXN7OwYop+PvPNavIEBaRIFZHQVup0bOSH5A65MBTbFT+8ysxAa/VK
captureconsole.debug.min.jssha384-7EZ5dN91kiPtMc9WHX0o+8ECuMPX7IfM3m0P6sdTtBkJAeItEvdKpbYebL19hgkA
captureconsole.es5.debug.min.jssha384-CMTCRZushSVFVA6PWt6hyt9siuOUmdx1cJeOxLq3Gn/pPUTg0AHaPTP8xI5eIIb8
captureconsole.es5.jssha384-KaovXjmqWJSgI2jjUFg6WNkXl4bzA6RMGuRag2HErEOlfhqjsT7wXuJBFQATMLKr
captureconsole.es5.min.jssha384-ZKeMf8GwML3UDFdGQTlKgVEIup9wqx+nUEdCHR/3YV3ImGATfCxrM0MWdAvST7pP
captureconsole.jssha384-p9+8jlYTp7scv1o5oujVZugvQm1zzi1MV/LjRvg1LorbT+C5fO5ntmJG0PHniHuG
captureconsole.min.jssha384-eraRNmQ7noxujSYrbhfleZd/jBcDZrRP5iGH9dKl+wWYGbbAQncc0J335MZiRq/P
debug.debug.min.jssha384-sodjMyp0ar90k4yrjyG+WFYuCT6rqcu60BPxSbIVqB/4lJns7rzAaWvxzRdAKusW
debug.es5.debug.min.jssha384-z5HVsHtDx9Pt+XRwtkznFXeyQ8l1AoX4D6IrHg20ZKRR93o5xH0RD66FmSI06FU8
debug.es5.jssha384-1roE45vIbSQyKlrXsrgIyBruLq0kccyA7Oso8JHQFVEtIY7JpbPbQcPLSc9EU/9j
debug.es5.min.jssha384-Pzu8p32MeYAel+aPWbulQ0xfOWHjocWM821m530jNC9LwB7LCZOikG1DN6QsDQgo
debug.jssha384-c+cI5rbIE2rVMqy95col44XRejC2P+eU5Rjb4Qyc7YfyNKJjMrnjSMfraoGJ9ozq
debug.min.jssha384-jTlLOV/qlecOaMRHybrK8/BefXwMPkKsmrBDa5U5mjHU0Hirs0IfXW1z7GiQ8S2a
dedupe.debug.min.jssha384-D00Gxh++S/HHGTrRffbDAPJUDWJKJucUP+pDvxt8iXDwyq3W38tIWSTBlIDXbkku
dedupe.es5.debug.min.jssha384-sKnb8JDWtHOCnv+9ZJRK4xb0FenBQQZypP64JPZ7+YuQiFXfuOwHL42czVcPbXNe
dedupe.es5.jssha384-+UBzlIIuaoQg7SZ+lzhI1r1lSVRIY2Z9AbYoIKqTs5rrhPusSxxtzCD4EAsUymlv
dedupe.es5.min.jssha384-YRJaRXgW/uetstXqoPQkOQgqrsOg9jWBtCJDmHbrhgMiAtEu97pe3Pxn/wQu9kuZ
dedupe.jssha384-yx0YyoR0CBl3dCG/SDMnmBLM42VYCBkX5ljuZu6Ci1OzXQ9ICeTOFPfxA8Fa7A7O
dedupe.min.jssha384-T1Ewo4VXH4wCAOyd5bD8710CmjLMuMkEBHxpYUvV1rOcK61eIag2pOGV9nIkEltV
extraerrordata.debug.min.jssha384-XOgw3MGOecmTPAnL11ONOQ/DYay2bIy2bUh++QunLTMh7RnDsfvbIfCqWPpEAo85
extraerrordata.es5.debug.min.jssha384-K6KWTZ2bhcwV59aikE1gldTf8KDh/QCSyKUXldLXMXK8MFdjzZr3YjozodXM1XKn
extraerrordata.es5.jssha384-nOQRYg611P+Z7RTY6ufyrh/NTCmWspsOw3R423HZwxzfHhdDuPuM8lxkiqW9z51V
extraerrordata.es5.min.jssha384-5XdaM087s3vwuvGJgrfaPw8CMchdgmUhCYIWMyWHktVcd2HBjGQ+w3mjFzjk623x
extraerrordata.jssha384-ymG5tgaV+aopGYKWp2palnFLyCnRTxKSmn1DRYHSjkdmOsisAEcDN3XyEVwmwY1n
extraerrordata.min.jssha384-ubWVVHHTQW8ApaAce8Ff4hSat5nBiY6LIJbBuF5trAu76qdei8ffHphuksTqGgBR
offline.debug.min.jssha384-sm+vWK5iZmoCGl7iDEniMPGKoND1OJxerxekptXVNj6CDX0WRrDUqKwaywM80Qb8
offline.es5.debug.min.jssha384-16hfmNy7fnsg1LqTsDPpySorC7FrImMMxXDkFJr1COjxzXaklBK7KjV3qHMKsg7P
offline.es5.jssha384-U0XGKw+1fL7WhX2O7DmHIlIcd5EGll8NUIG2ikyZtMGyaJxx21K6oowDkWgVTnnn
offline.es5.min.jssha384-q1KthVxOdWxRvtvEUz8wLoIwjv8BEGXLUQ35bewi4mowP4GJ/x61ykh+lG9Uvj5W
offline.jssha384-idoCOnWySjYciAl7z2EmbUdSRg/AfLMZiTIO+9t3Pz2YZgZjx3KGnV6l+lSgsXGC
offline.min.jssha384-+HQrQ9hK7V6uY7hBb3st3rI4jwK7RO230DxSf/OP7oe1PfJKQOWVqMx3BeidheT4
reportingobserver.debug.min.jssha384-ituaCG/lIWKBaWwqbP8Wi+sLEfRFICAkEJ+EatI+ArIh1SEbbJbBg4KQc2x0uect
reportingobserver.es5.debug.min.jssha384-DkDJN4bWEftweOJLlh5xNPNSRIk2HbXmXSGUJvL5KKPYYPUEZaeQ6yNBdaAN3e8v
reportingobserver.es5.jssha384-viLuQw2pUcGBDNu17AFguiIFHBIKsPzzUPBYSNFQSK3ryMRvmU+QGGL4LqaNDzQk
reportingobserver.es5.min.jssha384-45Cu7oHCaxQJHSiSQWesTzI2Iu36ohpKbxPmaDj/B7x9gjyXLMPuFtbhq+tBZtLB
reportingobserver.jssha384-YuJHrkTE+nxb9LnNG+dyegRm13KQHTrFJ/vSjwE+ATTWA9+F0334dQEJjonTbeY8
reportingobserver.min.jssha384-ChyzaFyEowoMvFq+WkSE5uN9ilr3yDfeh8YJbYnAhQaOf3CIFe6+CwvsBWzmQQks
rewriteframes.debug.min.jssha384-SLdAyftWZ0k/4RwVjsipJ69pwMivY3SuZamhTvTi8CHH37yXy6XWHNTSKo0sqMKs
rewriteframes.es5.debug.min.jssha384-6OlHq/vzQhTeIhoVvsf99pEoyhlsDMEdgNB3hbV2SUXwbtpZOW0qCJlgol4HY8wD
rewriteframes.es5.jssha384-aN4I2uoUcsqNOsLNM3gGgwM/sXkEVi4aW3336vSkXTAg87BffglbWDm/X1J82N4f
rewriteframes.es5.min.jssha384-BN2idd7R39f8ScQfENihUhgZvW9thI8bPwYGLPhpb7dbfAUTAtLT87KJ5A7CDv1g
rewriteframes.jssha384-cVKmPKTirwr+FGiroVV+BrO5/ATCA4osWO+Vt9Y7CguWmEn6+N5w2uThP/7PnMrk
rewriteframes.min.jssha384-UulNTPaiMx+/dj1VeJmUAVvVPDqT0n5a/GkR3Ui+HBjtbHibfMCGmO2XCvr+my2v
sessiontiming.debug.min.jssha384-5sR77gQTTFOb17AWs/FqpoFC3INJYcuFFHaEBjCVYhGJAAEpo0cPK27HPNBzR4E5
sessiontiming.es5.debug.min.jssha384-4rDoCzDwy1pOldvNgmLLQyq3O0RgXuUAqX6jOQQ/WcmI5x5HV0sGhpDbX56qe4uM
sessiontiming.es5.jssha384-E0RezkgcELNgB9jnccsgHz5LXabtJXWfrtLfQrl/FBmoyLCGfWHjzQUMijGHMkHf
sessiontiming.es5.min.jssha384-e0tBhZo1+QMgwb5UD2BxRGxyOPxcJWFSF7I1kdVqNmTEVVswt4nGgavujaF6T7F+
sessiontiming.jssha384-uoLlkV/hj6IqM7ZzsmGCBHolf5nf3yQm19R9gsH/VkF0NO4OKqpyVHIdZWSzSBRT
sessiontiming.min.jssha384-Gxbyhrq+ZnZ/jniTgh7SF44nVTgxoTCq0C6EcC4FCPUeDEXmAs3g7SXbWvJ157bQ
transaction.debug.min.jssha384-6C5RtZT2x4NW2xSloGQ0YbN3WBYTwJVuWBcjfNf4Os9K/5HwFwuvashIGCBezKPC
transaction.es5.debug.min.jssha384-li0+xTFssgV6YsXphNvmEJtEESKQb/gVtUJCy17mVG3ZzNWDN9zMVdB2eJUd82V0
transaction.es5.jssha384-uZa0LQ+yivjMxpjEShmpAwjdIGSnDYwwc77DRHjLcLE8Fa2/Fk1iLBHN3pfwyy6r
transaction.es5.min.jssha384-G4440ouSMoNwhTbmciQ6M1bAc6RYYQRitAE41VKhO9Cd4eiqLQARtC6fo9Ga0MVh
transaction.jssha384-RUDxDCQJRCFAKL7PgKwzAds9ildQ/AYrTFRrlND1sZo7nOQ4N/yfx9Qiyav2f5X0
transaction.min.jssha384-gOvBbztZaczUsD56r6yokc9h7KB87rBUcOWfDle7sditWNzdccdDvZwnLuRSgvO+

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").