Loader Script

The Loader Script is the easiest way to initialize the Sentry SDK. The Loader Script also automatically keeps your Sentry SDK up to date and offers configuration for different Sentry features.

To use the loader, go in the Sentry UI to Settings > Projects > (select project) > Client Keys (DSN), and then press the "Configure" button. Copy the script tag from the "JavaScript Loader" section and include it as the first script on your page. By including it first, you allow it to catch and buffer events from any subsequent scripts, while still ensuring the full SDK doesn't load until after everything else has run.

Copied
<script
  src="https://js.sentry-cdn.com/examplePublicKey.min.js"
  crossorigin="anonymous"
></script>

By default, Performance Monitoring and Session Replay are enabled.

To have correct stack traces for minified asset files when using the Loader Script, you will have to either host your Source Maps publicly or upload them to Sentry.

The loader has a few configuration options:

  • What version of the SDK to load
  • Using Performance Monitoring
  • Using Session Replay
  • Showing debug logs

To configure the version, use the dropdown in the "JavaScript Loader" settings, directly beneath the script tag you copied earlier.

JavaScript Loader Settings

Note that because of caching, it can take a few minutes for version changes made here to take effect.

If you only use the Loader for errors, the loader won't load the full SDK until triggered by one of the following:

  • an unhandled error
  • an unhandled promise rejection
  • a call to Sentry.captureException
  • a call to Sentry.captureMessage
  • a call to Sentry.captureEvent

Once one of those occurs, the loader will buffer that event and immediately request the full SDK from our CDN. Any events that occur between that request being made and the completion of SDK initialization will also be buffered, and all buffered events will be sent to Sentry once the SDK is fully initialized.

Alternatively, you can set the loader to request the full SDK earlier: still as part of page load, but after all of the other JavaScript on the page has run. (In other words, in a subsequent event loop.) To do this, include data-lazy="no" in your script tag.

Copied
<script
  src="https://js.sentry-cdn.com/examplePublicKey.min.js"
  crossorigin="anonymous"
  data-lazy="no"
></script>

Finally, if you want to control the timing yourself, you can call Sentry.forceLoad(). You can do this as early as immediately after the loader runs (which has the same effect as setting data-lazy="no") and as late as the first unhandled error, unhandled promise rejection, or call to Sentry.captureMessage or Sentry.captureEvent (which has the same effect as not calling it at all). Note that you can't delay loading past one of the aforementioned triggering events.

If Performance Monitoring and/or Session Replay is enabled, the SDK will immediately fetch and initialize the bundle to make sure it can capture transactions and/or replays once the page loads.

While the Loader Script will work out of the box without any configuration in your application, you can still configure the SDK according to your needs.

For Performance Monitoring, the SDK will be initialized with tracesSampleRate: 1 by default. This means that the SDK will capture all traces.

For Session Replay, the defaults are replaysSessionSampleRate: 0.1 and replaysOnErrorSampleRate: 1. This means Replays will be captured for 10% of all normal sessions and for all sessions with an error.

You can configure the release by adding the following to your page:

Copied
<script>
  window.SENTRY_RELEASE = {
    id: "...",
  };
</script>

The loader script always includes a call to Sentry.init with a default configuration, including your DSN. If you want to configure your SDK beyond that, you can configure a custom init call by defining a window.sentryOnLoad function. Whatever is defined inside of this function will always be called first, before any other SDK method is called.

Be sure to define this function before you add the loader script, to ensure it can be called at the right time:

Copied
<script>
  // Configure sentryOnLoad before adding the Loader Script
  window.sentryOnLoad = function () {
    Sentry.init({
      // add custom config here
    });
  };
</script>

<script
  src="https://js.sentry-cdn.com/examplePublicKey.min.js"
  crossorigin="anonymous"
></script>

Inside of the window.sentryOnLoad function, you can configure a custom Sentry.init() call. You can configure your SDK exactly the way you would if you were using the CDN, with one difference: your Sentry.init() call doesn't need to include your DSN, since it's already been set. Inside of this function, the full Sentry SDK is guaranteed to be loaded & available.

