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.20.0/bundle.tracing.replay.feedback.min.js"
  integrity="sha384-qD4fuccWbiFGmmH5eVKOPNI0nCnHJkHtLX9DYDHPeB0k+nhE245Gid6Q3rgShBok"
  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.20.0/bundle.tracing.min.js"
  integrity="sha384-+9wUXHfFUeGwAnEesSxSFwKwBHDbnc32jfpX3HN0aB9RHa4lbS1rqsSnM6DI9/LM"
  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.20.0/bundle.tracing.replay.min.js"
  integrity="sha384-qhDGdb4u3FN/XJ8yWTLkC9EJNFz7j6zyCVkCHhaAqpW1B0IAjjYUVKdDD2OGym43"
  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.20.0/bundle.replay.min.js"
  integrity="sha384-QH7NWloZEw/2nvjwneFN8YMv7jlFqZpk3Tnoo1DsVe4+NXXX+G4L9LyXwNxcjWyf"
  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.20.0/bundle.min.js"
  integrity="sha384-du93rFB2Lg6+XlPbc+5esCkrsqWTJf2Q4125iC2tC4qJm/yk6vtLiEnBfHRf28mU"
  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-rFzFB/Ot3CKvBP2ogMbiGTQR9JlIb4i8JQjR2OXs+ZA84WTNJXOE7UyJvewV0sCv
