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_SDK_LOADER_HOST___/___PUBLIC_KEY___.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_SDK_LOADER_HOST___/___PUBLIC_KEY___.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_SDK_LOADER_HOST___/___PUBLIC_KEY___.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_SDK_LOADER_HOST___/___PUBLIC_KEY___.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_SDK_LOADER_HOST___/___PUBLIC_KEY___.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 Sentry for error and tracing, you can use the following bundle:

Copied
<script
  src="https://browser.sentry-cdn.com/10.66.0/bundle.tracing.min.js"
  integrity="sha384-iAlGvM6Q61s7x0jWcZbjiytp6md0G3EqHLiOwoC9ePXpini/ALed/yBFKGj/fWYe"
  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.66.0/bundle.tracing.replay.min.js"
  integrity="sha384-6ZFZNzRhgvuCQyF6Fd59xaqQN291TIcc+Ql34YaP64+VZXY/jQILtwjffLX/LpZ+"
  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.66.0/bundle.replay.min.js"
  integrity="sha384-50E1L8kr1QH21N+GzqgPPPAjVK7kR3CZUrDb4FIGsDMoqPty3l6TsP0B/HNk/v2L"
  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.66.0/bundle.min.js"
  integrity="sha384-rtwsnRY5j8smljaOw72wBKVSXCYaWu7dWy/6NH+Iy0524oU2b5VpFHc83FOev09R"
  crossorigin="anonymous"
></script>

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

Copied
<script
  src="https://browser.sentry-cdn.com/10.66.0/bundle.logs.metrics.min.js"
  integrity="sha384-XuMw6oIWLFP3Fa2yFsiF7ci1NGQf4hp6hxaV1Ar6QYnsjX8Yy1yAT4DKSaf5xpm/"
  crossorigin="anonymous"
></script>

To use Sentry for error monitoring, tracing, Session Replay, and User Feedback, you can use the following bundle:

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

To use Sentry for error monitoring, Session Replay, and User Feedback, you can use the following bundle:

Copied
<script
  src="https://browser.sentry-cdn.com/10.66.0/bundle.replay.feedback.min.js"
  integrity="sha384-RpkCefBpFFteASJbUeUT7pOa/FXE9EerTaukFL/HCQf3+ijkQNcYKWXpHGu3gsQN"
  crossorigin="anonymous"
></script>

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

Copied
<script
  src="https://browser.sentry-cdn.com/10.66.0/bundle.tracing.logs.metrics.min.js"
  integrity="sha384-4TKFOmgJACSnkNFWamcaMEY2i1ZB0DFIT9r4JoRILp9E3Y0C/bDV/yRdIHmU6985"
  crossorigin="anonymous"
></script>

To use Sentry for error monitoring, Session Replay, logs, and metrics, you can use the following bundle:

Copied
<script
  src="https://browser.sentry-cdn.com/10.66.0/bundle.replay.logs.metrics.min.js"
  integrity="sha384-6YkrTjDhIHHAqbipmU0aYj8Ez5vD+EIBs/HrHr7MCrAMmdBGe2uIdKJpQq3Z0Wqn"
  crossorigin="anonymous"
></script>

To use Sentry for error monitoring, tracing, Session Replay, logs, and metrics, you can use the following bundle:

Copied
<script
  src="https://browser.sentry-cdn.com/10.66.0/bundle.tracing.replay.logs.metrics.min.js"
  integrity="sha384-MlqdpM2dFHrKwd6mc1HwG04C/OnkTZc630C3V6DUIaMDACBmuWKoOmXwzZ/HHLR0"
  crossorigin="anonymous"
></script>

To use all Sentry features including error monitoring, tracing, Session Replay, User Feedback, logs, and metrics, you can use the following bundle:

