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.11.0/bundle.tracing.replay.feedback.min.js"
  integrity="sha384-DxFk585Z+WYO01c2yR0ZL9AdcnuVa4lDJBukEVwbwPvs+mI9MGMv5rexfcMMJdX7"
  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.11.0/bundle.tracing.min.js"
  integrity="sha384-9NAiK1AuyTecuSh07sZ3VSsLVUCGVbYkmYBckFl45/Pc9zmEizUJZcWxqxV08oe+"
  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.11.0/bundle.tracing.replay.min.js"
  integrity="sha384-7afATIQMv8Y1aZC2sNKMErP8qz4gueseZLKeHSLvE+00A8CjzZN9icB94FJtOuIF"
  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.11.0/bundle.replay.min.js"
  integrity="sha384-ecKqArz4DwkPsSIRnf3i+F+r/Ae0uiVCtjaP1UoDHqIeCSz0JV53YdRL5eVZ8W9M"
  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.11.0/bundle.min.js"
  integrity="sha384-BnlKdllVgUGUQfi5LagjPDeEFYBkRbmwABaq81L0HIAxsBFfrr7YqmT2K7uEIsXk"
  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-X8q4FXgEHHKy6IW0t0Yr2Pjofwf/k2ravqQw5UDy7VZTwtByroGmszyrncPxNMlr
