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.25.0/bundle.tracing.replay.feedback.min.js"
  integrity="sha384-j5ZoDKLMjibl3sq5j3bv5voBtSa01ag/xWbvql05M6E0kWfyqXFkwjiEwUVR9w8L"
  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.25.0/bundle.tracing.min.js"
  integrity="sha384-ZnNH0KFLL1qhpW7xlNYoeY2bdcreONValnCXb3f5fOQTkvw9FEJcY9sCNSdX8VWu"
  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.25.0/bundle.tracing.replay.min.js"
  integrity="sha384-SUzTLwZa5dotbYpVt3mPJ78y5n50WVv3PeDVKY6W0AZiy+qV0XFhUJ7vVpPfinLw"
  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.25.0/bundle.replay.min.js"
  integrity="sha384-QyjcsFH4U1k7vbHtCoaZtkn6zRJsThaSjE22Eyn6pLNc2rLZuD3O1anDF4dS9y+B"
  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.25.0/bundle.min.js"
  integrity="sha384-LktRxkRUZqIPkQenQZAegl5YAEJc4QJ/99FbgfWtvr6UHGTdmaT7kvISyz9YqRuN"
  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-V26x/jwOEaAfSfDHbWt5DAdJa+0QxLxNPmuIFWmiIf3BPVDpZgdXswK001gsGtf/