Copied
<script
  src="https://browser.sentry-cdn.com/10.66.0/bundle.tracing.replay.feedback.logs.metrics.min.js"
  integrity="sha384-bTpBsx21HA8gI+uIDGPwp+CLPaSF94aTjQGbRFETmfT/3T93i8KdsSe5Axx6v9st"
  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: "___PUBLIC_DSN___",
  // 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 - Base bundle with error monitoring only
  • bundle.tracing.<modifiers>.js - Error monitoring and tracing
  • bundle.replay.<modifiers>.js - Error monitoring and session replay
  • bundle.feedback.<modifiers>.js - Error monitoring and user feedback
  • bundle.tracing.replay.<modifiers>.js - Error monitoring, tracing, and session replay
  • bundle.replay.feedback.<modifiers>.js - Error monitoring, session replay, and user feedback
  • bundle.tracing.replay.feedback.<modifiers>.js - Error monitoring, tracing, session replay, and user feedback
  • bundle.logs.metrics.<modifiers>.js - Error monitoring, logs, and metrics
  • bundle.replay.logs.metrics.<modifiers>.js - Error monitoring, session replay, logs, and metrics
  • bundle.tracing.logs.metrics.<modifiers>.js - Error monitoring, tracing, logs, and metrics
  • bundle.tracing.replay.logs.metrics.<modifiers>.js - Error monitoring, tracing, session replay, logs, and metrics
  • bundle.tracing.replay.feedback.logs.metrics.<modifiers>.js - Error monitoring, tracing, session replay, feedback, logs, and metrics

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-MFajInoQk4GT1mU/6yxibpy5k/w7mciadeY7+5WuJL0w/MtqB3rJjFNizcD4BOy+
browserprofiling.jssha384-EDPnDd/mWBMaoTKDy4TD4bIaSu121jPE4f8kfYAzv6BhvSL2Jfv/cV8iCmx9OxQ/
browserprofiling.min.jssha384-lBIMeiZEtqK2y5Lr09rZLGoRE0P48CTul1AmuM3kXjagJjFtWgxVoPbEBR5L8XSI
bundle.debug.min.jssha384-7KesdRmLRHapEpGJvhp+ISmfE+24OS50x/MG67EeuxLt1Z2QcXNf4+w66vPkX6fR
bundle.feedback.debug.min.jssha384-hgNtSwUQFUTd63XzMjCqM3sd8DkX76xEkoUejWmhklCKsLxmCuG4LGqOereqOTxI
bundle.feedback.jssha384-08OzgYIZIrynczxCvWuhQ01QM8fiKRODvi/S9ATdloIUXriKjMRXrXtJzY+GWUKe
bundle.feedback.min.jssha384-neB+F6Dh8sf9r0H3mDD7V3WrvSn0CWC4Ucl94a4BBnjOe5mrRTyWZuSAKEmCxCJf
bundle.jssha384-DFeWlSzSsDp9fcccgADPR6ccV4TRls7Ke1HL5XTMKZ5eS0u7pDQu9dkJn8UswThN
bundle.logs.metrics.debug.min.jssha384-gGjwY6l3o34a+RYsFXcR/6k+po34UKryGcXfTUHqrLb40oBeQljWklbdx877y4bx
bundle.logs.metrics.jssha384-j2ebPM4aLQ6mE7c+Tg9fuix0K+kDyymdebZIXDrYwwqsw9FRnwxS2QPQ4PjK+9YX
bundle.logs.metrics.min.jssha384-XuMw6oIWLFP3Fa2yFsiF7ci1NGQf4hp6hxaV1Ar6QYnsjX8Yy1yAT4DKSaf5xpm/
bundle.min.jssha384-rtwsnRY5j8smljaOw72wBKVSXCYaWu7dWy/6NH+Iy0524oU2b5VpFHc83FOev09R
bundle.replay.debug.min.jssha384-1HtL4/+5H7ymymSdODTC4Du7hYqfrER07rdHAtSldsDF6hsSwHbffSWGoLRP5TOa
bundle.replay.feedback.debug.min.jssha384-u8+0Y/Pwenrhja99V/Dym4h96rxiERBm57IQWU4dDpLIPz6UH3hk2K1vv9iGxyeQ
bundle.replay.feedback.jssha384-nLOudsN/aaOZ1VAxgFq7DDNGW8bgq2uwWTZyJNEd0fPpp+i8yI8hpdCv0rPvS7yt
bundle.replay.feedback.min.jssha384-RpkCefBpFFteASJbUeUT7pOa/FXE9EerTaukFL/HCQf3+ijkQNcYKWXpHGu3gsQN
bundle.replay.jssha384-ynD2zDvgtmXWDA/ywGbgHu4BTU14rj3x+gnbxHIfy8kumqM7BqFC7Afkf1LXooNA
bundle.replay.logs.metrics.debug.min.jssha384-VIgElk/0RqBDs64y2IhSGjyAHz7pOcTeRj+PsAALHwRveEJmVFEfZKwBUL5mfvnk
bundle.replay.logs.metrics.jssha384-IR65Alm9b6CDdndKuA6Ymu+vTlLaRE3i0uNZtitOYjie0X4ttn0iPotuoQCO3GVw
bundle.replay.logs.metrics.min.jssha384-6YkrTjDhIHHAqbipmU0aYj8Ez5vD+EIBs/HrHr7MCrAMmdBGe2uIdKJpQq3Z0Wqn
bundle.replay.min.jssha384-50E1L8kr1QH21N+GzqgPPPAjVK7kR3CZUrDb4FIGsDMoqPty3l6TsP0B/HNk/v2L
bundle.tracing.debug.min.jssha384-ghGwwzJWOsCEQfoUzVS0EwpCXgdzCBzzpyUJ6imFHdVIqhba0brmLWLtXqgnlES1
bundle.tracing.jssha384-c6W4aMKmpCfUpzkPRT715Z0nDvVqowFa1qQM3msRjnyz8gIEjo2hr8U9xTBcdf5t
bundle.tracing.logs.metrics.debug.min.jssha384-6ZK+RBdL9PW9H41femTX4ZjKXo2NnWg4OcaRn0x3TKxFrc5/Y2yvxcC8KloVUHiE
bundle.tracing.logs.metrics.jssha384-rCcdUDs6LNH0pmDk6XBH/clPoP3VmYwKb1WbPHCLLl6X4dag/JzYQ+S5GOJeg+mQ
bundle.tracing.logs.metrics.min.jssha384-4TKFOmgJACSnkNFWamcaMEY2i1ZB0DFIT9r4JoRILp9E3Y0C/bDV/yRdIHmU6985
bundle.tracing.min.jssha384-iAlGvM6Q61s7x0jWcZbjiytp6md0G3EqHLiOwoC9ePXpini/ALed/yBFKGj/fWYe
bundle.tracing.replay.debug.min.jssha384-dWBDri8U2/rq4gC05rnLp/9QHvfi76nWxIHHtv3NMeRnwC5PH5CRotejafcz/Ixu
bundle.tracing.replay.feedback.debug.min.jssha384-oTJivzIu8nIHiY0Laq47hhO8CTAjHDr14rm0cFvf5x4auAqmXPUHkDhyT6g3uyB0
bundle.tracing.replay.feedback.jssha384-Ib0HbKO8J3VIiSzbKXNqFXZ6VT5R58UV5oxdIu+i9QxWAETXq48+EOrLw6HG1P52
bundle.tracing.replay.feedback.logs.metrics.debug.min.jssha384-LJ70vay0Po2FVhNeXMWZYXQ0P8Ydivlr23fMm94RZ0/xX5XMxwXoaqpAZipkP5YU
bundle.tracing.replay.feedback.logs.metrics.jssha384-G3m1dPpltX6xaxWYy6mWotgcN6V2OJIPYed03vvrt1GUHIOro79iqgNbxomgYRHr
bundle.tracing.replay.feedback.logs.metrics.min.jssha384-bTpBsx21HA8gI+uIDGPwp+CLPaSF94aTjQGbRFETmfT/3T93i8KdsSe5Axx6v9st
bundle.tracing.replay.feedback.min.jssha384-AVuArs311/RN02ha4wXYJTVGbSNdF6uJfwHo7NO89zAQ9rKetOX8ULTh1UjXLUum
bundle.tracing.replay.jssha384-au7qpYQ/YT7iMsyG0MOL9rgW8t9HLAPdm9ejFKmTqbNC+x/XabgWyCo5STUhzhG5
bundle.tracing.replay.logs.metrics.debug.min.jssha384-JO90tpGJrd8CVg9Yw7qBO0oRqoO5OhUb+xfjZULFsDKwAiTMKLUoDIPTPlSapk5D
bundle.tracing.replay.logs.metrics.jssha384-yBAfVL5kHelf9vVOzZtDuhnUm9dWCSldYGp9M1HSNT1T3EwNHYyTEZQk5PW9JT+d
bundle.tracing.replay.logs.metrics.min.jssha384-MlqdpM2dFHrKwd6mc1HwG04C/OnkTZc630C3V6DUIaMDACBmuWKoOmXwzZ/HHLR0
bundle.tracing.replay.min.jssha384-6ZFZNzRhgvuCQyF6Fd59xaqQN291TIcc+Ql34YaP64+VZXY/jQILtwjffLX/LpZ+
captureconsole.debug.min.jssha384-cRQDpZ0sWnXXAohb0rX9ePMocN2xxEbCt+vrmi523RGyWiVfifB0Yh6LTxsP2lal
captureconsole.jssha384-d5/MQxPiHxiDqphhyC62JY26UdhJ60bf8GF3fP9xzLM4f0ZrRPR1lwHZkkkkIHEE
captureconsole.min.jssha384-pQpAEwqvTQfUxSc9HRv6ob+YH/Uu9ehmH5fE4LhTOCQYLM9SCHRUYjOzTOPnOnl1
contextlines.debug.min.jssha384-UOPesTorDvlTYpwtvVwfA0MAymONLBD48af2722GZzUlhZcMUFt31LM7ERUHX70p
contextlines.jssha384-HTTPng5SXq9cRdCkmn29zEVqTp/1jnZdEf374lz98P0zNRqs8A/C0t2ZbdxPr3t+
contextlines.min.jssha384-GQNjHePk//kBh/Tblana7Gp3SBq6sQnShAzitFLCrtzzed5UfCK0cCgRfuG3P1fp
createlangchaincallbackhandler.debug.min.jssha384-bNIsXTV2YAPdhSb9XkYoDwlCA4zIVz51Al4VYwJOWrL+L/N//x92Mku1tdoLL4kX
createlangchaincallbackhandler.jssha384-kk2dG+4RfXxYDSdKn76hA4czqSmIpuJ+pbKU9/ZXzUEX2gQGygY7QsLppuHPOg0+
createlangchaincallbackhandler.min.jssha384-gMq6MuCVwIf5FOJ0OCLwkJwnQlJNfSdwG2rfZNeqO9hQn1eZxQfgE/o0k+AyYuRG
dedupe.debug.min.jssha384-4Roo5G6KrnhzgZRDJ9wxI8EA5Gsphpcy1TPid0dfJGfKInC8jFIzWozFD+sn/bVX
dedupe.jssha384-imsbYjdCVbEXLJJrnSoUd4XAAx4A9jzz6ooLEeFEvpjuoVm0eVHzHcIr2UWDL0YL
dedupe.min.jssha384-RO4TYK99QF0odco8aXXjN4M8v3qpQ2OttQijBor8GxaRDZA98+BvBaacbzFVvsYI
extraerrordata.debug.min.jssha384-m84SualpJtxDV5KV1u76qd72iCMjCqDMkZ5oZ+TwFD9Vj03NSMC+B+IFXM7wgvLr
extraerrordata.jssha384-wcqfLx8XnAm5i3QPk1g7H8g5H/Uj1xIC05A98+o9Nfzco3rZahnGiDNhxqdJaUrb
extraerrordata.min.jssha384-Savw2vYPVDWrSJYgOMe5jIy+EtOV2V2R3CfLvuqVBHdQEMWSIuCXw6kgXibJ2MKA
feedback-modal.debug.min.jssha384-nh2OQlakckxRbnIYi2ORuQgsPWztG1Y4Vv2Tq+AG21SLtCD+z/QgRa7KtBX8Vjl9
feedback-modal.jssha384-xPTTtt1iNQoJrcbyj67Bws6bXSDestHsAP3xrUmaLmSoReSSSxE2/RZB2hKcNfa4
feedback-modal.min.jssha384-EdXkWvLn7gSSqjvL43/gLLyPGe2iHDeEgiQdFLe2nrXUhpzGrTioiokA6HnIzdS5
feedback-screenshot.debug.min.jssha384-ZJ3aUwoZfoyq/6sWPi7rNWthJE+LjzLc76A57ibp+fmneHcZUYcHubpf9QCbQz5+
feedback-screenshot.jssha384-bYLH2h9ZXSz3Kza7dVDtcQ7ZgeKMLOdQdzRYBNECCSzrSFjeazYzFrLVCikgIbwX
feedback-screenshot.min.jssha384-pSHqFa7uH+aU95Fkrc1OSQBfOqOhZK5GW5ZYE9syaDo6SFswb9EAG7mu/uE6Iy0l
feedback.debug.min.jssha384-H8nrD4qc0z4djR/KbsRa4MW2pEr5sTYPTv0lD/lwWI5qkixB4UtC62FSlv7/xp2k
feedback.jssha384-evdvhvV+mu2xK+TpTy41p/I0aezLEVWp5CG76b8HmphbCDqJbOi1fVAJj/z81bN0
feedback.min.jssha384-XIE32TxE/H7ho76MwGKbpPtiIB/9waO1VVow67qFxylsCjnHSMTpSdKzdQpDDYPy
graphqlclient.debug.min.jssha384-GxCdGOmG2Sya/HLtx2UdnwjKrzG6vWWHdj2qKh1VT0htSdfVpIFj/VkExjs7xUIr
graphqlclient.jssha384-bvztDCPLXzYlMrOaqOAniWmuWmNO8hwULbOyy1/IxSMjhSDtndM74hSDFQi/5VLZ
graphqlclient.min.jssha384-Tob/Fjgj4Fjl+0Qk6zSZqXPHi1LWwNG8GsT4kQ88Q2VKqFJI32kwQxjqKwUaJZ7+
httpclient.debug.min.jssha384-EzgbOEZHSZdu7u/d+kvr10oStPgzzcIKL61BmDBhbiA9eApCYKGovRu127K5F9t3
httpclient.jssha384-SeuM71bZnCZ8AFga6zv6loOBsl1Z+GgGfy/L9lC/KvE6L3HjTmslPEUGC2DEzCfP
httpclient.min.jssha384-b0os2+P90Wd0pm89E3dUxnh2zghPBgdBY7rBKKm1zYDmPTyXye2RmDeieK20VTVg
instrumentanthropicaiclient.debug.min.jssha384-uTq0dY+I5Y4r2OY8bUctmXY63qXukjF9jvLtNrMhd4j5dSxExWuwl1uJs2je56UN
instrumentanthropicaiclient.jssha384-HZ2HCXXvqYtTH3dOqZOb5UJdCyQAeXn/rBWnPpON/bQdt+0+YObiOGhdOSxhMVnH
instrumentanthropicaiclient.min.jssha384-RrlFtRZkHhY4WpmYuwuGzysCkQyYGilTspfOqu+0r7E5qKkvnnONnDK5Q+ByBLBO
instrumentgooglegenaiclient.debug.min.jssha384-J1WLcvqL/rYAMf3s3OcEDXYfFmLhBsbeKH3QQaU5khHiMDnGlyRlKxYOajD0SLz/
instrumentgooglegenaiclient.jssha384-pZDKvXAMb8grZ8WUBzEEiVm+lX3EU1tvB8a720gCgWI4bQlfoAxKSiWCqKwYahge
instrumentgooglegenaiclient.min.jssha384-HZqwCbfKp+CK6IxPHalOauXbHDKzEgnzYfVdfzVJKY5BzUysYBe3AuIfH5zXVLGu
instrumentlangchainembeddings.debug.min.jssha384-ghU6ibyL+RUo0L17+HtzdGhsTwvSz4qGbEeZJh37J4mOAsV+6u9W2L62CqfcM87V
instrumentlangchainembeddings.jssha384-MAHVcQZcqHgzjesFkGpauIZD8Tj2hsoUFMzs47lDVBSzhHpuZ7plqHiXOwGL1KQL
instrumentlangchainembeddings.min.jssha384-RdBCmh/s2XGNYltm8LTd/kTpGrk31Mzm8i0Tr9dWdE1MxtpmFozXMj9FHNEgTykb
instrumentlanggraph.debug.min.jssha384-hR+Xzqd//Iw7vN+AfqPLMiz9BVRO2Nm7Rektj5ioJsVUcdrj4vq2tWPjZS0O/Z9z
instrumentlanggraph.jssha384-/KQoitaHQJu0wwL+gnEKSj7ZZz9W8nXFiqzruZVyaILijmLnaMrQG2nLeOhmLJtF
instrumentlanggraph.min.jssha384-eAsxxbXoWNju0Cj17tAAxUKWb0c9IrCJCeuRpPWC6W7loxeiDQjVmwgCgK43KjP2
instrumentopenaiclient.debug.min.jssha384-7q7bLLx/qBgV/dFkdVyApHMudZr2+G7JviPz9VoBByp2egcAAGVBrQl+/RMMaLOo
instrumentopenaiclient.jssha384-Y8jkpMZGg133vndohaZ3M2N6xYyfd8rc6QJXIl2WbJ9Fesh3iMTbAXjNF32uxGw7
instrumentopenaiclient.min.jssha384-2eMIs1K4XYGAeMGO7zRGK7mQFwa6geNMkbFApYNYSjH63PIkz2lZfyu19LVsRg4g
modulemetadata.debug.min.jssha384-EhhwGmUBuoDpJRHYTv8VC+44qPLkDeiEfPSjym7juV9fiTDY5gui+Xrki0tvC5Yl
modulemetadata.jssha384-yZuXYrkF+oPmjqbpFkcVFcZn5KsYvWMOpH76q6NgVRqTAf+AxMl974EbfLnidTIw
modulemetadata.min.jssha384-a+Mt4T1o0HsQiozanYhS7Jq5x3NHfxuk3fLSi9mL2ezG56r8lI/8y+aBKOcTzX8U
multiplexedtransport.debug.min.jssha384-wLaVkbt7OXTsMm/bdBf2tJMHQmzqIA+FVjqpnbg1Py+noK6RB7Lf2mCOzkpM8T2I
multiplexedtransport.jssha384-8zzZ9p44BdFmH56XgMSHgV5mWDC4PPu23Xj9Zo9lcWzGpJNABbrSBVdss70URMxW
multiplexedtransport.min.jssha384-feP7gYyp5eE1+61UblW68T2uJIV/e6hTu8+eEkpEO7PDs6OjHu30zwWIZYs0lhGt
replay-canvas.debug.min.jssha384-6CZo1qU/QXjpuBwuQnz7wu/lvjPemqWdkN7h7Svw4qg9ddXIJRoCx3Ym/KlFJ+N9
replay-canvas.jssha384-GewuR3NusDt8BLKxRYVLdPhumikcxGnFW/DRBpa0ujPRwnC+m4SOXYMyBfFxA+ru
replay-canvas.min.jssha384-vXYfjsMrVUpe182clOrBLDdJcbuOGZhS9QMs9l4j74SQ8gJHCdeC3OknsHJMi2C/
replay.debug.min.jssha384-DWUWZMo2MqoE0eBmihdWfuDzJr6+1+xJwAc2RE+b3iKHbycKKMz0pk6lyAapKCEG
replay.jssha384-odeoZcsKXV8vvMyncWz8bVJvw8dLpr8O8FViSbMC3Sx8n0VOivno+10tocULjDIZ
replay.min.jssha384-NhkFHj3/O/syIgcwn9MFi6kwWnYsqSegSZcclCukLVO8Q60Ids6TnzL7+RcXRmLi
reportingobserver.debug.min.jssha384-Ryy/dzS/FtlbAXGPCbV17TMrRBSGkqb/o/utL+qvDo9mkKgwCMkXmVhkj9RLN7rX
reportingobserver.jssha384-WWdjXNVSJrqkU6f/t8EUr9HqhIOlsKBP5oDxroAyjGiGGNEpWUYY8Wrc2Wezuf+x
reportingobserver.min.jssha384-huhZS3LSvVIF0PF8DoY7Sb9BSLq91GaBbta5FQpWzAu7ij2IGxBNxhhDlb2PJUsa
rewriteframes.debug.min.jssha384-ydOpQjagzHa6TEs4qV31E21Iq4oN5wO6tfJZ/Nc6/XZNw4Ss60jT1nvt6ZIbHhtT
rewriteframes.jssha384-c4dMSzoRO7+wh9gAqrc+8JsHIMc0MpWm2AmCdO1BhQt/IuDl+cpmozow+Wdtsu5m
rewriteframes.min.jssha384-EQmz8DxuqMfjyP1/74prKB7fLJNRXW02p21f+kIb0AMyr0TVRIFI5KkRHNp5+TVk
spotlight.debug.min.jssha384-LoWxWEDDhC4vqovnX77BvqCIVb5G2PSHzwn/6lt8u1muX7+zZ25j/zBo47rfi9wc
spotlight.jssha384-+uD6GC2rz91MFqSbggh34+RUxcBd2Z77IvcNfsM9e1T0xyZGlD4nCDc25JZVEIf0
spotlight.min.jssha384-ACLdUx6o1tfUaFbx4HUlkYTmobE76KA34dORiu0tGvQuDMKLRF1Zpr5lN95X3j0/

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