browserprofiling.jssha384-P22Az5qUtChc0zUSKA1CD6vLJUMBqxeh36wX8v0wkexpz2BO4IiqOqCQKKlSqI2r
browserprofiling.min.jssha384-9ayKkmn+L516a66lnKjqNdpvJ0nneOp2fhmw+uREABMlNGvMbNU6DdfymnPeT977
bundle.debug.min.jssha384-Posf2KYnqVgVz27x+Gi97y6iwD/spm+XfQFN8CzFtVKGxKEIkHGCCSkhWqhq3C/N
bundle.feedback.debug.min.jssha384-okdKKY5R9vW/M8cqfUua2IMcrbRGYdJlwS2fok8lMIQYtbuiIisoodOJk35lYSQU
bundle.feedback.jssha384-u06f4QWN8B0g/d3pJwHSyXcUyBtcxk2LmWxop73VyVeXxr0wr88TSlhLwD46wvj8
bundle.feedback.min.jssha384-+PpVm3QjHwTCTsomIyNTsmeO/s9j0vj7F15Yt8Jh1wkAVrFAszY6CdB0cia4raPW
bundle.jssha384-3S0p2WP3mn94xIfZY45disR1JZSUzrc2+JygOb2we1hdLKVtam7Qnr8kCjEbPoyG
bundle.min.jssha384-du93rFB2Lg6+XlPbc+5esCkrsqWTJf2Q4125iC2tC4qJm/yk6vtLiEnBfHRf28mU
bundle.replay.debug.min.jssha384-pHEjCOa5oLqCrjyz5ubjO+VrVfcMKqIoXmoUQxwCQoTixpxzhFpH63G4Y/AMh1FY
bundle.replay.feedback.debug.min.jssha384-UGqj146Cqca1k7JM/o7/bElo2BUx98ZipqWgMwFV5lFa6mWgLFcOdFk9vFcROD8e
bundle.replay.feedback.jssha384-XmpXYUjZkEJjEYsKcPmjJ8TcrDV6juagILs6uGi+mhiryPUHqKdL8A8UpshsGArq
bundle.replay.feedback.min.jssha384-XB316y3NyOkUAS4jYj4ug/oXntO5ahntVRmVg+GhmKyKhNddeHVV39rjB7XSjJOH
bundle.replay.jssha384-qhvOSX3A0fiLpR1ElL9VTJWz50TECYn58P039GybmZwPR5y1N6Bz2cBU7Zkz7zWa
bundle.replay.min.jssha384-QH7NWloZEw/2nvjwneFN8YMv7jlFqZpk3Tnoo1DsVe4+NXXX+G4L9LyXwNxcjWyf
bundle.tracing.debug.min.jssha384-ESn2xNuxmLFhyTUlg7l0pdnFAqjS7F6614sVqDXdO45RLa/QLDnsuRKB0WCQ4XfB
bundle.tracing.jssha384-dwjr7LhNYjQec//wFWHEK2qBd1MuxwO+eApcBbUZTjfAN2oMGHxacD02h4h/LDh4
bundle.tracing.min.jssha384-+9wUXHfFUeGwAnEesSxSFwKwBHDbnc32jfpX3HN0aB9RHa4lbS1rqsSnM6DI9/LM
bundle.tracing.replay.debug.min.jssha384-8DOwy8iwJURu587Jm4PGiUtNSXq7xzCVQQCZ/dFy7F3XszIUcArdsr7rUrIKx+jI
bundle.tracing.replay.feedback.debug.min.jssha384-NC4sM1K6u42DP9wdiF/LrharLZYUozNEOZDYZbPGVdOMnU7S8ADsTSQxo4h8+69x
bundle.tracing.replay.feedback.jssha384-2x3xWhcbGNkxn/58hfzuXrtVS95oF/nq6uGS5ALjOxTzavJL7Jm0qelKdPHGgIvW
bundle.tracing.replay.feedback.min.jssha384-qD4fuccWbiFGmmH5eVKOPNI0nCnHJkHtLX9DYDHPeB0k+nhE245Gid6Q3rgShBok
bundle.tracing.replay.jssha384-6sn4k768Dx87bANXDPFlClfgYbZtmpvLFpQNzyFJtz3O1mnrTvWa1k85tvBQgryk
bundle.tracing.replay.min.jssha384-qhDGdb4u3FN/XJ8yWTLkC9EJNFz7j6zyCVkCHhaAqpW1B0IAjjYUVKdDD2OGym43
captureconsole.debug.min.jssha384-Ds4VMjEapzh8HbXXTbnNxJvn6ReDXuPC+8DfD+bm8vUEYQ5m/tuUnIaTh3NPwRDy
captureconsole.jssha384-m8P6UR6XjC4srj6Lyx5BA2U+JgU1u70t885CQfbhOZntKNnrnfv+1z5mpw7lQ7Ko
captureconsole.min.jssha384-YOgWhNUIzLTcBR56ntCzsSQF6ilttt3Eya/I8G6PgvcYAbOw1LyiDHUSyKek2KXe
contextlines.debug.min.jssha384-2fRpPFZwrmQzHqghbbPv3Uub+Ek2EvDclfyJV3hbVrzk+49ddnE/qIdQtlw/frkO
contextlines.jssha384-DmFKkbhni7rIiDaaDMKVz6pqUpW/sEHp8RoOL0eSTCG3tlvZOf5NLpET9+ly2DwK
contextlines.min.jssha384-4Xw7cAfM9pY4lohdX/q/fxl9Z6oJWrZz/l7OvGJcQdAIPrpAVs1mPirYuoZ6eglH
dedupe.debug.min.jssha384-wlWSgVlOpJv57xl/8/+E5gsE6ssHgnSaNrPwNsSyOIVQFWpFWkNUQyuUzef0F9oe
dedupe.jssha384-WyL+W+SDoFb0K/K0PJ2ja8IAxxqOVBIPdrciAy+XhIbrBXYlwdKwz4P4RhezSnX4
dedupe.min.jssha384-6vTSUPPHBDGjApNYY9NLyyVQLSpCfFbpAEIJ4TkKUhKkvS9t3Isxqd43Xmtl/9Fl
extraerrordata.debug.min.jssha384-u0VJeUeydXopC3dPYZb6Yr5OZfPhq5tpys+WtnYeB0WNzYpvCtfFnfF1t3FMImy4
extraerrordata.jssha384-Nebu15lUiqtlGn8AxpMQYoETqOFO1Mz084m4KYHWoPZqFFXEHre6hZs+QhBnzl2N
extraerrordata.min.jssha384-1PoFodtZyCs3VgMh5/tXwHnkcRnjSUw3nZ08Pk14HbfwtVV26ZEjppKOUVjxTAhK
feedback-modal.debug.min.jssha384-EZ0d1OjSmXBCvyq9YwvIggZnXblUkx5uA9ZWRjzBL4ASIfN8s5PUS5jXAaCreeyG
feedback-modal.jssha384-Adjox0QCebyuEki/DZXVnapB+Xs9y+DMN16r/KoPvrc7t6YMTsp7y//wA344rB0h
feedback-modal.min.jssha384-cDH2LuqVME+eaIb8ZkIC3QCBUx3N44bw8TljC16HaYtXni0C3UhnbDTa+0E7o5Jy
feedback-screenshot.debug.min.jssha384-7LPjTKeKkhMbxutohGDK0eWIu4+iVh/JwhpyzjZzIqKOy0OYZ8I5HWcP3HRKWiL+
feedback-screenshot.jssha384-m9HE6vUP+8NVjqb8Lfm7w8yuPwIwoRQzg9DH6tqffaukSlSwYeeXZ+B5iKS0bDdd
feedback-screenshot.min.jssha384-YDRJL8Fqgcwlq2nvK+mr2j6I1rxswlYoY0J6PwRBS5GTrn7cfkCVcbUHkFCtf2yt
feedback.debug.min.jssha384-cCwG9GmSCkpnvPqRVQo8uZ+dwFdbMI9/FZcoKvXoCNb1Xa/I+nYJE557rQSX/FGj
feedback.jssha384-YXNlgzH5Shce3VuC3UMURlVNdcBcG2CIcAiUtNM2MRHpW2CPZTlLl4alkrOEET2/
feedback.min.jssha384-0thhpIQifWir8SLcugHXKUKLE2nX8ux2W4gR1HTgUCWZWmUB5ukYsAqSelCxtQXs
graphqlclient.debug.min.jssha384-0SSp/KW69sUdJ+IH6oxgOAzvOPl+9itE2+jtkY05kQagfJ3S2bnsCxELVcNaa34f
graphqlclient.jssha384-rgeL2BJfPTYFeV853yd2IwFu3++2dmbKlbTW0brkwsQx6QKmEXZjxd2BGAfVi2UL
graphqlclient.min.jssha384-R5BZSlvT6S0//PPpbMrdP9fyNLlp61CjUXeVrGoCJYb2rUxVk/B48+getw1XqLEU
httpclient.debug.min.jssha384-hLUhpP4Te2E8qXlNuUg3gwkAXrl0FYjneYtxSN20HEymH+tvy8/aVQwXyoimnIzb
httpclient.jssha384-2aEz5qB2LaSnENicLE/sHZzQD2Rsyl+NFAdo2u/VKzhAMbeU+QJzOeBeogQ1ZPYf
httpclient.min.jssha384-XTXgzWyEHfO6DaYZVeFLPQb1DPoy8WSc0kHRvVy+CbQPrE5qQAt9KcYwk54N2Z/U
instrumentanthropicaiclient.debug.min.jssha384-IBE4jCbImwQP9XcE8utjba4b0L9xUIwJp7+dGDMaATyw1UHqOPRicryFpwNddymm
instrumentanthropicaiclient.jssha384-6EMjSfDke9tUT8hgE1s66llFNxQkydhQI/I03TP4mHlp7uHCJnHQOMTEO4Pj3Xpx
instrumentanthropicaiclient.min.jssha384-W4blLIl5zFjFqU4YTaKNOwgu9nqNd5xh3QqrmKs+6yx1pR9HwVIiXqg39Mpoc4/i
instrumentgooglegenaiclient.debug.min.jssha384-5dw86qEPpUcrBcifVzPU3fnhEY3V9ALQuaserLCpAjG4WEAPEqRkpmUaPjypvJte
instrumentgooglegenaiclient.jssha384-ZLKqtHbyS465GeefY3SyaIukaXMlZWvBvngYXpO4l5LyOAJdjzgRCpYMxJJqPJ8v
instrumentgooglegenaiclient.min.jssha384-utcBL6TW96NrF2nin0f3MAXDZA7DODnzKBZMGODbZebNPqp1UOx7aik8VzZbwlZw
instrumentopenaiclient.debug.min.jssha384-NP+0k6nj06DW/wdOv+/K3a0+Q4RwQlyDoed4tYbyFghJIOAGK1ljZVe1TyD5Mw+b
instrumentopenaiclient.jssha384-Ry4TnqTbARYXH7/LUs5qUrIzwU50yDzbunjh0RkL/N2snMwjzTQL+p1KaWeG60Z5
instrumentopenaiclient.min.jssha384-GD/MIgDBr33knwJa6k0/tWf9SNQDJG7cPpdCbfRRDLHUxCW69VD+UbBytYHL+NfO
modulemetadata.debug.min.jssha384-NEU0da2jhP0bWp8W+gt23Pq2K2YwjlZGHmhJjip3vXTydUj+codoWzUIlpnpVCg9
modulemetadata.jssha384-WOnS1034rL5wC6wofsE1Z3xVylv8Hd0kiAwnDCwHrmMWooCu1/k27qW18ST0SVvx
modulemetadata.min.jssha384-U9eodiOJKSV/9/2ntwNmSWE9GCcjHleAYItJTIWbYhalw/D0AdO/1edInWe1naEu
multiplexedtransport.debug.min.jssha384-WIH6gn68d3/Vf+bC1o/NyQMCoD6SPLJmS+jXqWU+hjdACd3roZqCr79mkUvRGUif
multiplexedtransport.jssha384-2+ERwL0mXSuqzT+5UNBdcn5/W952kRnMl1YmMhhuCu+im/spOCRRSGkPxYXFl/Zg
multiplexedtransport.min.jssha384-D4WW0BX/Dxq1iW8vEB+oCs5TdnSTSKpkRINdcMR/fi6bMY6l2zLUNFx0EK7agfdK
replay-canvas.debug.min.jssha384-CmlVnceg0AUm4Wme71nRwxLUK4EQure4SABJc3CtEQeRFzleKJa9YMY6iO3mzvPY
replay-canvas.jssha384-iQzTS9PPd0zTnLsbZYAjHd4PGL1NAvB7myveHnGGaOvFLh2BMWeZH1wn+fDz144R
replay-canvas.min.jssha384-SqAoF7SVzByReSX93Pxo+ppA4mKn2vLjrTwpbsCyA5TBpTo2IG0r12RdpphG2pO2
replay.debug.min.jssha384-37t9OkMzmnEc0arYTVc31+WuIEzlfgssDdeD8SuPJ0mwXCmsJPy/KVVRESarNhYB
replay.jssha384-/ksLpjeGXfKYltXEiVmV5tRL8vDJoo1DFPVPBMVqcGlgF7tsiSSY+gCSg5Um8Yk2
replay.min.jssha384-DKPhEHFIlxbAflEo/COT38UIZ8RtxVbrwUfe3RE+5XSzB++3MFW0Cvuq+QruXE3D
reportingobserver.debug.min.jssha384-lPNsQ6e8Cj8rIohDd8fa3dYJhi3siZ8Jm4To65dts7KWUWht3X4dCZYZIhNGKqBP
reportingobserver.jssha384-NcXnJP5vKXPzXnMMLO7Y/urWoTsms++QeH71H+98R4q83bKDdrvsdgsa2SDGKqw6
reportingobserver.min.jssha384-gaEhDfRMm0+GEpcyZgbdRxH5QmKcabcQfQvnnGbK2GTI1QoEJU+c50Mo4Yh7ws6d
rewriteframes.debug.min.jssha384-GIVuSnMqmcDkxP8qPabhK7zlfrMcBBhruLX0B1/hc9sTrCU21dMaFkMaUmw2aBvr
rewriteframes.jssha384-QncFTmLEhjtRlwaqtBFczjX8bi/17Rg80t8NvOzscABnA7YVfn6QPQ0Q7Q4Hug+v
rewriteframes.min.jssha384-P9k9dB46+K2GEpYBAu1tb2erXbFUH9WEU/jzmTAhORAMTzTuBaWhyfVJaGEKFZPw
spotlight.debug.min.jssha384-AazXui7nkGUzsBeKjlgiQCg3KiGYuia2WOoWWNG8bOe3aUivNFIrHdw26Bv7dql9
spotlight.jssha384-+Qu/QVhBOezAUHNAPhStcKrkQKuOp0S0ykxhqAX5Kb6fdcPV/VnmsoxXdDEdrbG7
spotlight.min.jssha384-XQ2+WGkIJncFu3Mkc2ArJLX4Sb42fo3cjw3JSPLi0XiI8OJ1iA9Zu1LS0Untn2Xj

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