browserprofiling.jssha384-dJmyEsaVCSFY8C0qDaZmIYyveG9jpCqxiX1sLqh28s+y4PHjG/ETx0yK140yhxBq
browserprofiling.min.jssha384-ftQOZPrHZNu42Hrx16T2Q5NgvOkzGC87dR4ZpWkEVTRgjjLk+5f2hkwTOqI5sdY9
bundle.debug.min.jssha384-EUh0DI4ivjDtE16sAfkn7n49TyXjQXNgJlQJCFfRFsxqK8JKjjFjJvAUbKPQdPgD
bundle.feedback.debug.min.jssha384-OkS82/oevUTkaM6288suXBBWa+52G5Lc3TkTZvRbnVWLoH8udAqCiRawtgP29tTL
bundle.feedback.jssha384-KMD6fKyIcxcMjsauCJV3IapaGK6xmrjVguEhqEmYIF6WJlT85zTJ9R9pftzzEsS/
bundle.feedback.min.jssha384-n+Ey1ulDWg7+Xl0tRMU9KFvY4qYhhNuDVPI5dMh056ABKpjLarF+tRgL+rAPnEcT
bundle.jssha384-yfYH7Pp5r+Hokfmf4AoVOpyAYnPdF3tNKkqWwjzPyz8OEu/AySMlWAmguP1Kkm66
bundle.min.jssha384-J49E9G1xVlWee8+bVLu5FqEUmoU9VBjPrpS1G1ejsQOTm3I/cyMFOf53BpiVT4Jg
bundle.replay.debug.min.jssha384-Hv2vK4+YrWcnjR4FU+mR4S7F8f8NqpTJOI8NL5veY2a9mNFEKzT8Vn7ZgAkY8YCj
bundle.replay.feedback.debug.min.jssha384-Rea0YSYZNyhEWQ/T6T0/p4edpUihvYe80/t6a6k2iHLf8rrI3x5kPxeBMaVyEhYY
bundle.replay.feedback.jssha384-bib3ekbwqPuqoOryjBVFnYMVM/JdooM/14vJNMCg+Icu1sJiiLiBdcs+dWtwJChP
bundle.replay.feedback.min.jssha384-xAxSpnfKWnrjy+VVVyfHkwkbi5ykzb69uhnPZzcyxD/7h+BvgTk0mB+Gp1uJ5Iyv
bundle.replay.jssha384-q/S71PgkeNBa5yNx/8Ny/PJfYYMZ75fWS+r+EkZ0XmB9588SXBaWytCn3g1zdSGX
bundle.replay.min.jssha384-5iqPTwAZP5bT3RkGVlEwho0FkW9i7rvLe0EwzirJRhFyLJN+mYxdNtGEmZl+h04x
bundle.tracing.debug.min.jssha384-cn3M0oGUTPOd8ASjvNdEGDplWNW+9dwRT7nwcVtn2e04ycuQJJtHcNJFCfujVTnu
bundle.tracing.jssha384-c0zCwqiO+htI6plw3qYgsyuM0N/KreK1VOAWwUepblxmsaFXNQclZ4/0U9AvbR8K
bundle.tracing.min.jssha384-63HEzXTaCRJAU+d+Q3l1PB/f4qzJ8WV3M4j2PrKVmOsM3bxRxnqBwutXWxyePY7l
bundle.tracing.replay.debug.min.jssha384-qP+4AUXnNTas4rJt8HurR/jziQuQ+DTTZCc9bgW3JXeshRpQ4+8hmwKnDXzKD5BZ
bundle.tracing.replay.feedback.debug.min.jssha384-vXBLhVeT6tqyfR9unrDKJ++WTDw31FX3rFEPucntSaFcDoSHz0EYLY0RsgCQYuCH
bundle.tracing.replay.feedback.jssha384-KQUbEDzXQwT8dEajeFd07L8a5TYlMff/TeFyqa1P2LHQaan6fOvWljGoARPDMSGz
bundle.tracing.replay.feedback.min.jssha384-jxrHb5HTYO4+K6PSJNE+5Hjp+KUyif4ZTJ6+nvWj2xhOfPxw56a/NQwKb5ynhgez
bundle.tracing.replay.jssha384-A6MW6nVaQiCxpRpqJvVD9aZqAlu7n0Obt7IA0yavOyMfTVN20w4r/Gsxz7vjLkM5
bundle.tracing.replay.min.jssha384-IQ15cIj+bFI0zfrypOMGcFUiCDKeMJDNcxuhx5WSWaCorlSvQ1Qde9dap7pV9hoV
captureconsole.debug.min.jssha384-ZxVC4ZX6MC4uBQXI2IW7gwfl7f9tQdRU1rphDKoc0NcZNA5pO4Kb59PkNoHvg8BG
captureconsole.jssha384-TMHNDsWmvfnoLdFeYzn/hjyWCL2AR99h3WVRWKEWtIg+PZuAMpe6lkbiF5RfgFec
captureconsole.min.jssha384-sWqHK3BkVxkrsoV5x+Dz+0/FKDdbqtVzG6M/D40WRwqUQwqcOUUuaeQXWd3f8BnD
contextlines.debug.min.jssha384-Hktp9xtRq9Xu6Eufdz3S3ZURMOyrPwfQvyvgV4Xzq7/hv4USWSvPpzkg8ROD+zav
contextlines.jssha384-owOCukAcsjHSKekriuWxFDJDSz4DsxFyXaTY+7kqZEn+zfBhIm5bDf2vqmzOl3Ff
contextlines.min.jssha384-Jmf6Dwyxu0NS3FpWWMd1nqAvs4hHqtaWfA5c6Q4EzPRU++tGNBOR/mmvMTNh1cO8
dedupe.debug.min.jssha384-OjXYIp3qVFBu3D8pcG6ogpfsAX8krlhHMl25y/w3lwjYyWo6rE2+g8EBY5CL/JJp
dedupe.jssha384-vVaidQfD3dacxT+MxYX/KBd0hjWJaVIgfD0ISE4F58dce75ALpIbQi/PhXqZdYyu
dedupe.min.jssha384-5DzHiTpWdRgBXADdsrCjq4VL1DmA6FSU31V6LKnkm1QCMNHekEr88vFJolph57Mz
extraerrordata.debug.min.jssha384-XJ500ot/2HCY0CVsjVckIHvHapxtqx8WcXS/o+8CC/WRcApo3MPeE1+l7gbpu3R+
extraerrordata.jssha384-3dEYgPrqdBYqa6w+8G5LTB0nEMfsBZ7+JFI1ZteU7ks0Sg58g0q+aJT9LgMgm+KM
extraerrordata.min.jssha384-7b7OGLlFPV5gCmqJSgZl1Jl8tjf9xLq3gDxrCwlOZKiTXoB0sBMo3+yNpWZzZDBV
feedback-modal.debug.min.jssha384-4kajSuXarBv/vr0qiBxAfwrV+WhIhwzL6V/D0Ep6KdR9JQCOLjIBVGnfv3NaQU5M
feedback-modal.jssha384-5WcRMp/8+Kg4aP9hBZw06ZXyUQW18c7mmnMDHApXcv8snt2pA3tLd8g5mcSCe2bW
feedback-modal.min.jssha384-s1WUjP8UycHH5leobtAkUzDF5RP9+z/Nfisk8atxbTsNxjqcCOmbIOKvjbyRJFh5
feedback-screenshot.debug.min.jssha384-y8gz8LyJQZVYXDYSSQmEXr+wRQ/N8/TtcC544l45MZKEdJipKnDY3Nm0Ro7gafqS
feedback-screenshot.jssha384-wZtI/u436qrgIWf2hiw0ZAsNWI7Wf5fTYJSGwLaJxm7CUiQPp1EqpZAlGFUlWjvs
feedback-screenshot.min.jssha384-bXF4v81RaditqL7GdnvY+JvR/BEybx1ClcnTZ0wg3cbfWHaRtqNJ8Ji4cXHvGUok
feedback.debug.min.jssha384-ohGQYn3AMVq6+Dl3tOJXz6LsX8OAj4n3k39QcUt6dBdn4B1bnaMZTZbxJLivAuop
feedback.jssha384-SyTHG5R7tWw4Af723yacC78vH1yAkozWLWGVYxIR8lo7ARDDrMKZmqlKl+pND4bm
feedback.min.jssha384-XVjYnhcxT9KnqhZewlLKGLh9NduvyMPS3/Rj7AX7/fczO+viqrAn71iR63Yc/4A/
graphqlclient.debug.min.jssha384-qodCNAEpXoa28wr9Z1osg93S421mUxQ5Ba7drJb1CUWNfO/VTd6HNnfvz7KRGBr1
graphqlclient.jssha384-n/Dp9nFx1ZpCbX02bpW3VIW7f2OWpzZ1APUcuhnO97g1XyNzbdkByAc6+5Gqs2xZ
graphqlclient.min.jssha384-5frmrBphDFe/04bjMES8zZ/YywhR+3Tgku/2Fjfi4Q1CmSIn36GzC3eNB2xE3Oio
httpclient.debug.min.jssha384-8Aarkp6L5aCZfLmqQqirx6iEraaJmL/y4wN9cyvKW3GKXO3Xj5m3VnAPkuZn1NCg
httpclient.jssha384-CKV8sVPq4T9rwXCMapq//CfInibOPfarwEQKq8su6pxdvG2p7k1KmdrqYmg4/aN+
httpclient.min.jssha384-m+UpZpTV06LDoVd1jYL9tw9ti+bjz+Cfu/xmaum4XNkIEOg9lv9pp+wZ/nZZ96eW
instrumentanthropicaiclient.debug.min.jssha384-J5J2eAqKHNxRLCPf+Fb5VTk9mKQzdnF4/6zyZWWjN56WsD1BehFxaMx/C0F9xMup
instrumentanthropicaiclient.jssha384-JspJ+hhflDKQmTi5/1xd5a6ACOlvvqBMwj1QsKekTzYvUJgUYrVqiOBVDArSh8v/
instrumentanthropicaiclient.min.jssha384-mvtx9ung31gJyecy8RSFOxuwdUSrasTTnm3NJrMbuNV+DPHVJCSxFX9o3tadcmg4
instrumentgooglegenaiclient.debug.min.jssha384-67OAMTy4zJdRCQpcmCoHOWFDXMSAuso6Ltt/7AECIh3fcCR0eMhJ78JbMijey3IW
instrumentgooglegenaiclient.jssha384-y7msKaA/bBOrV8WTpyZ/KzxU+/4ora4DyV6Yl2x9wyzwug3Xp4EnaKYJvE8cFSq4
instrumentgooglegenaiclient.min.jssha384-cDiZP29dgTAcrRouG/x9X+/zLhLh6SkTxIFND2NRrRFzqUWjh01V6g5e8I26heQf
instrumentopenaiclient.debug.min.jssha384-PJzHK9WuoHsUfypdGydCfdpPH6ndyeD6dewT5ttM1241lWo7PuSan209fGKlbMAG
instrumentopenaiclient.jssha384-326ArNAT9hjMKXdTUq3FYidlBLQnWrrUHDAwpwyKSx3g+cekfzbz8MBimsdu6So9
instrumentopenaiclient.min.jssha384-3t5TF0MaAW1TTPVFExxXgYTzzn+4JUPZwn20y/DmKJ0jqVOrqdmW37zR018I6X9+
modulemetadata.debug.min.jssha384-+Yr/pGQu1jT+NaMyONsPJK+LXrekxlt6ObK2UqPssA96pnoXxB3W6Hev2Atkxnc7
modulemetadata.jssha384-qoy9yL9gsxE8uIr1SR45YTUsbfR+IJ+40MOF2YhBGycX1HsSKPFB64W3ivtQfNsr
modulemetadata.min.jssha384-c1ROCU0oXwRUVqmnDyuQt+Qfm0PsjmuPZfF+jyfXSRWfv3CEN+HwFSgv9dzD0Iu3
multiplexedtransport.debug.min.jssha384-J9zmKWdzsgHeBvzF0rwVAubkFSoqjagyKZgSqWChEy5+v8ddStsTfHoIxGwdr+P6
multiplexedtransport.jssha384-NMWXoKU3pF76BjNVynxsu6CaQ95Fc9kkerPd9/fHYTFXeBa1/Pva+m/mLP5xBLMZ
multiplexedtransport.min.jssha384-Wj1LqfIGPeTW49AT1E7OEi0VNhNvupSVPIPxLrX6Q2m6TlIZWyQg1+eUXBxJn9Wb
replay-canvas.debug.min.jssha384-pSpX82ZQH7k9rEmthwms+3UYKPaNfD8qUyqrw4mwOwpmYUsuILtT/3vqclOKbbmA
replay-canvas.jssha384-Zm26SqEp/rGvUpPLHmLPp1Xd4yH0vaITyzIA9pHIB/K8Q9dJH2U9/2M443Oi3A6s
replay-canvas.min.jssha384-OAXlqzVkOdxgztg/3biYw6oCoY0Y69WShzQkmGDQHwDKPikz3M10w3tJT6qSIRwq
replay.debug.min.jssha384-1obURdbBfTZsF1nGldz13L6dszC2RhRD7piRZ5OBAPIPV1FytWe2KOhO7NryT9h2
replay.jssha384-mLuGl2wjrX3uW+2g5PXJ4Sm1bBtaSHEc+gE3V+3lSkYpb7n8my/sn+PHKm7AmIay
replay.min.jssha384-Ktf4pEu0lOcWQdKJ0DSiItlEEudmAcZ5J9Er3dTTz8l2/M1Rgk6WXYCdFcxlE1i5
reportingobserver.debug.min.jssha384-KYiDc3hvafNxSO18/uQStDNdyXBLVEUSRxAXXFR3O0D0LxI884B6LHTz0HtrGqQ/
reportingobserver.jssha384-+yG8b4KzJq1d3n3v1PCHm+YuDOyuiTwk6toOtba+yFsWLcMoIv/Ig5WQBHyGnXpP
reportingobserver.min.jssha384-a0R6Fj7aBgWUqUJvSdXgXX9g4DxJbiiV+cgKANQ3jmbxI2cUwgsuNITjX4I+HimI
rewriteframes.debug.min.jssha384-vNUaMVBazpltrWnSeycSnBjud4kjPWRGEGnAp5rZ9kvE6vyu5pqfcDQ5JorBSnAZ
rewriteframes.jssha384-3dbgR4dplOERGSnBQad0FUnCV6otQChwfSH0iIpbQRSlXVrN6yAWRYPNWgnLjUa6
rewriteframes.min.jssha384-+8iEiTyj/mpTVb5fGMc8+Rg+sy2FL9vjjb3RUuB70iUV3QQ/sE70lk9WAYYxg6yu
spotlight.debug.min.jssha384-5keeUHR3noJbWB2bxvqptxO0p2LR3qbiy5CRoDwzDw8a97CvfmUiOC6T6TsRIWr3
spotlight.jssha384-DnkytiDfma+p+Z9s9qtovOg8fyTv9LbZ+HbHENtGhuCYTYY4xwpW9/LzJH/yxh6X
spotlight.min.jssha384-0GcQwRzMOVxDFYDSWv/jVMt/EIDf61JWmsZWbDcCj+NaXdWdoe82DihPSEcxcSa+

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