browserprofiling.jssha384-i6vZzVpf//0yN2JFgl23t/X/QsW5KqS7v4U4pHH/ojHxPpWTgmhqU5KxyfwmNcCG
browserprofiling.min.jssha384-+spgplpPuEk1sds4jGp9Z+DLehZO5KTnh/75C+TJWxW2LMwrNxco9FIaFQmo+soW
bundle.debug.min.jssha384-cmIiUy6z1exOr0hAvwLqVmBUAWO5xAFWSVr2Yv5Ur1iABXVCpjQnWjzwqXzWf3qi
bundle.feedback.debug.min.jssha384-AXts0c4VGErNScoAeME3z/BMX8P4Zs18Km8U573vJwWYFfWBNJ3PRu1nlWWV+AGc
bundle.feedback.jssha384-vFR+EN0e5+papiNGmEo87lnRbcQtRFA36eRMQ9FDJV8G9jKZuwkqzGgJ2RGOg6aF
bundle.feedback.min.jssha384-GooK5QAckSIF1fDKcrUx1JgFEG9LtFq+JoH3WwwEbav6UoJr9piWgfqpvF30CxeE
bundle.jssha384-K9PMnG0oYYc0HjiB7w+pDsy++4kUHddkgHBlpEOmU6IUe/3Dh7oYZnktV3ue1qcB
bundle.min.jssha384-LktRxkRUZqIPkQenQZAegl5YAEJc4QJ/99FbgfWtvr6UHGTdmaT7kvISyz9YqRuN
bundle.replay.debug.min.jssha384-AnD9jJ8uTeNXpi7qziyuDFrR7uMrtXcS+hRnCXeJ4lb0XHLeRSuZV6tY3jzQXxOr
bundle.replay.feedback.debug.min.jssha384-sI3VsuQ6N3aKovo/mJa2pzLZXzfd8SqzfwQiSZJwh+zflF1nO/auK9K5h1i1CoOk
bundle.replay.feedback.jssha384-zwCvSNZPpfszCAt3N8TIGVcVdSAUMEvPwKtJPRgrZAD9IXlkrWGE6HFd5vY2xqyb
bundle.replay.feedback.min.jssha384-23oEiAkyA2yElNjVnItzeNvZPtZd4iF++HI4NtG5ISWdmlY+6NkqhdASjWAeX2Q8
bundle.replay.jssha384-ThePcPrumxl+kl8ZdxA2S4TsngpRgd58NL1qBSNhiKlkacNmvM0cfA1d8DnTldrG
bundle.replay.min.jssha384-QyjcsFH4U1k7vbHtCoaZtkn6zRJsThaSjE22Eyn6pLNc2rLZuD3O1anDF4dS9y+B
bundle.tracing.debug.min.jssha384-3QzwZzYlvkjjgQMo/PcNAHjbEUMzKTr8s2iQlOl97ODvLCYEybBUOpWii2M1ASYF
bundle.tracing.jssha384-rX9uXTIgOyEYpBgZkxiEDvdMEcGSOa4DyVtDRwNdygXNk3ary2Ms3Y3J1GNwxM6f
bundle.tracing.min.jssha384-ZnNH0KFLL1qhpW7xlNYoeY2bdcreONValnCXb3f5fOQTkvw9FEJcY9sCNSdX8VWu
bundle.tracing.replay.debug.min.jssha384-i2OYGuzvC+bPxoNI5jTRlrFdw0pZ0FDzZhXCuF0RVCg7ltufVxpWHOgCrX6QDn1g
bundle.tracing.replay.feedback.debug.min.jssha384-lfaQj5pPsR+H2EJjrbGD7Ndoe3nTbgJPxE8maGhL8FJwRHjQ93mVE2p6hre3iUXf
bundle.tracing.replay.feedback.jssha384-Dh0u4cbmWRaDjUesQXh1hDswLP3g+xB05v9mqr0sGWcIVFGkEoThVa0QOlwVPpen
bundle.tracing.replay.feedback.min.jssha384-j5ZoDKLMjibl3sq5j3bv5voBtSa01ag/xWbvql05M6E0kWfyqXFkwjiEwUVR9w8L
bundle.tracing.replay.jssha384-hDIpC04YX4fHtTfs85nIauu61ou7a0Tipj4uGXGRrGRbhtIi0Mal7Nnp1moOmPaY
bundle.tracing.replay.min.jssha384-SUzTLwZa5dotbYpVt3mPJ78y5n50WVv3PeDVKY6W0AZiy+qV0XFhUJ7vVpPfinLw
captureconsole.debug.min.jssha384-zPINX6WYt2jeLuH+mJ1HUvdQI5ulDHBGq9yZFIeVcol/azsTj694DaATmpDBUr2p
captureconsole.jssha384-P+Pa5KX9fQFAsAjnUdWmkYfp5SXShL5HoKltOY6jrBJvM1x3xJfbtyLDKYANvdJw
captureconsole.min.jssha384-KpnIuMvRob3IqUNPhO432sUFea7HqaxvzqbJnMDFXip30mNz2rMFlv75r3NvR2/s
contextlines.debug.min.jssha384-m33iWDfuWyOkf6diSzBGgCEHh/PR8c8ETz0pZwVeNndF+TI1EP113FPTRSUn0Xfd
contextlines.jssha384-T91PwjMPhC/CWfTFeKQwctHUeG2RbbtnT76RY1okQXTLlw83fJDgFCDwobmSz+n+
contextlines.min.jssha384-vuMIftiEuIWZzbbfAPo0khWYn52g4yVGWWyqoefn3WRk4I5wjnj0hNV30634ZFcw
dedupe.debug.min.jssha384-eS3QVna+cak2MhBu5c246caiEobTzgS0IhokC8IlbTvyduGs8fw5LRDd1Uhdwh6T
dedupe.jssha384-coLl8HQ+gVL/rL4e9Q3Kk/1d2c1PFER/9iBQfUPehd7Fd2hb2Oh89GZ9U2kXsNVD
dedupe.min.jssha384-qboatH7dwTWBxf9AVJ7jN1h1lDTsJi/UqrYOw4NrgjoPFYCiGEanAbH83IkVkXbS
extraerrordata.debug.min.jssha384-kBT8/nS/w1lpLyj+ofpjOJWsuoCwfZ7DcmVlYoZOETxpX/Y4bN+57lk1haIGtrhL
extraerrordata.jssha384-hl/b2Syn6I06zp6mSN5LWqJ+DPKF/EsRZ0rodbkujuTVBplBlhSX2J3c1KZPbvDm
extraerrordata.min.jssha384-ge5hx6uVQuWiKub3xakAjC2aphso8mTm29ao9RpcAiTqNcALsBqbomQtwchVhdA6
feedback-modal.debug.min.jssha384-MIXhe8I8CXRSu/ocwUaXD4yyDs5XsK7oe1raDqHpMC9+9amB6bdYLwLT6hUJjZYn
feedback-modal.jssha384-lY9RP7Ls3Bwx1/jkOWpVNy1lBkNr8F33mICqk1eNk589KEMTSdFpmoYb3AfyFgBq
feedback-modal.min.jssha384-Jtpujyguj07S1HdIddyMZb+Pqj54J9Ei4pVLHIyqu337E2GEPJbuxC0eKqMsB8/Z
feedback-screenshot.debug.min.jssha384-HLpQ6HqJ6pibdDeYoCaEWh9EVaY4C70d9lF1IsQiEPBDsVzSbiW5sWxKfNHk6Z0E
feedback-screenshot.jssha384-bq40FbP3GsaSfa5q7Q4f5aRyIxaPU2Dn4FEx0WjrFFNkOObafmCUEQQbJtSEVjkH
feedback-screenshot.min.jssha384-sZrn83eH3wunds3SHjtKcXQmUUuRWtpxgkW7EUdoMcEyZnVYyYoPXI4Hc4RZlIYk
feedback.debug.min.jssha384-3RIXDaaX7nHEpVlZOSCgRHbxz+i4bOMoe3B6dx7TQ2zgPEpeJxXxq5CqsawcCbtb
feedback.jssha384-/o/rA6nlzijUelU2SjgeNYbefmcwq5djIvfno6TlGHd2b+hldv7Hue3jBnfsN2CC
feedback.min.jssha384-MV43OxlhQLfjlq8P84hQcMnrkcYIKAyo+MdOBT5HLMBezDUtJXNvU29FYkKHD7M0
graphqlclient.debug.min.jssha384-q5IYFgWF7mNsOUIKF0rd2sBoR66AVJpbDOxv1a8Vt/qKG6ioy3UbtYUxRfVOHcfP
graphqlclient.jssha384-X8foXZOlymoVHQEsRUH4YMUnJXbrdESfQcEgRz7yWyN1ILn+Wb+7rZCD1w5s7zkt
graphqlclient.min.jssha384-WM2r3esM0sE60ErEYrXwNdcRAHwsjKio8OtytjWJJqhpycVC5wxzpMEK14Dd0EIK
httpclient.debug.min.jssha384-5bv/UOEcUc3J3aeEXbwfGbYrjiUu5xYv8fx5hbdqSmtiSccPugXpRrSioFa79bS6
httpclient.jssha384-15Euq+jSaLoOhV9bjE0xORPLcG3iow2z2nq8+p5x1Odue3az6E+NQ3D+E2aDpsTJ
httpclient.min.jssha384-FzQ5FXIUcR7fqvUXhPFL+TTnvk3Fi8A8IN5Zkx3Ja55IvSSO2vND2veYGWhUaOqU
instrumentanthropicaiclient.debug.min.jssha384-VGfgeXAHb3zgmo+yFStSPdV1hKBMt8q4FotRdZSRsODKqqOVt/4zrniB4eeZoQZ9
instrumentanthropicaiclient.jssha384-0GLsVrcP3K9T2QJo54PAolQ5iEg4tTSGQm3iu7AZvXQrIpxIYJhLGfuoZ7/PADkm
instrumentanthropicaiclient.min.jssha384-p2Bo2LiWCy/xKHnCJV4rF321m/XAHCrWTQN5Zxl3WWQrZxgIAfCd3Q+v3eVCebvf
instrumentgooglegenaiclient.debug.min.jssha384-3iqKe36oG0c1L8W9SkiYcjLEg28xzI6NGbVwiYCs3mmlPnbRrWlqo6Jv+E/4wIvp
instrumentgooglegenaiclient.jssha384-Kk5Apkp8Ck57IcagFrUzbYqr6zY9hSLSUGXERTc+CDvMlQaa8CatjyzkT7q7m0ZZ
instrumentgooglegenaiclient.min.jssha384-usGbShHzeJJjSJESk2xOfmoJQJqyOvgx+fwWbrH6ZYwsrr5gj9S0pq6blI7UwT+T
instrumentopenaiclient.debug.min.jssha384-lG98Y/Sfuv/WNYC1U6vyQbky7dK+cyvX5dqW+Uo51Y0OFYcUKEpiVnNxfonARz19
instrumentopenaiclient.jssha384-PpasFgkXtMy8c0EaHmRdq5BoCKo+g4JZLxjIve669C9dgG8zugUcm33tvQjxGddV
instrumentopenaiclient.min.jssha384-9Z2tAFC+FUb8bk0NZw00ziGuG0GJddy7Z1qV3uHAeDeKtIrpEnbnlhdjqrFSnuK/
modulemetadata.debug.min.jssha384-lvqFVoCq64NAL78pSPfcldmlCmS99+E/uFqleGs4oPVliy40GQV3be4JeMhJv+Z4
modulemetadata.jssha384-WkpuSN3b/uFWmc1yHiabQ9qZyLdNxLdUKWgxZaL0xdN/N+yAl7ghiIVwPCGxBsIy
modulemetadata.min.jssha384-V0RbhsOFPhPP43qmu+7qboFGdg8JVrXprd8tOR+ikfUtJgNsDp5lqJVOxWSjp9pD
multiplexedtransport.debug.min.jssha384-ksDggYqJTdWCDjAt7t0HMzmErsHLnaS/UDFq2JNRJTbdYwWqOqjWqv86LVLv5Qzm
multiplexedtransport.jssha384-rTZ596REZyutIedZmk+TTSY8uoNF/9LbwAIy20wIIigk+Sn4KAnMnEr2WB2qPzXT
multiplexedtransport.min.jssha384-CntnqXm5xFM65+rRdBKFPIWNehZkmzbODLN/yKbh1TCGkn0Fa40VFCHjDZmsjd1n
replay-canvas.debug.min.jssha384-BnPln7HXZWhFoQQw8qMF5uZ4jrZNxfMWP7P7Tt9gDkPXabO0taLpLWnsGsKJNf8P
replay-canvas.jssha384-2ZHGV092FwM50oV3gzqfrCZrMHQujWVX7FpQOdUi4kuczygWWXwDqqyJ7lkg4OTw
replay-canvas.min.jssha384-E9iLWioVaRwFpX8bJ1gcWgOU9t+AMWFoYFIDlUbcXD+Wy5NIyk2WCocekd/rXMrk
replay.debug.min.jssha384-uZf6uKmfJnI/0geRZiQhT4tIYgT1p+OhQWwDxkF2ll2/g08TNEb3BK4BP7hxq7H3
replay.jssha384-O2RG+Q7j0AJpwVJpPe0pl8xild+N9MQ62RFzn8mQ6CL9filKx3CKMDFwivD3iXzm
replay.min.jssha384-w6gVWXHwfxFjNrUhS1+LVlOaLEl09SsASFvPrHOSBoI0lsHSrWY7c3roA+mz1EK5
reportingobserver.debug.min.jssha384-TYmmYBKYRnmhQ28L4V58sq2iqD49kRvd3nIa2l2ZpjITau2dqqyjCS4qB+C48uGc
reportingobserver.jssha384-ghNSZSXVUpyV4yaw80q+aYv073397ir+ITNNedqfy5zyC9CRhyjP3jECr2Z7mm6q
reportingobserver.min.jssha384-3JFfiFbintxrsifwSbqNMv+JWV5rmY4/COw4cWR1sRVQCvdqBhmRQuUTnkvytfQ6
rewriteframes.debug.min.jssha384-f6DdT0jxdg7iThhRpbv5nHnNMunlLo8ltNgAYOL547B68ZfxgjAZqTE2Cwber5MO
rewriteframes.jssha384-ubBNMOp3GSKYV4TaJBzjPCqKOfuQrNPppstTtPu2bHm64cY/9uXQas1af+m64jUv
rewriteframes.min.jssha384-Uw6JsKKRoLZhePuk5IVC664DP0QDcBmDSmr0G1ptOwdp6RHZlNUfT6frYaYxD3/z
spotlight.debug.min.jssha384-9y5U00e9qM5hep2PTM4FgWZ7MwsXMRAD4toyrpWZrJf9eNKluJXGSotUwV/SrWoJ
spotlight.jssha384-+F+UBoCPHady6FuaiNHFxuhpWG/4arFe4EFxPxrjmqng3ijMhUSa7OlVlRy5vsT5
spotlight.min.jssha384-0qyYou2j1q67FrZ9hIwzcXMVuyGCMPq9paPSd1azXY2DxeWxy48F/jvgaAauh83Y

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