Copied
<script>
  // Configure sentryOnLoad before adding the Loader Script
  window.sentryOnLoad = function () {
    Sentry.init({
      release: " ... ",
      environment: " ... "
    });
    Sentry.setTag(...);
    // etc.
  };
</script>

By default, the loader will make sure you can call these functions directly on Sentry at any time, even if the SDK is not yet loaded:

  • Sentry.captureException()
  • Sentry.captureMessage()
  • Sentry.captureEvent()
  • Sentry.addBreadcrumb()
  • Sentry.withScope()
  • Sentry.showReportDialog()

If you want to call any other method when using the Loader, you have to guard it with Sentry.onLoad(). Any callback given to onLoad() will be called either immediately (if the SDK is already loaded), or later once the SDK has been loaded:

Copied
// Guard against window.Sentry not being available, e.g. due to Ad-blockers
window.Sentry &&
  Sentry.onLoad(function () {
    // Inside of this callback,
    // we guarantee that `Sentry` is fully loaded and all APIs are available
    const client = Sentry.getClient();
    // do something custom here
  });

When using the Loader Script with just errors, the script injects the SDK asynchronously. This means that only unhandled errors and unhandled promise rejections will be caught and buffered before the SDK is fully loaded. Specifically, capturing breadcrumb data will not be available until the SDK is fully loaded and initialized. To reduce the amount of time these features are unavailable, set data-lazy="no" or call forceLoad() as described above.

If you want to understand the inner workings of the loader itself, you can read the documented source code in all its glory over at the Sentry repository.

Sentry supports loading the JavaScript SDK from a CDN. Generally we suggest using our Loader instead. If you must use a CDN, see Available Bundles below.

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

Copied
<script
  src="https://browser.sentry-cdn.com/7.110.1/bundle.tracing.min.js"
  integrity="sha384-SnTsv3yVV4pq1l/xrc+GT8dNQacBQgHOOR7UuTVJDCa0o0AzduSzVHGZN7UI0ix2"
  crossorigin="anonymous"
></script>

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.110.1/bundle.tracing.replay.min.js"
  integrity="sha384-qMcjmeQKrkA1DH59EE7y0KVNRq7eMwuXeMFhp7hTJCYGgLxqHld0Ql2eJldrzOF2"
  crossorigin="anonymous"
></script>

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.110.1/bundle.replay.min.js"
  integrity="sha384-HuFJSy5HIxVR0TDYO4zQEQe+aR3NnNMYGpX5NgTuap4PW+Cd38JzulayPbSbRw7Q"
  crossorigin="anonymous"
></script>

If you only use Sentry for error monitoring, and don't need performance tracing or replay functionality, you can use the following bundle:

Copied
<script
  src="https://browser.sentry-cdn.com/7.110.1/bundle.min.js"
  integrity="sha384-opeivD1bDKj9azP3A/qmHwq1ksdC++bIRkItJBCCM/ky5t0hVDeCD4w+lACyC5QG"
  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: [
    // If you use a bundle with performance monitoring enabled, add the BrowserTracing integration
    Sentry.browserTracingIntegration(),
    // If you use a bundle with session replay enabled, add the Replay integration
    Sentry.replayIntegration(),
  ],

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

  // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
  tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
});

Our CDN hosts a variety of bundles:

  • @sentry/browser with error monitoring only (named bundle.<modifiers>.js)
  • @sentry/browser with error and performance monitoring (named bundle.tracing.<modifiers>.js)
  • @sentry/browser with error and session replay (named bundle.replay.<modifiers>.js)
  • @sentry/browser with error, performance monitoring and session replay (named bundle.tracing.replay.<modifiers>.js)
  • each of the integrations in @sentry/integrations (named <integration-name>.<modifiers>.js)

Each bundle is offered in both ES6 and ES5 versions. Since v7 of the SDK, the bundles are ES6 by default. To use the ES5 bundle, add the .es5 modifier.

