# Loader Script | Sentry for Cloud Functions for Firebase

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.

## [Using the Loader](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#using-the-loader)

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.

```html
<script
  src="https://js.sentry-cdn.com/___PUBLIC_KEY___.min.js"
  crossorigin="anonymous"
></script>
```

By default, Tracing and Session Replay are disabled.

## [Source Maps](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#source-maps)

To have correct stack traces for minified asset files when using the Loader Script, you will have to either [host your Source Maps publicly](https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/hosting-publicly.md) or [upload them to Sentry](https://docs.sentry.io/platforms/javascript/sourcemaps.md).

## [Loader Configuration](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#loader-configuration)

The loader has a few configuration options:

* What version of the SDK to load
* Using Tracing
* Using Session Replay
* Enabling SDK debugging

### [SDK Version](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#sdk-version)

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.

### [Load Timing](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#load-timing)

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.

```html
<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.

## [SDK Configuration](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#sdk-configuration)

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.

### [Default Configuration](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#default-configuration)

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.

### [Release Configuration](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#release-configuration)

You can configure the release by adding the following to your page:

```html
<script>
  window.SENTRY_RELEASE = {
    id: "...",
  };
</script>
```

### [Custom Configuration](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#custom-configuration)

The loader script always includes a call to `Sentry.init` with a default configuration, including your DSN. If you want to [configure your SDK](https://docs.sentry.io/platforms/javascript/guides/firebase/configuration/options.md) 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:**

```html
<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.

```html
<script>
  // Configure sentryOnLoad before adding the Loader Script
  window.sentryOnLoad = function () {
    Sentry.init({
      release: " ... ",
      environment: " ... "
    });
    Sentry.setTag(...);
    // etc.
  };
</script>
```

### [Guarding SDK Function Calls](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#guarding-sdk-function-calls)

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:

```html
<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>
```

## [Limitations of Errors-only Capturing](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#limitations-of-errors-only-capturing)

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](https://docs.sentry.io/platforms/javascript/guides/firebase/enriching-events/breadcrumbs.md) 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](https://github.com/getsentry/sentry/blob/master/src/sentry/templates/sentry/js-sdk-loader.ts).

## [Limitations of Tracing](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#limitations-of-tracing)

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](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#custom-configuration). Then make your `fetch` call in the `Sentry.onload` callback.

  <!-- -->

  Example

  ```html
  <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](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#cdn) instead of the Loader Script. This will ensure that the SDK is loaded synchronously, and that all your `fetch` calls are traced.

Please be aware that both of these options will add delay to your `fetch` calls or decrease your pageload performance. Ultimately, this is the trade-off between lazy and eagerly loading the Sentry SDK.

## [CDN](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#cdn)

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](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#available-bundles) below.

## [Performance Bundle](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#performance-bundle)

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

```html
<script
  src="https://browser.sentry-cdn.com/10.40.0/bundle.tracing.min.js"
  integrity="sha384-+sG/BfdcqKPbUie8lUn/c7qeoPxyqqpVb/n/Y/KxIbcOZiIEby9QC8KEmMl3V1pI"
  crossorigin="anonymous"
></script>
```

## [Performance & Replay Bundle](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#performance--replay-bundle)

To use Sentry for error and tracing, as well as for [Session Replay](https://docs.sentry.io/platforms/javascript/guides/firebase/session-replay.md), you can use the following bundle:

```html
<script
  src="https://browser.sentry-cdn.com/10.40.0/bundle.tracing.replay.min.js"
  integrity="sha384-YTzfpst5W7k4IodXsqQl0gr9EZe0J3XU9uzzux0Xt/pKWAVJoWaEtEkXbglVf8ku"
  crossorigin="anonymous"
></script>
```

## [Errors & Replay Bundle](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#errors--replay-bundle)

To use Sentry for error monitoring, as well as for [Session Replay](https://docs.sentry.io/platforms/javascript/guides/firebase/session-replay.md), but **not for tracing**, you can use the following bundle:

```html
<script
  src="https://browser.sentry-cdn.com/10.40.0/bundle.replay.min.js"
  integrity="sha384-CekO1FcNQpuaD90o2AgRaW+6lwUEpMW2K/YXxKvdqSvJuVOajR574YU4B5mvo86C"
  crossorigin="anonymous"
></script>
```

## [Errors-only Bundle](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#errors-only-bundle)

If you only use Sentry for error monitoring, you can use the following bundle:

```html
<script
  src="https://browser.sentry-cdn.com/10.40.0/bundle.min.js"
  integrity="sha384-zv0Dvb2KearBwx+W1/yTVgnwUeeS3n2PjESkd2OayIg1ZPvLDN9GBqPqaJu+FwKb"
  crossorigin="anonymous"
></script>
```

## [Logs & Metrics Bundle](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#logs--metrics-bundle)

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

```html
<script
  src="https://browser.sentry-cdn.com/10.40.0/bundle.logs.metrics.min.js"
  integrity="sha384-QVEW2rvfx7jIjaY8Ql8h+oqYlIo8OHXq+7dB6ScKpT6HZpwN7zPyeKZjsY4qTqEy"
  crossorigin="anonymous"
></script>
```

## [Performance, Replay & Feedback Bundle](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#performance-replay--feedback-bundle)

To use Sentry for error monitoring, tracing, [Session Replay](https://docs.sentry.io/platforms/javascript/guides/firebase/session-replay.md), and [User Feedback](https://docs.sentry.io/platforms/javascript/guides/firebase/user-feedback.md), you can use the following bundle:

```html
<script
  src="https://browser.sentry-cdn.com/10.40.0/bundle.tracing.replay.feedback.min.js"
  integrity="sha384-miHkKyikPLKarNnuYqGT4FlATt2aZqxo5tC0xThp1QxiUu3yzM9UMnRNiKLBvbvu"
  crossorigin="anonymous"
></script>
```

## [Replay & Feedback Bundle](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#replay--feedback-bundle)

To use Sentry for error monitoring, [Session Replay](https://docs.sentry.io/platforms/javascript/guides/firebase/session-replay.md), and [User Feedback](https://docs.sentry.io/platforms/javascript/guides/firebase/user-feedback.md), you can use the following bundle:

```html
<script
  src="https://browser.sentry-cdn.com/10.40.0/bundle.replay.feedback.min.js"
  integrity="sha384-hyc9ihotKRjrI3tMn+T8gFHZDn3/pJKzj670h1UH0K76Wf6A9M+kytFTHoJ0IpHX"
  crossorigin="anonymous"
></script>
```

## [Performance, Logs & Metrics Bundle](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#performance-logs--metrics-bundle)

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

```html
<script
  src="https://browser.sentry-cdn.com/10.40.0/bundle.tracing.logs.metrics.min.js"
  integrity="sha384-LRFz2pWllZ6PnFjfohlmj+sY0ttcEtLxww6D9JNxfUjZttAPhNS+V021AYvYhvtl"
  crossorigin="anonymous"
></script>
```

## [Replay, Logs & Metrics Bundle](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#replay-logs--metrics-bundle)

To use Sentry for error monitoring, [Session Replay](https://docs.sentry.io/platforms/javascript/guides/firebase/session-replay.md), logs, and metrics, you can use the following bundle:

```html
<script
  src="https://browser.sentry-cdn.com/10.40.0/bundle.replay.logs.metrics.min.js"
  integrity="sha384-/wOV73IJ3vso+pOAg3J/YsB6PycQg8Dsf8HBpB0516xXPRzXiqtTElh9Qm/TSA+Y"
  crossorigin="anonymous"
></script>
```

## [Performance, Replay, Logs & Metrics Bundle](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#performance-replay-logs--metrics-bundle)

To use Sentry for error monitoring, tracing, [Session Replay](https://docs.sentry.io/platforms/javascript/guides/firebase/session-replay.md), logs, and metrics, you can use the following bundle:

```html
<script
  src="https://browser.sentry-cdn.com/10.40.0/bundle.tracing.replay.logs.metrics.min.js"
  integrity="sha384-R69BcNaL4ugds7h4FiwH0bE0vkFKXBMe1qbociEmib+t3zS6zIEzWBVrPALMT3qQ"
  crossorigin="anonymous"
></script>
```

## [Full Bundle with All Features](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#full-bundle-with-all-features)

To use all Sentry features including error monitoring, tracing, [Session Replay](https://docs.sentry.io/platforms/javascript/guides/firebase/session-replay.md), [User Feedback](https://docs.sentry.io/platforms/javascript/guides/firebase/user-feedback.md), logs, and metrics, you can use the following bundle:

```html
<script
  src="https://browser.sentry-cdn.com/10.40.0/bundle.tracing.replay.feedback.logs.metrics.min.js"
  integrity="sha384-z2HkMyceSLjjN2cKRO1CRgo1q++/v936RYnSCGNiy2IVmOTd+U4YwXB9cQQ5nXMP"
  crossorigin="anonymous"
></script>
```

## [Usage & Configuration](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#usage--configuration)

Once you've included the Sentry SDK bundle in your page, you can use Sentry in your own bundle:

```javascript
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/],
});
```

## [Available Bundles](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#available-bundles)

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](https://docs.sentry.io/platforms/javascript/guides/firebase/configuration/options.md#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

| File                                                     | Integrity Checksum                                                        |
| -------------------------------------------------------- | ------------------------------------------------------------------------- |
| browserprofiling.debug.min.js                            | `sha384-QZc4cjaMkftqVV6vTDbwoGdiwH+vAOH5DLr0h+yh4G91/7PIVEnlhJxt6uo3gswe` |
| browserprofiling.js                                      | `sha384-Kc5yaVKmA0nD64/b9yTFphmnSKBpWAeEMZm5lu+y6paGcRRExbVjbHWTJix9MCgm` |
| browserprofiling.min.js                                  | `sha384-0KOt4FHoZNl8oPNbER4vbieX+pLDx+d6kL10/51sDOySbrzfi0rMc06gD4KCPCSt` |
| bundle.debug.min.js                                      | `sha384-9TLY2pbQ+eH92LpmB9t3Kd/TYwNQomgo1l1Y379yMhW1GkWL6COwy4eFJc+rMPoo` |
| bundle.feedback.debug.min.js                             | `sha384-qfftWBESFXg/jzbQqXlOcF4IQ4OCGUzKNrINaJcVZge6t1BFYz4vIgDKp7DOgr/j` |
| bundle.feedback.js                                       | `sha384-aWiGA2TkDT1xEMSVzxfR4myg6UYfFiK+wXcY9crDRLQkZOejcEoj9JFF0KQPAvu1` |
| bundle.feedback.min.js                                   | `sha384-O43S4qOWjq2ePaeqm8+tu5ymwiGi7l3quJUPAKnozewgwEG7lc9W2bEAwKqz40oT` |
| bundle.js                                                | `sha384-QI8Wf6esZRWwmK0Z794G6RWer+BcdiC4z/iunvK+6O/SKuM91lWQrXTZ5m12ILHY` |
| bundle.logs.metrics.debug.min.js                         | `sha384-CHBm4f/55ygFAsa2paQS2TMZbyHkXjlxJXheCt4/zIqe616MICSZolqFYz0pzAO2` |
| bundle.logs.metrics.js                                   | `sha384-YXuCR9SEDkb952InW9pTM25/afEpCY6TJONIfps9gh3SPILcIq/AHEzGr3KcUvCT` |
| bundle.logs.metrics.min.js                               | `sha384-QVEW2rvfx7jIjaY8Ql8h+oqYlIo8OHXq+7dB6ScKpT6HZpwN7zPyeKZjsY4qTqEy` |
| bundle.min.js                                            | `sha384-zv0Dvb2KearBwx+W1/yTVgnwUeeS3n2PjESkd2OayIg1ZPvLDN9GBqPqaJu+FwKb` |
| bundle.replay.debug.min.js                               | `sha384-btv9cVsvyZI5hwVqRscULODjyMYEIwhPy72eG15fJahmclBLl776sDmiBw3fMbeL` |
| bundle.replay.feedback.debug.min.js                      | `sha384-BC4M0EwX4q3ypa/PmJ2UKqvsMR576nFB/9r7Dtx8XKsdP0aY19guAQdtHxAEuCCS` |
| bundle.replay.feedback.js                                | `sha384-UW04i+phras432S1qkdoDERV+5kHrXDYnF+43CMATRynZG22sHnVJtaVq/CrjN7S` |
| bundle.replay.feedback.min.js                            | `sha384-hyc9ihotKRjrI3tMn+T8gFHZDn3/pJKzj670h1UH0K76Wf6A9M+kytFTHoJ0IpHX` |
| bundle.replay.js                                         | `sha384-YuCkRgbvtdEBtLTIXX2hfkKYk5M6Ma/EsS3FIUjy0pGF8vQrYztP2fmy/1t6aQ7A` |
| bundle.replay.logs.metrics.debug.min.js                  | `sha384-uhZ9bim6/11bkUGUbdju/Ws5t5MYUO+ljpvAsQqhJvtSOxzHUvqGyJdp9YnTXoYF` |
| bundle.replay.logs.metrics.js                            | `sha384-AG/hpPWPn+lS3GYhUnRdS62yfw2c2t6cnFCJHv2qmLpumbDmWZfIEwDgawHMh4CU` |
| bundle.replay.logs.metrics.min.js                        | `sha384-/wOV73IJ3vso+pOAg3J/YsB6PycQg8Dsf8HBpB0516xXPRzXiqtTElh9Qm/TSA+Y` |
| bundle.replay.min.js                                     | `sha384-CekO1FcNQpuaD90o2AgRaW+6lwUEpMW2K/YXxKvdqSvJuVOajR574YU4B5mvo86C` |
| bundle.tracing.debug.min.js                              | `sha384-f7/jBCqxgtE2rokV1PV3xTbXs7KhppGf9rmQu9jY8ZI6Bk4iYTxWlH1TFKRDL9rd` |
| bundle.tracing.js                                        | `sha384-DibZnWKyYBHdN9p8IhmmpSIwuCGzfUFGvrgVsrfnyktMb0ZDAhLQuC5FlPnJ/eAm` |
| bundle.tracing.logs.metrics.debug.min.js                 | `sha384-JXyGSLfb8meiea0j0suZIVdasR8qsN+QcY0yUWpwsFkJK4In75QvEILh4Rr2c4wa` |
| bundle.tracing.logs.metrics.js                           | `sha384-w8Mv/k6kImuQdONYIGdOEnaopb7NCaJDP8igufDp+MBRDjGP+wcDbFUWGwaICKyJ` |
| bundle.tracing.logs.metrics.min.js                       | `sha384-LRFz2pWllZ6PnFjfohlmj+sY0ttcEtLxww6D9JNxfUjZttAPhNS+V021AYvYhvtl` |
| bundle.tracing.min.js                                    | `sha384-+sG/BfdcqKPbUie8lUn/c7qeoPxyqqpVb/n/Y/KxIbcOZiIEby9QC8KEmMl3V1pI` |
| bundle.tracing.replay.debug.min.js                       | `sha384-VDzqeTMY79kguMwjqLMdXc1N1NIf5IKrD2HF2Iak6e8M93oiOLLgwEZFcSHUa8/1` |
| bundle.tracing.replay.feedback.debug.min.js              | `sha384-tA91Ko3myDWrMJKmK7TDYPwig7iXvEQwKQetjJCciqPFjyL7KGH6HF4Nk8oxIcMI` |
| bundle.tracing.replay.feedback.js                        | `sha384-keRL5ekvjUiMdkFs+Y4zqxgae6AFIq65d4gHZCMXBKgDtzxtFUR1LGg+N0OCXm3j` |
| bundle.tracing.replay.feedback.logs.metrics.debug.min.js | `sha384-bMrbH7a3ZlPQ6a4mxd/SazixLq//I5L+LmB/YEyUaNfhufwI6UGLGVW4PPz23SqJ` |
| bundle.tracing.replay.feedback.logs.metrics.js           | `sha384-LvcgvS7SdzgdEpDoMD+MQ9pdv51kvykX5ag+YUYKhBfpj0dsETFNctF8pE6/V4QQ` |
| bundle.tracing.replay.feedback.logs.metrics.min.js       | `sha384-z2HkMyceSLjjN2cKRO1CRgo1q++/v936RYnSCGNiy2IVmOTd+U4YwXB9cQQ5nXMP` |
| bundle.tracing.replay.feedback.min.js                    | `sha384-miHkKyikPLKarNnuYqGT4FlATt2aZqxo5tC0xThp1QxiUu3yzM9UMnRNiKLBvbvu` |
| bundle.tracing.replay.js                                 | `sha384-IIs8fUvOInwJyNrTS6Vxq8SqGI7TZcHKRPVGpZogTHUwPNxSACBO4nvVcA2Vg/+e` |
| bundle.tracing.replay.logs.metrics.debug.min.js          | `sha384-XgHv8TNqTo8zDfXHlYCqnAvvvOaUXL82pQU6MAMnj8JDV12PFwp52iujpRVJ3p6N` |
| bundle.tracing.replay.logs.metrics.js                    | `sha384-sV2j4J38pwrdkCGjHOrxMqRQWSVe0gyY0tAhupYIBAEB/f4CRPI1RLG+XXqdbhKD` |
| bundle.tracing.replay.logs.metrics.min.js                | `sha384-R69BcNaL4ugds7h4FiwH0bE0vkFKXBMe1qbociEmib+t3zS6zIEzWBVrPALMT3qQ` |
| bundle.tracing.replay.min.js                             | `sha384-YTzfpst5W7k4IodXsqQl0gr9EZe0J3XU9uzzux0Xt/pKWAVJoWaEtEkXbglVf8ku` |
| captureconsole.debug.min.js                              | `sha384-Pqj7pmg6/xgWnHttmcZCEIHL2fLLeHLapNtVHBA3Okb+GMgvyPSdltWA21/H2jkk` |
| captureconsole.js                                        | `sha384-7WdAaVXdO+ldlzHW3IvhAWEvjhyk9xX/JiwxePlodQGFxHbWdQQi8Y2dg7fZKh7Q` |
| captureconsole.min.js                                    | `sha384-z8ALc39vPby+cmxYB0u53kqux+Ib9irpDgkjC66wd7a2O4lSSUV4W1gA67cm2X3/` |
| contextlines.debug.min.js                                | `sha384-xbR7HELZhy0HCrxAYN/L1tygvVe0W9pWEg3f/SqhqG6LAsfm4HB4X+LT9GZhndWY` |
| contextlines.js                                          | `sha384-7URb8vbTiU50wGZGqMDqCz2b0rA520xUHHh7pEibR1x9mA2JyOiGOX+1sDCedRBF` |
| contextlines.min.js                                      | `sha384-Q5ia5fLNDd8RotpSN7aKiG/1LKRvcjYSnpc7zkKl8J1a2ogzXF1pXSQ+oSFabr13` |
| createlangchaincallbackhandler.debug.min.js              | `sha384-m5Tq9qh2Bk+x4ETEM6xMXV/Csmwku1JG9fZWY0+qekBkN7MhyWuiHizoEmRLusRG` |
| createlangchaincallbackhandler.js                        | `sha384-51LJyNlXXOM39L4WNJD37nQM5TB3NAREbLZFpXLCkou8k6uQm2UlzmQJ5/tRJUZd` |
| createlangchaincallbackhandler.min.js                    | `sha384-7LFr8USzUvNsdOew2np1ya9L2PwyAOiOPsZa86d2E+zYf/ORP5quXMZP4YlPxru0` |
| dedupe.debug.min.js                                      | `sha384-3l//9vBlzeOTCx6qK5rHQiXuz3EgfQGy2PlDQH1TrGGSqO8Jcsg1VNRIpWazFsL5` |
| dedupe.js                                                | `sha384-l2pMX/0Q+KAhKhn3Y/oSs2jboPWedxtlcp4guw6XAGa74ZFWFx12VpMB7H3k8CBk` |
| dedupe.min.js                                            | `sha384-ABIToMtrPkbqJQ7gP37AfuN1nFD8a4a462aBwfs/Oo3xaE0w5XFjzgkR286W0erI` |
| extraerrordata.debug.min.js                              | `sha384-qyIEQFMEH/ZgLpEm6KgbB3HHGxmV1cq/+uEx4CCHKyxnO5qbFny9q1wa4Fyiq3xY` |
| extraerrordata.js                                        | `sha384-T9L0jYLtN84GnEZC1IVVDq36afRHnBteZHDXz3eV2nCZF79UqSSKs6XmdzguyYAn` |
| extraerrordata.min.js                                    | `sha384-AKN9abjkkfReXhrok6OGk/PW3xPjA2kJaKXN+njJEKAlw3InZGxEQVjUHlNtQ3Pk` |
| feedback-modal.debug.min.js                              | `sha384-TidqYQEvdlfvU6Qgq0iPXCc4U5d94CoDEZyCA5S9Tgl57JCUvh2J/mzYKxPfT9PQ` |
| feedback-modal.js                                        | `sha384-jcvouUUQWzwAcqXd0+OxaWs0eE0x1rt4jJDZWIAmhMsnCO88miyrKojv05RzE0d2` |
| feedback-modal.min.js                                    | `sha384-Qew2yifbdNN8yLk3y76AoTWAf0AloRbnoljVahe3jcPtOGLPDlR0RX1zBatj6Vty` |
| feedback-screenshot.debug.min.js                         | `sha384-6TindgazolvesOCxwGz7jNbPvenHu5n/azg1qi0h3dt5c44KYldAYX28DL5a3hri` |
| feedback-screenshot.js                                   | `sha384-MHFrMzGMWHhnxiUK1dhQOZZ5q3AkT4EFtGaLuz5ejMLNqAQzHxYf8c3j/xsBjEWR` |
| feedback-screenshot.min.js                               | `sha384-ObmjnzfMzkhNLI3Mdn8ukxbJlR25p02E4FrotuO7EhwIg5jJGE+d0PXAbkioO6Ck` |
| feedback.debug.min.js                                    | `sha384-wD+xVV93AahlzloIat/n8eA7Ln6uWfWdqnSvg6DRVms4PBnXUd5pJ6KZwdtMZnLd` |
| feedback.js                                              | `sha384-y7RQ/fJr6QVZsZA1iTVq07f5cUD8qESHNS1I1Ab6W7qlp5Kes08KhK6zVuIYzECR` |
| feedback.min.js                                          | `sha384-1AUG+/tDiER424GfyyxGkFLZ1AtJhI1f7tNRCXcmvNcCQ75f5odR8jDkwrsyiKnS` |
| graphqlclient.debug.min.js                               | `sha384-v9sTt5ULALCqAnz3SBlbZzAP9uUWw1i450R3gUSz6hLH2mUAM2ByeokYX+cZ9Md4` |
| graphqlclient.js                                         | `sha384-yITeahffpQbHEZn6cKVJ1JGa9AdK1vGuTxkMiVVDwPjRLLA8l0f62IWERvsmKrEn` |
| graphqlclient.min.js                                     | `sha384-mzCGrIgtvV5vWBEmMWIuSdNCcMlT9Lfw5ESJMPAlRbPbHydP6m0gVEdrznRd8Nty` |
| httpclient.debug.min.js                                  | `sha384-peo5ZiKeyRsCqeWov20H3fuDxB4RAlgZvrkJwLxKlJAo4L4i9miK0wOhKug2fC3p` |
| httpclient.js                                            | `sha384-bThxLKc2dHJmjWM3gUsibmfHMpj6gu90p7S4yeSniuK5VPTNVTA+QPDbyYv0qaHh` |
| httpclient.min.js                                        | `sha384-0PkrFjDb6JsB/bLXtyF5ncnx/wTAJhyAYJ5hHgjNRUlkWaQ7eQus92a5PIPwltyH` |
| instrumentanthropicaiclient.debug.min.js                 | `sha384-Tefoc3yaBuQC4Kh6TFprJr1W/+oXFAP80JwGfGHPhPE5Tlc2UbwzjC42htmwMeok` |
| instrumentanthropicaiclient.js                           | `sha384-wuIHnWJjsMdz3FURM4LWTg6biroEcl0jvTJyaCCwzUoz40wcx2z4Uvqiz2de+msU` |
| instrumentanthropicaiclient.min.js                       | `sha384-Ou1c442A1hARiYGgIc2TiRb/2Uk75GFtTazONzjV9njVmTi+Zc2vzWk042VqDpJP` |
| instrumentgooglegenaiclient.debug.min.js                 | `sha384-KjKk5Zy++joBZuS+gV0Cc3IU7HVevfTC6p2FtdYWesg7cnUBiGjy0VTOJkLrf8YT` |
| instrumentgooglegenaiclient.js                           | `sha384-lVXCV/dZUyQ9eI/wBdP/KsFovXZsSvQ3y5UdAgkyeM15I690kf4qR1znsgT9oigC` |
| instrumentgooglegenaiclient.min.js                       | `sha384-3sGz5zIzCwoTYkDYVub5CBSkIgEsVj2LXILNd2g5mj/eQx/iLZK9Ue8wbBdQfR8w` |
| instrumentlanggraph.debug.min.js                         | `sha384-up/K9oUjbz5mbBIlP9kbvwUKsxSAr8O9MHaKQKAWuejxdKJVtobudfCPt5mFfHDM` |
| instrumentlanggraph.js                                   | `sha384-zqBJC999UVmAVZpPA6A/E53SDMwH3mN7hvpoekmB5lR6SYFAmrNhSjt72R0UYKTY` |
| instrumentlanggraph.min.js                               | `sha384-XRT2EupRAKOY6WXhgUDBGr1I2ALWyjwcYEHG5IOBLCoz+BqjZNYF9t0jiEpeF1cy` |
| instrumentopenaiclient.debug.min.js                      | `sha384-wQ4Y7+Ny+b4iA2X3UMsBrylrIoT8slLLX2+f7Zs+cfpzR6AFvKZyEpwdX1NRiM3R` |
| instrumentopenaiclient.js                                | `sha384-GUIhbemiJxKTv6+7a9ic+FxXBedfQcgMFuXYQU5cN8mlwGdYQ8cPRzL+Qh+8/ex9` |
| instrumentopenaiclient.min.js                            | `sha384-nyhJQ5dal7dLetpzlcRVnV5fTurIOTPJDy9ruxBnG3aXNc2T9fJGqK23IQxqyBr8` |
| modulemetadata.debug.min.js                              | `sha384-/UVA/Dq3Dm179yqKrkoTsnRa545tBFqfmCAepCFOPK5z1yP++AQdxAod5YxSEok3` |
| modulemetadata.js                                        | `sha384-d8ves/EjOz9Unp4bIvlcFwFjRYGFEiuL3fsm8LrlQZz9v/kNahMHbRRnfa6h908W` |
| modulemetadata.min.js                                    | `sha384-YupnXKMgn0/S6BB7tepxpLZSRPlw9KxWJMWs1wxtaxGaxi18iVudELgRIjd3I3bR` |
| multiplexedtransport.debug.min.js                        | `sha384-FwOoGBVSGvBF+COabJMzVz1lY6Tj+lHoBKUJEuth3ZOZlTkZpN5aQ4xXZg7bnheg` |
| multiplexedtransport.js                                  | `sha384-ImqiWWaMz3ThmmX+IAp9JXS7bKP3MHrt5USvXogMleEiWKeFF3flhRAOkvwt5sq+` |
| multiplexedtransport.min.js                              | `sha384-dnTF+1uFyRKTamdx9GYwm+ViLjy2FKvbenPTxgi4Tyd5hbiBTjLaNwCScARQ3G33` |
| replay-canvas.debug.min.js                               | `sha384-kzCqw1i8XdqeqMH5yr+vDWKEixC/5JFHhWX91eo8ww/5ZgLF2+5IK3k9b+/pKAFQ` |
| replay-canvas.js                                         | `sha384-bg+dJqDUEcb+8ESKd8nSiBc59CM+P8e1j5Q9lijwNyuvETjhLaN5vEvzqjuaPWvd` |
| replay-canvas.min.js                                     | `sha384-OKqhElGaTmITgeqWfr3ePrEkWfQ1YwNDLDJsEVw99Br5/8adYX7Lb3n5g4lUJngN` |
| replay.debug.min.js                                      | `sha384-2q45ihGG0mhEQh5eVIMCFtBh7IYDAGZ4TwxdY+BBalvLtwGYyf4nXUQujCugbxZ8` |
| replay.js                                                | `sha384-pTlDnO3Hc5lXRK6O1YH69syxjS3hEkVfAp5GTEfGQkjaaYnQkF+OwV7DbaAv5IUV` |
| replay.min.js                                            | `sha384-0UqtcV9Rpxvkn+QweLAW/bMYr10FvXJeWIZc567rEXxdjlSGWV4+OCrsC5ddC+7j` |
| reportingobserver.debug.min.js                           | `sha384-6teOR5tCi5PurWgoymQGbeJuYwtDv25mwuYNufcDIZihTLfvZGSxF+n07DQ7Q5+x` |
| reportingobserver.js                                     | `sha384-sNov1A7fbeptnmYG9VzMrJwrbMBnsUkHQ1gQGo9rO7/vasfHlV0riDZe1v8YhH7G` |
| reportingobserver.min.js                                 | `sha384-wqlGGGICtWcckf8P07mQp/f5hDPJBZbyJh2bccUa2spQXNGqG/cxeRR043wlNhpD` |
| rewriteframes.debug.min.js                               | `sha384-nPRyTVkAbs2Vo1CFQFuWf6fIIoT98YrjQYy5R64lT0MRjIhUge8aMGZ4Vu+G/gXw` |
| rewriteframes.js                                         | `sha384-xY1KTkEYKcvcB+Fd47HB/TQt5D3GfEPikiNDJYssahqpftbUNt7DRNcMIQEf0Mie` |
| rewriteframes.min.js                                     | `sha384-Lw8wXZ4EjLdE/RX8cX/tUM8LcNaze+57jDawrXKstu+mwG6yekoUNtDzKsSfRysY` |
| spotlight.debug.min.js                                   | `sha384-E/fzQ6/xjghUTOqxkE7JN20PSKSgUu/cXtK4m620Ly1h6Luyt0vv8z7NbXdV1smb` |
| spotlight.js                                             | `sha384-7yJyA+KIYGldQLZ271JmNL6o79EUqOsuT3r5BvAz1A/GoVmOQkYuhrhmWqOTmiBo` |
| spotlight.min.js                                         | `sha384-lY+ODUbWXNDSuX1x2KIGpdi8l3uWqyCXbpWxEurN8FDwZETSIxRzmjihSv0Tnqh5` |

To find the integrity hashes for older SDK versions, you can view our SDK release registry for the Browser SDK [here](https://github.com/getsentry/sentry-release-registry/tree/master/packages/npm/@sentry/browser).

## [Additional Configuration](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#additional-configuration)

### [Using defer](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#using-defer)

If you use the [`defer` script attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-defer), 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.

### [Content Security Policy](https://docs.sentry.io/platforms/javascript/guides/firebase/install/loader.md#content-security-policy)

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`
