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/___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.sentry-cdn.com/___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.sentry-cdn.com/___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.sentry-cdn.com/___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.sentry-cdn.com/___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 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.33.0/bundle.tracing.replay.feedback.min.js"
  integrity="sha384-G1GaPdNkAfKcRzYlSEWSyWwTJITEUMS4mVzBl/Htjbh4zzd7fTcGqUaGvaUHzcU2"
  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.33.0/bundle.tracing.min.js"
  integrity="sha384-21WP48XUl0e9nvkvQisjpRRalHv5ClwiEQ/YfU2vQFVaxOeICj178RXtxEKhEPGV"
  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.33.0/bundle.tracing.replay.min.js"
  integrity="sha384-JTbOfYHHOicUOBd0PKNCPmKB7AV0dYHx1Ww+FUVXhmEiDOOKhphUg0hl7EhP1XFb"
  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.33.0/bundle.replay.min.js"
  integrity="sha384-vYshRKpon+c5r8pvsfp/c9qBgSFttWtjzAP18U66K2g55FIdRCBuNBZ5I1Ol4Bxy"
  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.33.0/bundle.min.js"
  integrity="sha384-6G+j7+CYfke3fn9Yb9h5FcsR8zoYGyrZ0ehTSDnlNhANe0WGp8KtXjN1V5MOv355"
  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 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-XzyK3unjOMtqMllB/x5hLqaBxNvEk5EpUBVLpNLdL+bwvaLYnBKs0InAtI4bjYRS