Each version has three bundle varieties:

  • minified (.min)
  • unminified (no .min), includes debug logging
  • minified with debug logging (.debug.min)

Bundles that include debug logging output more detailed log messages, which can be helpful for debugging problems. Make sure to enable debug to see debug messages in the console. Unminified and debug logging bundles have a greater bundle size than minified ones.

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 with performance monitoring enabled, compiled to ES5 and minified, with debug logging included
FileIntegrity Checksum
bundle.debug.min.jssha384-4J7h5uvcYrjjTJ2mW6pOTx4JxeyW9zSTlwbJgHTXURhInbH6tqDEE+ng4y+6auBI
bundle.es5.debug.min.jssha384-dd+1o4NRN2neny5mqdZ9z45fiuodbxPqNT+GyTms9TlFrXhF+mLSOSDZZbAKkPLX
bundle.es5.jssha384-NTAbsizxVMyR5sq9CNrtsTbF9JigmeBOIDOpgmwAY8Obqxk0RGoqFSzzn7JwyTy0
bundle.es5.min.jssha384-N3lPjUVerHNHXNxPWtKmSjTxj9rM6fi9msIIOW5xTMVIE8bUGMrFqdLBJOuXhGVG
bundle.feedback.debug.min.jssha384-PHeDAivOmVFyf3DXl6XHJ5QviXrtP2aI7lIyQkMcitrsEL2vy3VR3iB/goNFyDgK
bundle.feedback.jssha384-5PypgWefnuedF0UZJbkrw1KMSI5PcsLi/kTy8KOWmDg6O+SJ6ernfEhqkiIRJNX1
bundle.feedback.min.jssha384-x858p8HERpW0Vpf1z0IrxKZWH6NJ4anL/EonyUVv8iZ1fCEv7CQ25Mzv1iVMpmuA
bundle.jssha384-9GvyR2c0OdTgeQPL3GTQI/GEogAy72z/iY7XV0Vps0gENeISlT7Y/xNZIU2DX3hG
bundle.min.jssha384-opeivD1bDKj9azP3A/qmHwq1ksdC++bIRkItJBCCM/ky5t0hVDeCD4w+lACyC5QG
bundle.replay.debug.min.jssha384-73BUcpXdABJ7YS1MSf0xTU1VAP8qlYx8berZBaqkFAfJgLpUtnnk+uC/TVpRBuAQ
bundle.replay.jssha384-c5jIBngQqJamjjgt+gnl5xcP1aR/gRcFlQu70GgkIg+OoBJHHZGYI8jUdSKkWNyF
bundle.replay.min.jssha384-HuFJSy5HIxVR0TDYO4zQEQe+aR3NnNMYGpX5NgTuap4PW+Cd38JzulayPbSbRw7Q
bundle.tracing.debug.min.jssha384-AWBY7qo4jXda5sD5ohsrZWVGoHmp/0t3NKbukMsfaWoCnTYoyq6RFgOVNoM08lJo
bundle.tracing.es5.debug.min.jssha384-BwCYF0P8nrIO18er5m42ADHkJhWLjYOpEEirzDersRYRdvykrBGuHJWKBy3mFUqN
bundle.tracing.es5.jssha384-dMiByRERDMKhcY7qiBSn+63SgsrMN4DyQam/ZZsck95PTU4xGuBJg6ABt2gbJIPR
bundle.tracing.es5.min.jssha384-2er9VcPJlmQOVxO0xCt8YV59J9HYQfb0+U9PG3ytSvwLvGfI1O1T/fnh/m/6BLkN
bundle.tracing.jssha384-xbFvU7BFxL3+yHfqSA2r6vFvTOGgig65jR5X/BdNWuc/raqw69t035isO5QjiyXa
bundle.tracing.min.jssha384-SnTsv3yVV4pq1l/xrc+GT8dNQacBQgHOOR7UuTVJDCa0o0AzduSzVHGZN7UI0ix2
bundle.tracing.replay.debug.min.jssha384-TVRKxyTnVGH9DMuDijO+yulJDpmA6pss82uW0g8zMKJhtP0GNZkVuRhP0B+NEd4h
bundle.tracing.replay.feedback.debug.min.jssha384-c1i0/q5S3zKsrwij5dqJJTjrrLowIC9QFdLiZrpBin3Xo5/JpSODamcPnk2XSgpI
bundle.tracing.replay.feedback.jssha384-uOfHKXOcYyXkY+t6HlMgg68wyqRhZpeBXgL7TO18OrLJfguTs36tPTqbm9eoXdCj
bundle.tracing.replay.feedback.min.jssha384-if4S2XATs4vlWvayBec3IEw2fo9p4rA6mQISEktu9y69kBJ3XqM3R7EEl9YBnuqo
bundle.tracing.replay.jssha384-SNcG87ZtMIc8/klOX0LNeRJezfyzzmLPfqKXEybMgUyHjRcoYGuv4t/U609MdbH1
bundle.tracing.replay.min.jssha384-qMcjmeQKrkA1DH59EE7y0KVNRq7eMwuXeMFhp7hTJCYGgLxqHld0Ql2eJldrzOF2
captureconsole.debug.min.jssha384-sZUf28dIIjc0BXspOgwaZuv6skdD3jGjkpFYChPuUJn//Ut4adfj1Qd1fB5uolcS
captureconsole.es5.debug.min.jssha384-NYotQmbOIC5Q6NVVA2XRwhroL2bXHn+hrkAJBML6cOPEYWAZoiJhx0K6YK05vKZF
captureconsole.es5.jssha384-I0SbiMNm1qSNfzCGE7MUBSbn8mwLGlZCCP2Ebq73M+oZN4DsIZ44uEz3g7NknDhO
captureconsole.es5.min.jssha384-A7HrXA2esS/DAC2w+zmzqWDojJK7h+Jt3H8wv8XoCUkW4EqdJgO7DMamJfzVIF+H
captureconsole.jssha384-bRBobaLRZ19wyOJezy+vu5YF7vS2HbSGmKlpDyQCnj4MnTIn5ETbl0Qj/sUlmlc2
captureconsole.min.jssha384-NwnVZpYj8NLAT56vbATEFBVuplP7uUZSJ2bYZywOAkrMVrKHb4TUS+aqMeBIBr2/
contextlines.debug.min.jssha384-DTK5MpqAPseKAeT3+b3XazduAn6lnbKycgZw9QjemRguWsHavGzRb3HEwBMm1xbp
contextlines.es5.debug.min.jssha384-4jFOp96w3ooI0JxbOopThRfsuQ/9+O20KgesCjb+ohwjjPYz3JariOZQab2aEI/v
contextlines.es5.jssha384-gAC8wbP5xLMTi+kRVZp15DG9liy6oebi2o/j0Mia2Q0WRCwMkQMjQAqyzkK0NVTJ
contextlines.es5.min.jssha384-j5hLaNsK2kOdDt1JpB3rj+sNWdEPUjAlVeN1NSdAkfVbm38VxNVWnWxqnrcJN6W+
contextlines.jssha384-VbKsYYVIIyPY5Z1Xyx5gi1Ao1MVhFQuexaRvjyODtsoMkPbqXI6BdVZbu7j8S5Se
contextlines.min.jssha384-4DbHQ+J1sCxWJhO5Gp0mE1p4U2XYLgdDhYTmT3vtitpHRE4rv+QR0HTrmfd9VUKu
debug-build.debug.min.jssha384-HTCk8yE6eVOoy7PMN6xUjyGiTKrKqcTE/ggNHSjQ8v+rkQ52epzyrSKrx5K/PVXW
debug-build.es5.debug.min.jssha384-hcjuEL02C76TdLm1x9QI3D3i/AS5zDJ1GIT59XX8paUfgsLSh+5b/RM/LZ1sOZYW
debug-build.es5.jssha384-cwaiKqQdsfwypZHWiBMjlVo9Loj4/gpIbRrP/4sPaoCqW7eM1f4D3uiNS/nh4D3j
debug-build.es5.min.jssha384-PbIbWdILBPrs5dh6+TdxYB9SJEEZh8LYYgYRPJa9dilT9TEjRZHscatXVpaji9iI
debug-build.jssha384-ho0NOWjcc19fqUF7xMHMiaHw7yMg3NChNFN4xN4OmmtC1ImEi48hYLQQdw8D4qcc
debug-build.min.jssha384-LzPxSEnAZz0EFIjbzCUGP26XvnwrOGtVXccH71MH+QTd0tPhPmE82f7zt2OU2svQ
debug.debug.min.jssha384-WQbipDj591sT5aMY/VIVLHQJaq4LDLDZC2xkPvRRfIVANOVVKzlCysPKTLtILDJP
debug.es5.debug.min.jssha384-CXN7ZvakvoWsKj7C6Kx51P1JfDJOLHR7Dqt4w2NOkChuaNe5UsjYccxVSnHTFvkn
debug.es5.jssha384-2BOKI6evIjS7sE6Te2OybzgtReUdTl0oaL4+d67JW5YIepQocKewKtd3yOoT7C8L
debug.es5.min.jssha384-sixkv2jYSwyQYyL9o37gbkee4AHIDYMI1KM9iHEW9max2EOL8+vevoo1N3GZZTxC
debug.jssha384-aIWBQUV+evbW7AGgET4iKFofqSk6PYdLN/DtZA6v2McBpT0avMDnsPZGcjrNo6m7
debug.min.jssha384-7t0Q4aKjEsTBc7dANWHNvTJt6xXWzAdPaBk9eNpzSTzD6z0NJxrdfcTglrqGjMhz
dedupe.debug.min.jssha384-WHuD2AFsa5rWfnHl1hjfcXLFrbeBjUn6clOJnO684pY1KtGauXnTisQ1AB1Hcc2L
dedupe.es5.debug.min.jssha384-03aPPPZpxORidYyQuE/Ge8LjdOuhiQhzWA7umPb9p0yiDw2myDDXQRDILd5/7xAP
dedupe.es5.jssha384-vEjl2pyal29vxXHl9zdij/mjXD3DbD3le2vGtyPtOvTmcjTrRFc/RFBNpAOZ4NKG
dedupe.es5.min.jssha384-ZQOL1mDg6gASKUtSn3DUI6aZ7FMryRRw1WW9PpWGK+OPEtQSohxQnQXKBIjmMAOz
dedupe.jssha384-bUN8hSDL8k0JepTrnJ9BsyrPqDYNSr3whcl57gEzCIUIkkYcEWj7Fd7bevCxcILG
dedupe.min.jssha384-aUuKSSnDojBjVtdsPLGWA9aeDijbdluqYvRd0VQROhnqh90E238GUbCjCew0wSBM
extraerrordata.debug.min.jssha384-h3ZnAvVC+PjTofKdHPRZqaPnHSrg5O3zn0pTGsL8oHKL8Ke9YYYoCgXdSOHvA4ZT
extraerrordata.es5.debug.min.jssha384-EfIDmfT0n392jj2oAjpJtWWSsFmQXqXTgNYM73Rg22tzTAH7a7Yk7d0QBNsvNbbF
extraerrordata.es5.jssha384-sbnX5fM2MWURSArPiymEFwq/Ay7cEJMgRA9af43snkoHS4HSAQWh8+7ysoLze98O
extraerrordata.es5.min.jssha384-drqjz/67jcvqw63TERRFAt+mbK7Uu4AoM7yeTXs3p4tZaUPj1dJ1Eo5fLN92PRhY
extraerrordata.jssha384-kUhwSTexU4Rkdc9l7ft+PNMMBsYndCHR9Zayuz2Rcs16VRoFXpQV/hQKvIfu22tK
extraerrordata.min.jssha384-phfTC8jKwZusfbUyVi0U/wgzNd6yqm3hKubwCyJxiJ9+sFvPv0JfV7O4VQew5iOe
httpclient.debug.min.jssha384-62dGFmyhJlHClaN84rSVrBXcOdJELF9H0QTM49aJ01qrJhPcSmqmqR66gAXA+xD2
httpclient.es5.debug.min.jssha384-lpjhfwn+Wxx1VeyRy+3PZGKzuaETulKCECKNcSiDv1ba7WkChOyp0Uw5FG4m2RhO
httpclient.es5.jssha384-m/KeF9CNeusAsc2HGNkuu4PLGQpJNgtN/aacHWvk+/R3x6OfG8NIOfn35159yYFu
httpclient.es5.min.jssha384-d4OTA4Tc6Ek9cDmX7g8HR2+1g058527mmQyu+9BfX6bap10Exh6n6E98cyhypD9B
httpclient.jssha384-alStx8YvsULix8AwUnUno4KcGKfGUhIh2nCt37iO6mcYpx/LRHCPiWTG1BA07/ZQ
httpclient.min.jssha384-BYlmIFzsvXS5JtAHPlSvPOCQB5BjAhsYPMJe6ZLlRKMJQx4wMqPJaArLGMru6Ygq
offline.debug.min.jssha384-efoCObtyOLGARmJcC3ApC2DL1wopvhAJDUohvEmV9RUXpZ3T4IjN2mfOIyuXiQkY
offline.es5.debug.min.jssha384-J2aBQ67yEvWdVFhTSS76isvRDunNOxK/WGJ6BwBbigY2EaVMfONaUEhPUtOtsD+Y
offline.es5.jssha384-ZbooX7C58jMltq2LrNjF/9EmB3502tCHVeXORYradReUVyIKXPtqaPPC5z+BeMLD
offline.es5.min.jssha384-5ijTApfXTbGJahJT459W0fy515KfI6jmG7t28iFqrCDMxKT4IS6/rodfxoEDk44M
offline.jssha384-SX7P3HQq8fGfDwaLDr45uRMjwfkoz+umSUrEXBcHOs1w1vTtIqEr+EdDFcSiAVdA
offline.min.jssha384-t4jbkcFRheMRVZkxJj5iM0cleoqBWu0GodcpAzkCgmZeW+cC41C9JWsYD7qbFxn5
replay-canvas.debug.min.jssha384-YBj3MLBk0b2bQMMZFJiaUaIgwSKRz3WLNVIS8E9Q/uR5DR8tmaQu7Yxm9kKVm5Qe
replay-canvas.jssha384-fM017EHwpWQy0ATT0xdA4fJ5o8oKwHbeowwfANmBPUII5Pkdj8OmDwlZ8CgA4iCB
replay-canvas.min.jssha384-8ds3sbxIqbFYFZMg2Vf2MQts65u2UbSpLjNKMNSIHZ4Du88XDIpCq4hl5sBS/S9+
replay.debug.min.jssha384-MEUnzKXAGX0+QlUjwb3QFBZDwCwTpIE1XzeVV6Kdy44E969Xx1yx+5DIYR8bYKKl
replay.jssha384-8Q26WFbotU2GjWz2ui83SInHZzzNeZ6vUWCep/jKESHXf8tFRUhWMSRyymJxTjfJ
replay.min.jssha384-P5DLmzmxoSCFFJ/aNf4uAzkIMrnQOV6ALmNdjWTaJEWAAJIYJbUwzqyQrOpmxMfs
reportingobserver.debug.min.jssha384-c7/c5LJlWQe6H/MH7Vdw7TSS3MSPAiy5KHvUmlrcTryhgCtHgvBJUZuEgGcygWfV
reportingobserver.es5.debug.min.jssha384-NV+T/yG6aXnxiv84tLp2TQ4ImmoqGXY+9RnmuJSdNnE7olTs5RqcNrBa5KETdNnt
reportingobserver.es5.jssha384-9vOPMA+qCFoZn1zp+cSI+Sl7QHCPOwa5fTmYj8D7+KUv+zMnUqmhEPP1JuRqKHMz
reportingobserver.es5.min.jssha384-38yvyBwLp3zptwsVi832kFiCCxpdltQvcCaBRXKFvA3yTL0BoIGHimakA7W6wxVY
reportingobserver.jssha384-6Dz4lY0zPeakwTxy+gX0kgAywZDO6hfGh47DVLyWQANomEh/BlXmRXFErozDCwk/
reportingobserver.min.jssha384-LneqfBeieGAThwpzqdPfHlAe7cQ5BFZ+6vafMKXWBQJHUnJspV+e0J1LRtZMK1lM
rewriteframes.debug.min.jssha384-bWuSbyZjSBJGjuGyDCrM2uwEnm7C0R3i3bye1/Swv5Zl0b6j9VTSKikJzLSsanyu
rewriteframes.es5.debug.min.jssha384-r8kv2QPK96AoNwFaFbxthl4PxWZj+APvJ03YZj/5I39lB2VWClJbn5fi/1X32vXL
rewriteframes.es5.jssha384-dVapw09z9+33GaS0KA2tmlPKJiZkl/CS89Vbssk1rTG4BG6rlKvLELPa3iwmJE+f
rewriteframes.es5.min.jssha384-XygW9eW3u6b/qyNl9xSMvlyx2Eb1J2PuPBmjjdV5daqKmkZmzwzvFRnfwsEqyrsP
rewriteframes.jssha384-SwGn98JdE8ukYGzJ1kJQN0BiFTzurDyFXEM77RFCtIJ5D2ojhxWEchEDq7nDuQTL
rewriteframes.min.jssha384-JBEUzryXsrAa73lWi6U99di+Oft3TRUXNrioBGOdtBbaI/RVquae3jDor3DHR2+B
sessiontiming.debug.min.jssha384-My8HJVbpYf5hJLFbfQa7f4uz5vtxQARM6YSNm6OFCqet4xrzfPP3aMfl5ST9iRmv
sessiontiming.es5.debug.min.jssha384-28tlX5itvfgomcdcFrr0W6xXbBwA2gRPZttia50N2rSluCQQWyZEfaUCu1o/ixwB
sessiontiming.es5.jssha384-bGlsgv5pTssZi9VnORLbHsBtqTkPbrxJt2ZHwUZSbgXBFFdkiy8RJ/BbGEhx9cUQ
sessiontiming.es5.min.jssha384-hEd6bBfie94f/9STyrOK2qY6WRohCpJfCrYXnEjCyquHi3sBMWZ+5E4Y4BmLf1ch
sessiontiming.jssha384-ZNz3D6GS9Tpz7R9ehKqmxXlDBo4ZDuQato5F+5SYuGb8pINDyEyWVO/PtIacZ9PJ
sessiontiming.min.jssha384-qxuYbo40vehM5bKAUu7brZ0dltDenIxqtnwfELISVL0YvKuo98oH2Q/ZREQgqA1W
transaction.debug.min.jssha384-KZP9wvJ1t0Rt8qjCAK2Tz13a54yhTas8HUIZYi4pHSoEzve1jdp9cn0zSm7dw7aU
transaction.es5.debug.min.jssha384-OeFcYhquH6QX1P7Qz35Pm+YCjKCElaemsYF9qhCENwItaeACKraeQmyTt18rWAJN
transaction.es5.jssha384-wi54HziOR+tHbkWCfrQxxr8Yh88taOtxNKeaCFfyMa2bXJH9Q92AlSXjyvuGinPT
transaction.es5.min.jssha384-EKmD7d+NThfB/ICwnraLtutljEXyJ3l2QCkiA6D3BZDM45I2oe7z6Cz9Tq3UgxB8
transaction.jssha384-4Z4yYZchjTSSXMzSfxFW9Np64Z3TWHbrrAsWKwoiAp7XZY1oJBJTV0X29Y/M+br2
transaction.min.jssha384-5rbEOdNpzbmcFtYxz86yDTVpmJ3qoV1IgFq6q5KodrRUmPNyOSIHfz1E0Fg5lDl5

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.

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 https://js.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!) or suggesting an update ("yeah, this would be better").