Loader Script

Learn about the Sentry JavaScript 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) > SDK Setup > Loader Script. Copy the script tag 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, Tracing and Session Replay are disabled.

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 Tracing
  • Using Session Replay
  • Enabling SDK debugging

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

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 Tracing 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 Tracing, 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
<script>
  window.sentryOnLoad = function () {
    Sentry.init({
      // ...
    });
  };
</script>

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

<script>
  // 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
    });
</script>

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.

Because the loader script injects the actual SDK asynchronously to keep your pageload performance high, the SDK's tracing functionality is only available once the SDK is loaded and initialized. This means that if you e.g. have fetch calls right at the beginning of your application, they might not be traced. If this is a critical issue for you, you have two options to ensure that all your fetch calls are traced:

  • Initialize the SDK in window.sentryOnLoad as described in Custom Configuration. Then make your fetch call in the Sentry.onload callback.
    Example
    Copied
    <script>
      window.sentryOnLoad = function () {
        Sentry.init({
          // ...
        });
      };
    </script>
    
    <script
      src="https://js.sentry-cdn.com/examplePublicKey.min.js"
      crossorigin="anonymous"
    ></script>
    
    <script>
      Sentry.onLoad(function () {
        fetch("/api/users");
      });
    </script>
    
  • Use the CDN bundles instead of the Loader Script. This will ensure that the SDK is loaded synchronously, and that all your fetch calls are traced.

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 all Sentry features, including error monitoring, tracing, Session Replay, and User Feedback, you can use the following bundle:

Copied
<script
  src="https://browser.sentry-cdn.com/10.24.0/bundle.tracing.replay.feedback.min.js"
  integrity="sha384-ZJCfTsGNRdDw6vGEi6mGtlWnAX0SKEOVxe1iQVE8hdJyO06EdTq5WW2jlgeLE8Dz"
  crossorigin="anonymous"
></script>

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

Copied
<script
  src="https://browser.sentry-cdn.com/10.24.0/bundle.tracing.min.js"
  integrity="sha384-32ssz8aQT0LcL1l3hN6T5lcOG7KIG128Zbbs6b3kbnHOD1aq3ISZm5eu4CXmAgJ1"
  crossorigin="anonymous"
></script>

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

Copied
<script
  src="https://browser.sentry-cdn.com/10.24.0/bundle.tracing.replay.min.js"
  integrity="sha384-0OqQ1oYlXWouQgXhccmd/qZIWdwl/pWAzN8jUzJzjKYHIgFe5E5CJ3f+ZwohRdMY"
  crossorigin="anonymous"
></script>

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

Copied
<script
  src="https://browser.sentry-cdn.com/10.24.0/bundle.replay.min.js"
  integrity="sha384-GldeagS9/3+SfMtFhycXsoAmgBCHX9qmRZqGAyN05oJ6AkqxP/HGbQWq46cf7piO"
  crossorigin="anonymous"
></script>

If you only use Sentry for error monitoring, you can use the following bundle:

Copied
<script
  src="https://browser.sentry-cdn.com/10.24.0/bundle.min.js"
  integrity="sha384-cz7hMxQ6Tn3b0e4OA+pPzaaJtEgbVR2bJrL6MRXDgF22dwLKXS/2q+vB7gSYuB/Q"
  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
example-org / example-project
"
,
// 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 tracing 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:

  • bundle.<modifiers>.js is @sentry/browser with error monitoring only
  • bundle.tracing.<modifiers>.js is @sentry/browser with error and tracing
  • bundle.replay.<modifiers>.js is @sentry/browser with error and session replay
  • bundle.feedback.<modifiers>.js is @sentry/browser with error and user feedback
  • bundle.tracing.replay.<modifiers>.js is @sentry/browser with error, tracing and session replay
  • bundle.tracing.replay.feedback.<modifiers>.js is @sentry/browser with error, tracing, session replay and user feedback

Additionally, each of the integrations in @sentry/integrations is available as a bundle named <integration-name>.<modifiers>.js.

