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/8.24.0/bundle.min.js"
  integrity="sha384-7KtWflhUrm3yHehS4Ve9sFWf2DzaRFe0WHTTKYRPYuaIacyIttUqDxozcoZur4eP"
  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/8.24.0/bundle.tracing.min.js"
  integrity="sha384-JJJw4DbjOsDg3bP8VddEg9VZRjwjIVHXUGl7vcAdg8EmxN7gvZkov6/1NuH/4YId"
  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",
  // this assumes your build process sets "npm_package_version" in the env
  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
browserprofiling.debug.min.jssha384-IsRhMsCwycTsP0xiF+nXw2CFHtQs1TRrVCrMWg/YEE0zI7OlcUnQm+aNBrpzaLxT
browserprofiling.jssha384-jCv2AScsGqBS3CtlToNRkXH/3asVvK4M0qU9r3ke+3e2G5dgSxIYhFvOBTS20jb3
browserprofiling.min.jssha384-oBxVWoV0l9pers4SJqduqwa/aZ3IoRmuxBgvNFASyPaQCWpl9Kvchvn/Pdeipodf
bundle.debug.min.jssha384-uB7RmVsjcpjGCgsNLrqeimwp5o8XwLUVBhCZwFaF+oD/cIKzcZCZEUpDGvEzBVJY
bundle.feedback.debug.min.jssha384-DWPImaorNxeha/heZM/wIRHNf12KeiH6+XdUr82Xd2dVl4/w/N1A8C6WMm8IVDTA
bundle.feedback.jssha384-6rkcUTeq8Zu+kgp2BnD0DrskqeRhR3/OtfP5v+cb0a11lZ1Ix2NSHcA9bXlTRJ5p
bundle.feedback.min.jssha384-YioWAvXcQBkPbbGseF4BZMXsNoEGMXjNpRz9F+S2XWBEapfZSIUqqdD9BjoaWcRW
bundle.jssha384-eZFWDkfTTnrZHLMZW1a+hnPa4TSStJ8SpF2LaH8vz23RnzEd4aUlLq5AKbUwo8cQ
bundle.min.jssha384-F1SqswdlOeNYRWB3oa9RUmKftSyuOow0eg62rQ02yu79aQrHRFj4n6JMD8B1oHlO
bundle.replay.debug.min.jssha384-Q2OkE3TlRopM2hUjySIZaXIzQ7oBR5rawYt//c0y5rDSftFUQc2oolQBOSmiKX5J
bundle.replay.jssha384-7zrctgf1EjVh2J50RDqx6eef/dq56XKf0CSYgaLmAoFoPdX8+ZI0BktnzI2PkrIH
bundle.replay.min.jssha384-HWC9Skdv1VUadQqEVtFEsajy/S7X7D56rFGmt58v8Ey8yBb3WXoTKG/lXK76pnJH
bundle.tracing.debug.min.jssha384-g8NSmDOdjsfsItjrT+3qbWD5jFarnokSWYQLPzOVBI/ybHDeQKuxiNGToYJOMUO0
bundle.tracing.jssha384-covX89XE/eP4OOE6eTskAKGe6AOFb6zcNkHenS3/M5zQxMC5Er8Wtb+Oc3meJP4x
bundle.tracing.min.jssha384-wYec/atCKBIhxMeAqO4JgQzLgv7nPphrOELh1UduVUFqt5DXn0Ey8pqiYEyYvZZ3
bundle.tracing.replay.debug.min.jssha384-umFHg9454Yn2eXXN1hXoXjWKRHB92rTO1KrG3LmVlNBU7pD+2U0cGGF6zO9VUs6A
bundle.tracing.replay.feedback.debug.min.jssha384-528z9JZ62cbDLaH742Cx2/VPyld2l9aD/hvp9Ej0sqDBjeS0DGWO5dSFu0Vh9qaR
bundle.tracing.replay.feedback.jssha384-l4aNSYtCcYx+40Rv2DEgDH6uR9RqGbUuHmBrT3Sdmi+TNpBJH6F73MiA4FDaBEzi
bundle.tracing.replay.feedback.min.jssha384-4PqjHS1cecpj1VgQL//GhR636MrfY5AibbgAv6chnQ2T03+bJbP9pOSxaYTQwyMw
bundle.tracing.replay.jssha384-xXGOkf+DN76W9d8Q7biskxKxNvQ+eoN89eEEIYSWaN14bBf36tVE4J357lb9DnIA
bundle.tracing.replay.min.jssha384-VaqNrma84jlgEWxBCMOnatKAHLSjaKGmo8Biuj3NQEg1MrmeukY8s6pnaTgRVjKM
captureconsole.debug.min.jssha384-LzsPefNrSKbys2RT+Twj3FP/yhFhxZIuOZscWGgr3pdI44msm73nB/H8qzjUe/UT
captureconsole.jssha384-6YXWf2MW3keByhWZ5QJJenwU+hQVh8om7MR7FkcB9jImzp8JbGDqHcNTMpM4emJd
captureconsole.min.jssha384-PonwDoT18zchpMUjz6eXLRVlOgAiDZ8ghYllU8E6AFgro14VBtwOg/76ik5KSqF/
contextlines.debug.min.jssha384-7XLygLkBlb1q4NCW3T2SQQWYWHkhuz7ZuoY+KkhHk0wv/uS778DLsIxRUmoJqHOo
contextlines.jssha384-/2XNmAN/Vu+d48pMXGh2zSKGvr28SUsv8tPJB8aDFmn9MPEw8V5I6TWzY7b2BFEZ
contextlines.min.jssha384-fGMJxuUPGHZ3z9MLbHzf9zANOp1Hqn2ZmqBmVT/HEC/ihyAkVAOuMqHnuw1u+bNg
debug.debug.min.jssha384-BPD4R6If5oG5FqwZzg+TZpBfOGCOIKJZ0gthx383M5DYANHjvqcgjL2dq6Ox86Ja
debug.jssha384-FIYX+axhS8lyI9gNBpOjK/tdleRUUA8ceWAf+KNlyAFGf7oC8nKbhIkAdEXmIZin
debug.min.jssha384-oK3mjLj3DNCLzrp/MI0vYdvWhufS8vaKXwpVtT9o5h/PVhQmiUy+nu6WNlqXjgbj
dedupe.debug.min.jssha384-7XnowWAsBCyo4rIgKpWIRXqLhkqYTFmos7i2frMvrBcYLIVCAURSHPdqtMxZHyW0
dedupe.jssha384-XolULy9wZN7AWnPNS3ipOPlMVwCLpuhlfO8GSqOdVu9SdhdO1oI8OauTUxiuvxHw
dedupe.min.jssha384-L+E12vq4PojBEdjlUHLwTlQK+OvnxUzFj5RwE9V5q3p1G/kC8Cy7DZ77E0RJi+9s
extraerrordata.debug.min.jssha384-dUnom4JPUBZYn6guom9SfZhIiIT9HVZ4NLIqC9/XbEGmtaElY3MtDWDOc8x0KCx9
extraerrordata.jssha384-H7ip9zKxzqBAq+aI5q60/IGDzQOc2RaIt+ctlCeSHw5KOFW77mf6x/4xM9jKalu0
extraerrordata.min.jssha384-IR4mcj0jZorFi1Huj3g+skhEui6zOjAKBokPxVrxiS/442xwPvOUmZxR+WNW6tM+
feedback-modal.debug.min.jssha384-eUJLCX0MHut623R7B4faHvzM0a2Qciw0+jn/MyaJW5wyfUbTf6TzBgDn/o8JTy5t
feedback-modal.jssha384-ki7DhUQylhdpmSV3C7nKuFzFP/FINmqPG80TJjrXPrsQLcxemoNG0K0b7G+7YeVH
feedback-modal.min.jssha384-sbv/2lwzgIRb9CSSJeTFxUKWGDlAey5hfXjiZ4nutz7p/1lR4ZsghJarh8RIE/Id
feedback-screenshot.debug.min.jssha384-olr5vIj58yaypvGzXEuEcSRDv1WYQbKDs4fCGeh7MOY2WDG0BHkwBJY1+fu4gBYf
feedback-screenshot.jssha384-mEpuNT5R0HLJ+EsvjbSdmQ595uqvuFYTTngnzqjIfsR2PfLvc5lHPJQ080DfjfrZ
feedback-screenshot.min.jssha384-Zt0GUuFhXCRiyjIp+WTkvTYL0UYiTjFWY4mOxZdrHB2j5Bq+UJRajyGtjQF27P9J
feedback.debug.min.jssha384-ZIyU9H2wwCOiwAgMlITEqSKXjNt4q4Zy4Q6sHZtd6hhMVlw8s6RF+YsV0Su0xm4W
feedback.jssha384-v9oLrXON+uewiJ3DxiWA1pVEQnwLkJ26U7zsrB+RZMecE6LpAIdI+moy2sqkXUxT
feedback.min.jssha384-pCkDZ8TFPRvbymsEy/08rPvkXnBa53eEhScw1twb94Xv6o0hYiV/cUNrTlRqWF37
httpclient.debug.min.jssha384-DwvTlmfSfHXynGueZULoMYBAXfyU7MgLhXKOl4Yl1neIEQO4lH4ZbkSiFq2MKPAV
httpclient.jssha384-PT+ZRl30norGSe8w4jcuOX+xJNMdK9PGK/4EFDP32ZfMcBgptC+YnDnMxlBNDOnK
httpclient.min.jssha384-+5M8YFFrh9B5rZYqz2eJiUyCSEZ+ijZsoNO7Vg77fRwcI4TKH6ZfWvXXDNK1LJ3Q
modulemetadata.debug.min.jssha384-2kSPfJFXoVndDfNGEOCqDxF2pW2pfYQXrsd3fepCNWOoXoMiMaoiJkXFU5gqsB+H
modulemetadata.jssha384-1Rnzav87jg11nMBKDy0Kp9KY469Z5sq2aNbxEAT6M/F25EN5vOfzXa3Q5iHPX7P1
modulemetadata.min.jssha384-ijGDP3Ax+w9RbNcF3Ui84j7MMow52cWMRvMIO4rUbD3FphgZ2SJlbawMATIcE92X
replay-canvas.debug.min.jssha384-Zl+DUNwgRNEormYJJ8nAvYieh8QmRQ8yPiuCrO2Qlf0HidCkqlYFe5sL5gb5TWgv
replay-canvas.jssha384-1+JqNf+nciymMZ7iCjUa4xr3DGB/PGi/+QpiuIsI0vDvFMUDtAm5H7bIeIiz5Jmj
replay-canvas.min.jssha384-EiQeXJCDIOjxQNaGc36zlkO1c8Yh1aoiK8N8swf6y/u3uKWOEIuoibpJCSVzUbph
replay.debug.min.jssha384-Y/BYdGYWTGRAq5mm250Wnb9P9XJBtxTXjvRrBI6eyPEzHWUJpWTSKmxxtApaudPF
replay.jssha384-wygeC/feJY4A/5Hj94uTWLYbmFVY8Z0uoqI98qnZe7Vyg1azpJ51nq6nWtifs9LZ
replay.min.jssha384-DVmSeqaV4GoavADBhgHY6ZvOgCCXfRSkE3Q2KZj1jLLKbEJIo9boDmp5tsa6qTQp
reportingobserver.debug.min.jssha384-OK89CXBaJXezZrY4hBcayeOZq5YGJMxsXNEDq7aNNK5MhFlmVTHY4xixAuraVFDB
reportingobserver.jssha384-2EfwUPxiaJhrBoVJPEqxYc/695/FPcSQK25pM2lCuzbsfMzEOP1syvumcFXqE3UG
reportingobserver.min.jssha384-P+g28m0MUk/EYYr8wqBLh5E/Q8Is3fz+LD97s4onKPojMfI+AIJnnIyxrl9Z0lzq
rewriteframes.debug.min.jssha384-oOGDJqKD1Y2Kr4ol2ob0fOiDyXKBbtyYAZTZROV9i/BozrzTnAxGi8ybwPtLhkkB
rewriteframes.jssha384-lSb3lH+a7s4ltaKVjBJWmeALSog/5L/TNEQm+r5tvfHGLfJOKlKvIyoZlorYxc6Q
rewriteframes.min.jssha384-cWwKyaaGFJKqKtl9KEcblYsmb/8lLZbqLOa4CwbfpcfiY9buviBTOhE2zpzQR6wG
sessiontiming.debug.min.jssha384-QD8kbDXrqB3/m1TC0I3gshmZzew5Yw0ytJ11hfjz7O/r7oPTP4AE92DLnxHKzJNp
sessiontiming.jssha384-nGVuZxSi8/E/3q45g+smJNiiai3KV0G5bB+j4aHEKWEf2s/Fmki9c6waGF8Fwd91
sessiontiming.min.jssha384-ncGr1burBv7je/cbCYM2is+tEJXtMYLwQnkWyxzrxCsRBMU1bEAFB5uTyMPT3ykE

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