browserprofiling.jssha384-Ce4HU3YJSvBZzDea6tgB9DmzL45U1QA84sAVBzGvamhhQmcJlqKhGxpCjG5DFwzJ
browserprofiling.min.jssha384-YCrYbhZSY9FEoj4g3u0u/63KDNCE42VwKR0XwolAy8tqAzdQdKKN/d9f6/pMnJbb
bundle.debug.min.jssha384-mwAA5PJOcUKkgGz4EYJYD/yHdKzzIJgzxAspmyQaL9W1RgLisW0C4AXmFDc+KM2C
bundle.feedback.debug.min.jssha384-BjNOSijT+61fbX5ybVaI2aodt1+26B3iOTNaS68ORWnB801lqeYSKuhRp6/tDX+Y
bundle.feedback.jssha384-aT9C/dW9wJDAhgj038q6WKDwleVVZ6GQX9lbWa1EE9+xow7cC6d5CZYtGAohWWBb
bundle.feedback.min.jssha384-O1cOwev+O77L0HLPcdHxtnGgc80GVqQobgFtIudSdzgFm2Z4vawXVS2diAG5He8h
bundle.jssha384-KsPlL104/+ovB/l3vs2NxmYarf78mugXQESVcwPyImwsc2bTBiAZnowrrARaBvJS
bundle.min.jssha384-6G+j7+CYfke3fn9Yb9h5FcsR8zoYGyrZ0ehTSDnlNhANe0WGp8KtXjN1V5MOv355
bundle.replay.debug.min.jssha384-hCuv8c6kbSx4K4/qFtsxRscfy1lG2HOFe6azQged08K96hG1MQboVZS0f6IUlaNX
bundle.replay.feedback.debug.min.jssha384-8mJo8mHwhUMH6ijnPBAN5cijyRoQRQXJTq0JP66i5fH0eHOncGWj7doi3YjzUwgV
bundle.replay.feedback.jssha384-Kna7EfZSH9iRgwtXKcSsj8qN24IKN9T1RvJS0wXrFDCVGJuaJR8ccDwtivwUscTB
bundle.replay.feedback.min.jssha384-+vZJMgVpoxr78FAhMox4kh7m3fNuHhbvcYEehgk60biCtI4WnFWwOrcuMNVTF+vN
bundle.replay.jssha384-aYxKiLrl1NuDq9Lwo7GwLuPtKQ0I5dykejNib1I2jddWFm0jaKBhe3RY6e/tEvsl
bundle.replay.min.jssha384-vYshRKpon+c5r8pvsfp/c9qBgSFttWtjzAP18U66K2g55FIdRCBuNBZ5I1Ol4Bxy
bundle.tracing.debug.min.jssha384-RPjdXKNxuviTT6iGUzHdjF/EHZmnHVIkxs9+UpAIlo2TxXT5iQiq3Cj6sqZLyVFC
bundle.tracing.jssha384-p9UHtm8BwOtYSp9aY51HXOdJl+2je9JZ6/QJZ2hk38WX8tn3VsNarGpguKfBAG9a
bundle.tracing.min.jssha384-21WP48XUl0e9nvkvQisjpRRalHv5ClwiEQ/YfU2vQFVaxOeICj178RXtxEKhEPGV
bundle.tracing.replay.debug.min.jssha384-RTxQN1/Bdkl57iaOpakKvovcxjNshep59x2ZBKBQOMUcc3DzZ2t6Fts5RjmFoaEg
bundle.tracing.replay.feedback.debug.min.jssha384-7XyYZxfK/Bn5iQvaCc42i90pU/6YY9O8bSSB31cHpgn45wZoqdTUI25BsIU/f8J9
bundle.tracing.replay.feedback.jssha384-09/XZXIFCAS2pBkNiZ8Ui8ITY29q7tLhUzxp+Ium9ieL0umnTaPR4oiWiRkl6ExO
bundle.tracing.replay.feedback.min.jssha384-G1GaPdNkAfKcRzYlSEWSyWwTJITEUMS4mVzBl/Htjbh4zzd7fTcGqUaGvaUHzcU2
bundle.tracing.replay.jssha384-RkcrTGv3b/WKVce3pnKCX+uka3bGgydQrH4BQRlt/w0EeZyxla65ONxfF7Ja7pjE
bundle.tracing.replay.min.jssha384-JTbOfYHHOicUOBd0PKNCPmKB7AV0dYHx1Ww+FUVXhmEiDOOKhphUg0hl7EhP1XFb
captureconsole.debug.min.jssha384-nbhjMh9IMLN6YGV/5PzjikqbTaI4bdC0TJVt08Odkz7LLzrdm9ER+w7EPn5/Aly9
captureconsole.jssha384-0dq0Ajquzdfj6GSJmBT555jYH5mFm81cjYHWYwWlWWZ2cpgxixN16kQuOOWr4LjG
captureconsole.min.jssha384-e5dOmaQd6dK/nr8+MB7zpg4CKXSxBF0AjQeP4bVYQyzM7p0Qwp8nxbp68w3+8lCv
contextlines.debug.min.jssha384-2zB0J1fbDduKCy/qJw0aPLqnWQhmElLb4M4zCX26CQh0V++9ITZ5YllvjtETIz5z
contextlines.jssha384-SXrEpPeMghq9vn3TcyDoOrNk0LsF+04f0wfl+9D/2pGoB732aoQ/dvaYWzdbH6pk
contextlines.min.jssha384-nvaTAKB504ecxGa1q7KKhpqLEVFlZ6tF8AgRNDuC3VofqN2J2xL81r0BnTCW2i6x
createlangchaincallbackhandler.debug.min.jssha384-Hpc2qVG1oXMUc5rfXWM1zwDFvIcl0s0WMrr2xF3lWoaq9YwSdyetTYJR4ODlZ7CA
createlangchaincallbackhandler.jssha384-9E10u3zn8mFR+kCBwft4SI5MKNKrSkKV1ghSlL/M0jxy3agfG/QXpszzbDkeO5sB
createlangchaincallbackhandler.min.jssha384-SqkkgRNKK+9Ro/UITc38oHh93H8wuY+p7jlTDcZIHloJ0WGaqQaSMyCvn6ZOePQS
dedupe.debug.min.jssha384-KfpPFkCwPRGY82MLOzsl2lYr9qpBdpefroFwrpggG2UQU3fI9h/KYC2AMbShVUrH
dedupe.jssha384-8B8/L/DSiBCUm0njNxtC9kok25G7AKWaGi121W3Td/tLdCaXmeCTsYGU2MNXDfE0
dedupe.min.jssha384-/N/u9N68eEibuC1o5/IUdfIG+O02U4V7CbtKr7IKn3XqcJ0JxvJFtLgzlmxabLst
extraerrordata.debug.min.jssha384-X8cS9Z6ykStGXqRwUzuafvI/ZY+OYLUbDLhlD5Nyk2Diw2ng/nd1cfm5Ydc+4BVj
extraerrordata.jssha384-9BQ/SKfnGzpICIER6d33ROABeLKse8KrrX/YIuDSorfNurRPTR9SIQPSKz30cvHu
extraerrordata.min.jssha384-j7bT1+hjuNwQ4bXYGMwv/bRTazRnavKFOrNrdBU9vXkKXe0UzxL2sK1Ryt0FVKoP
feedback-modal.debug.min.jssha384-ESnvXWgdXe4B/RL1TkiXYr9QhI9NeyfqqN0KZyNqlODNaJ3ocXJjwhSMisRNedxN
feedback-modal.jssha384-oMe4hIpy44zrpSMlpB8t5h3N3WrQb2qyDk0sV6Lfm0/RKYfxuInfSnbm14CWAsV7
feedback-modal.min.jssha384-EQ3B7+zinxumXM8bx98NOCkJLh3A0jAfZJyn7LXRhGZNpGP1+MIIzJB2tM67wkV7
feedback-screenshot.debug.min.jssha384-d8+hMHwueqExTR9Eml4aXSvQHq0xVjfYD4qTv2sQpj4F5b8qTluXOtVFDD0+14W6
feedback-screenshot.jssha384-J8fRjKfFMxQhr3QRRi6J9L2deWJi3Yha43hNyOuj0+yV+narCDTWnfCmCJZOqQQZ
feedback-screenshot.min.jssha384-sWOZZgtlA3/fCQurye0MscJdaJgLtT1E+FkRsipbZzMimhrf+6zT5MoLOzG5EVvY
feedback.debug.min.jssha384-r6Pl4c4D9hlwBoH2Z9v12eOIuxf64cIKUftEoKJHsthcLxvIo9Cz9Jg8b+DmEM9F
feedback.jssha384-naluTwonbrHI6le8JFK1OqCOIvXVkqR4DlZLZ+vNHfgBmSphFgdRN0nPHWBRKbsA
feedback.min.jssha384-A7XyafcqZEXzDhheNcu0eBlsY10eRCiQtEAV3nZjd7ENCWcFr2jiZvPwFWq5rF9N
graphqlclient.debug.min.jssha384-KmckBnR1ofgEa8vhBxjbOexT1Kzv/hj1JN09mrhhtQE5rpZd+SteR0ROY9CDMIuN
graphqlclient.jssha384-mR1HuIPq89YRk910sDUVzZFE20C/STfMgL9PLDNOQ3Hah9l+mkkx/o0SHCBJ0ZkW
graphqlclient.min.jssha384-awAzX8buEq62bIVcCnatGbVmaWMfQ84RqOGoeIu0iLPtGEJ0dQAnjpFEbmdzY/9Q
httpclient.debug.min.jssha384-d4lzjzfmqS3MqLHImFqHZY5w/fjNxQ9FHgurlUMt2s92OSfBCXg6jwDMLMGoGuVX
httpclient.jssha384-WEOc5WBICbh7jrz+m91dLlmuX/87PTOxCtospBnHPnT2UPXS5blKKnb+LwhgpyG+
httpclient.min.jssha384-vTfU/LsCJo0pRyP98UtZPvYKBTfJR75xYWPEeatjuy8SSuxRvX29wZnk4PWVAsIf
instrumentanthropicaiclient.debug.min.jssha384-j4wtL+xfDZ1e30KCNtWpPAz1yuQUZq6MlNDyP/UBevhmpAzAej5HYhK0+CBvz4MI
instrumentanthropicaiclient.jssha384-j5iBiBeK1ImULRT2FQdLyhyQeS4EBIuHzsMNkJTmcic7r+4vdK8RmdiUolOiK0Ri
instrumentanthropicaiclient.min.jssha384-t8NUbqmq8hvvpvyG9tJH43TzngkeXWYD6xL3E/f5nU67uQARIzRAkPClk2rnLavD
instrumentgooglegenaiclient.debug.min.jssha384-MGK4/cuCzfeheHD/f7PzWFmqm4hrFl67mFSg+Wxt7jMxWYThTLty4REuUhVEWF+8
instrumentgooglegenaiclient.jssha384-7bdldf5UX3nkWJUsF1mK9eheBmYfATZzqiNADl2KmBG7BPgUt8AYTCVxKJIFRcCM
instrumentgooglegenaiclient.min.jssha384-rl+3FYMwp9WrM9bNLOjIj12RfxNjXK+Rd0QzDlrDsYd+gyftMN9JK5CSa7ZZEVSx
instrumentlanggraph.debug.min.jssha384-GCb8dzbXUFZvDntLi3EIQtH9yHZf/7+25fwOcsrfgTM2JfY2zQwlD7Cc8iR0szle
instrumentlanggraph.jssha384-kmkKhY2FzLad4ZmHIbHQpagGYtiTwGvLyIe2f8FHvxUsJH+hxpjEsnzPq87fbxqD
instrumentlanggraph.min.jssha384-UL7t0FHJxK+BG3dE2DoFULgVUJjQqR+H8y2pHOuY2E94CfpZ3om1rfmhFdmeaFvw
instrumentopenaiclient.debug.min.jssha384-yyqVvMRbq2x4bQy+E+ddRPrSvb2fmw1h/ybEQaJeOoA+7JbMayW7wsH+7wH0TPGu
instrumentopenaiclient.jssha384-lShOkSRula68rmE/Td/gYndyGv9D9mlEgLdsnTM0Ndne2KW9bsBk98icF8ELom9n
instrumentopenaiclient.min.jssha384-/5L5Ce8RNW6eR2fgxvxe9marmDc/oUgJdt4AgLnUxucnEOo3woJQc3kb1GPi8ScU
modulemetadata.debug.min.jssha384-dHkX8XQboMqiWX5pJ/Gm7NfYIEq6gXP32oMGN7S+PP74s12T3XKho/WrHmZxVYU+
modulemetadata.jssha384-0lwH5IMMFP84xC06KxTucCoHhQiEvE1UHWpOr33a6pbJIHQXK9s+qEb/U6BX74QM
modulemetadata.min.jssha384-20A/W63JGlBl5GN36jqm6CGGjCMAQfMWvZquzkB+2Uo0Jva4uDVmbzXQAUj5K/d0
multiplexedtransport.debug.min.jssha384-/r3HG1B2EV+LoV0XGGYFmUfTAuyVo+8BNMMhSKwpSDPiTkXoFOjLaSs/lhRkOHna
multiplexedtransport.jssha384-zGID3tLF97xZdgQ/hMWzgKHMj9MDOoko40dNQz19RW5lSpD8gCnkZkaL9o2MHAoD
multiplexedtransport.min.jssha384-I5LXL9jgNMops8zlbAZt/mBU1NUyfotAYeSCHx25OK8GFiiUMtbdkVK+MFPiICrh
replay-canvas.debug.min.jssha384-ljJ/HQbnPKNulYwQvZlvCO1gwq1YnvA3DNlK3ihSm2eFia9qBodZcl9OT5SrW98H
replay-canvas.jssha384-MMb18cBtXpBHXSLQ4B6WkMcxuP16nwEfv5uaJi/QNlGvazvEwz/SmMxrX7j8AC0G
replay-canvas.min.jssha384-rmtX4uTgKgocHdP2XdAyhPFwvXkfdH8G3/oX9UBl7n8cU4DH2BDtIw3KBSXdkEDm
replay.debug.min.jssha384-0/0I1g72y5be9yesVzQW9MmrXOf3eLnBXR0dNkRaoVmKZxQbJxcYZMkgwEXm85Xl
replay.jssha384-96ZU5T9veG7vwygLlgjnpz41ICtdyWdMf041qxZvKRjkiXug1LHXWuUKJdmIBx3p
replay.min.jssha384-5C9AOgvOnJJbbYSMXAHwuaRrf2hCcBs0IlaYXbew4TRvEtp6e/hnLji+TsYSiUbm
reportingobserver.debug.min.jssha384-LiuMypuPRjV1jHDMTtPl8B3rrltg4imFk71VUYDiGSziNkapdx3sE36z8pQWuL0h
reportingobserver.jssha384-UQ8si3moZQ/OLWDrB7UkzAKZhTd2QhIfpszBZoXxkAy2iEulp5nErA2IMPvS9cTz
reportingobserver.min.jssha384-MA0jp+g4Fg/jhrsGgGFH2lJupem3T9bDS0BKkIywnD734yXYaLXB+QwjdpO1YpPJ
rewriteframes.debug.min.jssha384-8ErfQlz0+dRR/fDNmueMOEegHRW0dj+PB1Cdyvbs0B6t2ha24idAWNpvvgCr9Zxq
rewriteframes.jssha384-OLBjwepOJnstrFrNPy44oethCp8ADdLZ3YZ0jx2M3sLEYqPekgrq0dyTK29KcjR1
rewriteframes.min.jssha384-s0GLWU4g6E7/eiJhdDBn4adpfTbGSMTtEFH/6Yo4bFpzqEficA2mU1K/EzIlfYlk
spotlight.debug.min.jssha384-MgNakBVJ5lDpyCc+v8odzaVDrsJO4vY7Mli1NCTn5sDRVnUc3KljsskbIOoKIrwT
spotlight.jssha384-lvluKViZDEMlg7j8b4gg6GrVRuWpSAXz50CWI4prmTKY8mowvNVXM+TyekzpVwNh
spotlight.min.jssha384-w0/UvSgoIvKrFdKVtFrUFfISa3TK7EyyTLgan6IfnwHzBMeDV80lQFaqoxsxEkkL

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