Since v8 of the SDK, the bundles are ES6 by default. If you need ES5 support, make sure to add a polyfill for ES5 features yourself. Alternatively, you can use the v7 bundles and 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)
  • bundle.tracing.debug.min.js is @sentry/browser with tracing enabled, minified, with sdk debug logging included
FileIntegrity Checksum
browserprofiling.debug.min.jssha384-ucQZg4Q4D3TiiJxViZE6YGpC+PbE3dlihBFllPnIAVux20bEL6QgU55M3Z7O7p2g
browserprofiling.jssha384-aOk7lc0Czfqg+PtWLATgj0IWjKwbaZyr+dbQqPpleK5rUdUT6Zn4M21NdNy2MhXV
browserprofiling.min.jssha384-o8yvkOYJDyttpywod9lcqqgmNpIP1k+dSFjgR2m9N+U3gXYsBnc4Y5yWqphY0xUz
bundle.debug.min.jssha384-XiYn0058QqWzUqwyd8iZpFk3Y5yFOtVPVqKMKHvjFuoGM9HBukkKHG5zzpAUKrzi
bundle.feedback.debug.min.jssha384-+KnT5C/QxqfmLi1KCwrPCiIDo74+xGNAc4x7sSx8Ki0Bdb6CSYMxAM6VuST/FuGh
bundle.feedback.jssha384-DFgWxNR3LHvlDwLgJkz7GZeHgtg/fAJH0u2H7ygrj9RGdDAQT+MpUBSHDrMXoff2
bundle.feedback.min.jssha384-M5gLnYLm9oCazhccuPkjBxCkGKi/TqaBkHqgUPLYRUB4O6RE+I6gxN4ZxEPrcC20
bundle.jssha384-2GNXmrceP0fsfjqWHz+17y53jcp42O39VDCCx0dLu9+6703oPoaiEmjIOhueicdA
bundle.min.jssha384-cz7hMxQ6Tn3b0e4OA+pPzaaJtEgbVR2bJrL6MRXDgF22dwLKXS/2q+vB7gSYuB/Q
bundle.replay.debug.min.jssha384-qsDq3v2Rge3GpFVxolxULIZZb0vl5tFOKLzOKqBZ948B9ye8y0P50EjUcpoe9FJ4
bundle.replay.feedback.debug.min.jssha384-UK0N+u3vap5tcarqCIYgx5Oo2Y3JPKtOV4p+zQXXGFODkEWVl8woMmPZD20NLg85
bundle.replay.feedback.jssha384-2NNv9kaBJipG21pz30HBRioJWEgMBY+BRC4Qe1sG4FkMC7/exmAEhnE7vp5KX4Z3
bundle.replay.feedback.min.jssha384-PQNntgEsJRISJ5NB3lFbXyHZI0b5h3LwaNYw5Dq9pwVllDW25hOepccdUR3tot6L
bundle.replay.jssha384-KASGgPB6ysuKQwCP/C10iUd+YA+u6YH4OrNnpr6e0g6p4udCun5T8aQsr4dNwgmX
bundle.replay.min.jssha384-GldeagS9/3+SfMtFhycXsoAmgBCHX9qmRZqGAyN05oJ6AkqxP/HGbQWq46cf7piO
bundle.tracing.debug.min.jssha384-F8s2PRA4kYYKvPumy+H/d6dVlT0UmzchDRFJ0Nc+JT7reu1DzdJKWICiGPZJh05L
bundle.tracing.jssha384-D/GNR+mij9MMXzo3XAz+nk7Mqd06OMaC6AuaDT9k6XOlcWKj+XEMTqlMuSXyWiKP
bundle.tracing.min.jssha384-32ssz8aQT0LcL1l3hN6T5lcOG7KIG128Zbbs6b3kbnHOD1aq3ISZm5eu4CXmAgJ1
bundle.tracing.replay.debug.min.jssha384-Ym+veMNf6lOp2XTgDmzZNo556GBEKK5wfLeZskMjCcF0CdxcJ95WZVPun2SOnOXg
bundle.tracing.replay.feedback.debug.min.jssha384-y2MN5PgUVlHyN9IIGX2jBM8uE0nI0PIfkjFlsYh1T2Xf4GEGgXaMbNQVjstHdjkV
bundle.tracing.replay.feedback.jssha384-VjcdTjxD4Cmgcngutet9AmDQcfbfK6DKFTs9EGrYHKcGZqaOgoV7zCc7jV17+dm7
bundle.tracing.replay.feedback.min.jssha384-ZJCfTsGNRdDw6vGEi6mGtlWnAX0SKEOVxe1iQVE8hdJyO06EdTq5WW2jlgeLE8Dz
bundle.tracing.replay.jssha384-El9Dq6fSfCzeHMINTS7neMmf8hn1BOK6f84wFNGcWUY4Z33Y6eq5gu7zO0eXquQZ
bundle.tracing.replay.min.jssha384-0OqQ1oYlXWouQgXhccmd/qZIWdwl/pWAzN8jUzJzjKYHIgFe5E5CJ3f+ZwohRdMY
captureconsole.debug.min.jssha384-j+OHWSRnblTY39v7ua1BfP3aafm6LIjjCZTyzHlBdfN6RqtL0IOAk7TnZG9yyzFd
captureconsole.jssha384-E/WOFKgbJfBQGqLA61XiCD7zB4t7KphCAK/vVnPkOYttjX7c4X83FfwOFGiuKuD/
captureconsole.min.jssha384-P5ySEct9tswnspZG+mNnNzVN2e9INhAtATtZAOTgkKCWc5MgION03OGB89et8YiE
contextlines.debug.min.jssha384-qujCa5dIxWYztfkz+q90MbUZcdujkfytaeP8yJJKICm2Q3SZWba9Z+1fFuY/K2zv
contextlines.jssha384-DctFYAQQmwN0JAw+pKs/EAcvEVQdXgoDc3RgUzfTsszuqA+LIvfMx/yzVSodjdvL
contextlines.min.jssha384-13+ydtKQtb8HZ7q38I47sy2e4FsAnp1JmgfM4vDMcFoteINP9iuRGV5kfmXDKbmn
dedupe.debug.min.jssha384-bF+CluIbtco4iXG2+Z7Z3xSeuE34uzkR2h2BtD6xoFrX9cYNTH7aPLHKdCTYUzwW
dedupe.jssha384-S4ncDNLXHH1DwREJQaIBfyUWI15LDAYvWydX0WAbY1DVg6rNDdDNuZ79EqumwFW9
dedupe.min.jssha384-T8Ey+cNDPLcrrNffrttwG7SF4YO3OrIMC84jc+IOwGDeCLQq7w4CvPYDsmLp8t5G
extraerrordata.debug.min.jssha384-fBKgqJVgGO4E9gGP21tURtxmChbjH8PZIxSBDzqJE8zT8M5vtQZldLzMaPctqGhP
extraerrordata.jssha384-ta06NcY/Xjm1Dsu8qpPDVEIv3coBoo8D7qu73e4qBQiU6jbx+RldMd7l+hMdHNzL
extraerrordata.min.jssha384-dYYh0HBOSocxkcLYGl33Z6ZBtB9344Mx+HDMm5V6eqejLlcxMJ0MhHkbTX40TSdd
feedback-modal.debug.min.jssha384-6O88K03F2LHylE/D2kNLPChggLrJyKr6xn4UHuJFk//bxCHSNqg0gx7/bH6MHHIU
feedback-modal.jssha384-V8EeQbwmBP7yDMtHHIqDmYdPJVaMwZWW9dEXzqYD/xtczyAX/k2+FTjf3omadQdy
feedback-modal.min.jssha384-5C90hlNTBUeP+xYw78K99A/1npdxqdfw+jUE1gNqC1rLudUq2MojO0Zdy4bFy8MB
feedback-screenshot.debug.min.jssha384-nM09rEeII6FW1/IjPKl5hRUouGqzlrouVsvDtkTuOxW9V3IbnfaYTDXDAMQAuIA/
feedback-screenshot.jssha384-NUs4V/74r7FU9uAKyWMZ4FjbIyVQdy7zSV2y4MNyZjtlnczo1ky7yinVX1M6zNfW
feedback-screenshot.min.jssha384-euGQPXvYmY+0ewb1yHhy7D0R4aEbwi4ep5w2ZS9ZHizs3A/FLBmp0YkANeDm2g6O
feedback.debug.min.jssha384-3eN5m3vVbmEXuM1UjCDSfWUddqetfWcjaBXOCcqVd8nxfXcgYdGObp0pOQkL+au0
feedback.jssha384-AE47tSJbZ7kL1y1drgee1Cmke2pOG+h/TBOlpO/6z91ZZ1JdSUyDVq3FQlnynJHm
feedback.min.jssha384-D/NhnZvs8XmPtF+EdsLKJqJERNv12DmOSY7qlA5nDx3EQtqY3E4be+73+edIP8/Z
graphqlclient.debug.min.jssha384-yw6WreHWw15QIA3dOYKX77EZfQcV4MaqbbEYnYwrL+GdWwaJ2SDtXaAA+uHRJN7W
graphqlclient.jssha384-PY863VEgGacv7695dWvnK7KVm+SszgZfKASvf1Yhkl9Q9LrhEU6bwSbfDSr7uJfx
graphqlclient.min.jssha384-HaOI9xX64yQILCdKr5D8ZrJMEwzMHXfphn26ugfnCsXGsajbYCnAAzOUa8m/ZAmM
httpclient.debug.min.jssha384-54m0Qn5eUKjWuqQ6cPMUZtsAPqmXJzXDIX/VOvVy+k/s/HQvKFKbL08PtQWCcDlu
httpclient.jssha384-Hm103faBgqN+SYDMJilCBw7Ac547TcvIQ91ZIfIiTx2Y85HLz/tFZaWXXL25SJHX
httpclient.min.jssha384-tCoUthqpcAfdmxB5Uja43AWBCeKRzIYpDaPhz9rodqZZXrXswTqXEJLnhZA4XF1q
instrumentanthropicaiclient.debug.min.jssha384-xtR9bS7Aa0i9PRziw0cTShF/Znb6IGziqTdFDX2+dhtnU4qCK186jYA9oqOO02nH
instrumentanthropicaiclient.jssha384-ywqWB9gE9s3Y7p4V8jQbggDF+emgcgYUdJYOQEYQdjueB6vvikVx2S3Tyt687Jpw
instrumentanthropicaiclient.min.jssha384-HNrmBG+74/SskmQKX/qGxLDii3Nmlpjsg/SPzxAwXxmaeUpsRh8lvlTBj1pN9vdX
instrumentgooglegenaiclient.debug.min.jssha384-RP4dTVITpPc9YfNc8jCmfhd1MqTDvkWziwUk/iZVbDaARoEnkd+KjOV+llckVuvl
instrumentgooglegenaiclient.jssha384-++YTPv6tZDgmMZvMayrDP9ez/B6ih8OJDwP51kCJEwhItLG2YcZjs529W6jMh4N+
instrumentgooglegenaiclient.min.jssha384-kP1a4lyNHhyMUlLy8n9Jp0Wbg0ApotwK3qugQhxGeWaYS6UDKB6Kvp0PUVcrdPTd
instrumentopenaiclient.debug.min.jssha384-FkDrVmvxbG+0hTzmXYSILWkSgr806Xb4uV/JCefienlJxBPxYOzlcEveC+x0YW5/
instrumentopenaiclient.jssha384-lZXml5oPyzW9McJox0AK2rPX8Xl9iLGTS5zAQd/LATohuQU4BdAWgvu+dlKpKTTG
instrumentopenaiclient.min.jssha384-g4dPLiylPZFNzCG+9hU/asZJSLjW6MNt7XIpT27/RHf1tCsGnku5LRmEyqx17XQM
modulemetadata.debug.min.jssha384-58yP84tu4Ppq7nU0ODULXHB8NoL1YddQjPnnREDkgx5Yv+P1ZkA7UwEyU5hN5PKm
modulemetadata.jssha384-VqV/BWsWK2MxRUEG6zihmKH9ZV4j02bN5Zl5chlr2ZileE8C5HD0zIXDEzhIe6P/
modulemetadata.min.jssha384-0MTH6pVo2oCKF02Q0JBjAPVwY54mxp0igfr3TjhPPKjILrsCUwTMr5BuGvJrT/f6
multiplexedtransport.debug.min.jssha384-XvTRi0jpaydPQG9O/1v0crReiXFtmdLXxA62sMLrY9gfT5Pedf/oP8fWgTFPTk4t
multiplexedtransport.jssha384-P5p2EJuUYg45fTnbuJilXUkuSXxlXDR+GPxayqUuk40LYkVcz0ifMW1bCWc2YJXB
multiplexedtransport.min.jssha384-YokG+NhiGjaK5m8ZpVevoo2a4jsizQ56cw8LcKlxL33qpNi1vWMIHCEAckNNP7J/
replay-canvas.debug.min.jssha384-zwz6ErNE3MjcCoxGjyxzser+AGD76L48tk6xsvo3nIX3TGlyie6c5kBYK5GOlmLG
replay-canvas.jssha384-4aZ0TWnQKejIgB+rhPs1FKkK4v4M3/i4EkYXBcsZr7EbxSbJDjywxICbJ07TKdB1
replay-canvas.min.jssha384-MVoJbXZX14JZbrrcxvcNXnon/Mx1ko5dUwuqzBC98WGeQ9OYU01zGoLXWp8I70/I
replay.debug.min.jssha384-4qEe+Bh9VsP6BYMeTh+dqvL1jWtIK+V7hbI/2Jxj62BkJrr46crTAWZOVEmrhL4+
replay.jssha384-LyFKWeN4IsJBnechHKB9Nayi+O6wWclLNijqeeL1s5jc654kZPjUZVQUCUGsyWuL
replay.min.jssha384-dsLPJIAT0Cvb5z6NroorIsxklY5nhnQ16TZ6jDfiEuW93FHr76j/hlag1dOMBu36
reportingobserver.debug.min.jssha384-rjO3qJ+yrQnclvx4XEhel1i8hA9+4n7eSy5lG6VciuPQgPV5BgEEpaNQHUtq5DdW
reportingobserver.jssha384-QADb07acQZOajr0mMZ1Gkqprb62nQspBXQnE4P1Tlbgdi24luJHdQ0XJSOcH8srO
reportingobserver.min.jssha384-BT1cpUiDo5np3AZFEr1rmiS0WjA2+tdc5wCRN6ldn8ggJhIzz3MXzLLRQHeEj85t
rewriteframes.debug.min.jssha384-F8/jM8bvqDvCZ3i4aXW6+0hZg6uVJlMwaotYONNtS1UfXNZyyt3n2Za+stQSqPaB
rewriteframes.jssha384-ziSiXq5v31dIlfWvuRXbyM79QjxLBMu+YIfcU45y7WBFXViWz1t3nNPszyISFhsj
rewriteframes.min.jssha384-s2oJKf/AB0uD+iJ7VlvI6M6UjElwetmGcsLfUD6xUn3oRPKGiBjN2jFXOSt0VUnu
spotlight.debug.min.jssha384-t7jagH0A2uAxD1SeixZjXjmlyc1CUOLdgmIcjZD4C9aRBCXuvV+l2frgDXwA2isv
spotlight.jssha384-9wpWgUhdZblk/DcigOpBwESUCPnH7eqbm66fHaC2g4uMVL+NpdYCVXXFaOb1BXp2
spotlight.min.jssha384-wAQNkW6BhB4hvSDVEQGrIfaWbzLNnpsMOu9pGwtyxVF5OwrIqPtF2C1ymvHODAbw

To find the integrity hashes for older SDK versions, you can view our SDK release registry for the Browser SDK here.

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
Was this helpful?
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").