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.

Using the Loader

To use the loader, go in the Sentry UI to Settings > Projects > (select

projectRepresents your service in Sentry and allows you to scope events to a distinct application.
) > Client Keys (
DSNThe Data Source Name (DSN) key tells the Sentry SDK where to send events, ensuring they go to the right project.
)
, and then press the "Configure" button. Copy the script tag from the "JavaScript Loader" section 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, Performance Monitoring and Session Replay are enabled.

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 or upload them to Sentry.

Loader Configuration

The loader has a few configuration options:

  • What version of the SDK to load
  • Using Performance Monitoring
  • Using Session Replay
  • Showing debug logs

SDK Version

To configure the version, use the dropdown in the "JavaScript Loader" settings, directly beneath the script tag you copied earlier.

JavaScript Loader Settings

Note that because of caching, it can take a few minutes for version changes made here to take effect.

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.

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 Performance Monitoring 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

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

For Performance Monitoring, 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

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

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

Custom Configuration

The loader script always includes a call to Sentry.init with a default configuration, including your

DSNThe Data Source Name (DSN) key tells the Sentry SDK where to send events, ensuring they go to the right project.
. 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>

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.configureScope()
  • 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
// 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
  });

Limitations of error-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 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.

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 below.

Default Bundle

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

Copied
<script
  src="https://browser.sentry-cdn.com/7.91.0/bundle.tracing.min.js"
  integrity="sha384-mLp8eX2NZEYz/yYlB3hz0DAxA9qX7yneHI9PPB9DfnLCo4Z+yC1XQzP9D7b9oqS2"
  crossorigin="anonymous"
></script>

Performance & Replay Bundle

To use Sentry for error and performance monitoring, as well as for Session Replay, you can use the following bundle:

Copied
<script
  src="https://browser.sentry-cdn.com/7.91.0/bundle.tracing.replay.min.js"
  integrity="sha384-CI7S6VgmKo/Bk51r0xlS0kQOPkYtm9J4oCWlzRva+A7u5fVCABvuDmzkamYS/xAI"
  crossorigin="anonymous"
></script>

Errors & Replay Bundle

To use Sentry for error monitoring, as well as for Session Replay, but not for performance monitoring, you can use the following bundle:

Copied
<script
  src="https://browser.sentry-cdn.com/7.91.0/bundle.replay.min.js"
  integrity="sha384-i0T7fhfdITOg4A4MYgkfq8b6xOOtD9ov4HJiALDtSD2Ii9ppD9itImrQnxqlaB8G"
  crossorigin="anonymous"
></script>

Errors-only Bundle

If you only use Sentry for error monitoring, and don't need performance

tracingThe process of logging the events that took place during a request, often across multiple services.
or replay functionality, you can use the following bundle:

Copied
<script
  src="https://browser.sentry-cdn.com/7.91.0/bundle.min.js"
  integrity="sha384-EWe7pAKivyOSR2S5qZMe7OTV+EXB30wM9PkDUwFBotJpHNnqWjtYlQZiyUrzXtkY"
  crossorigin="anonymous"
></script>

Usage & Configuration

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",
  // 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 performance monitoring enabled, add the BrowserTracing integration
    new Sentry.BrowserTracing(),
    // If you use a bundle with session replay enabled, add the SessionReplay integration
    new Sentry.Replay(),
  ],

  // 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

Our CDN hosts a variety of bundles:

  • @sentry/browser with error monitoring only (named bundle.<modifiers>.js)
  • @sentry/browser with error and performance monitoring (named bundle.tracing.<modifiers>.js)
  • @sentry/browser with error and session replay (named bundle.replay.<modifiers>.js)
  • @sentry/browser with error, performance monitoring and session replay (named bundle.tracing.replay.<modifiers>.js)
  • each of the integrations in @sentry/integrations (named <integration-name>.<modifiers>.js)

Each bundle is offered in both ES6 and ES5 versions. Since v7 of the SDK, the bundles are ES6 by default. To use the ES5 bundle, 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)
  • rewriteframes.es5.min.js is the RewriteFrames integration, compiled to ES5 and minified, with no debug logging
  • bundle.tracing.es5.debug.min.js is @sentry/browser with performance monitoring enabled, compiled to ES5 and minified, with debug logging included
FileIntegrity Checksum
bundle.debug.min.jssha384-8RH7T4qW07SmH8ipYWhDZh8OFtEhay4rRlnImOT0g+I/iwwbvag1woyxhpGfyOlw
bundle.es5.debug.min.jssha384-tg+2S321CKmdXW3am9sfMLWs9jUAqNlILotDW1fGEVddsRGnxhyrVqA8FYDy2Rbv
bundle.es5.jssha384-znRAkqnNZ0YqnjLaVsdfUpCxwhoUXuhnbGlP2QohYD5ofOGqqm4dHZ2bilwaCkYH
bundle.es5.min.jssha384-9GiGBIdaK7qTHsJntNhdJdSuCKalMji4pdLQ25+G5vMKQGfIAftVewDSjkE1K3VG
bundle.feedback.debug.min.jssha384-s3tUUIbua56cKxhOjBm3C+6fOUyqu/Ak6LaEHAXmTxMwmiXXp6qDIObMQjW4eSaw
bundle.feedback.jssha384-BYHxwgo9yA3aigi/npSw5Z4bmEXxfucsBELiDzqqfRni3USKyskpVHYNTSB2RDmp
bundle.feedback.min.jssha384-EXqTL7HsZDWastX0GtPOchrwviRYqbDirX9KE04DROHKDjPXi78aAtJ38aUzeqyh
bundle.jssha384-GW9qaXhvKxVpXceFktMFMgSR5PTwIYqa7yekuWg2xCflKyklywYZCGJm9ktuiUS4
bundle.min.jssha384-EWe7pAKivyOSR2S5qZMe7OTV+EXB30wM9PkDUwFBotJpHNnqWjtYlQZiyUrzXtkY
bundle.replay.debug.min.jssha384-SVJBPCgBsYbW8bQzzDku779cHEXkIvfKz1WGMFqGtGr4Rpu3WaFyKDnHsv8AIoUU
bundle.replay.jssha384-vqhRp/mVNiZrZtip0jMsGR7gLnuINvkyUdvfP4r1tu57QC0YjGwDIR/u3OcUvMsb
bundle.replay.min.jssha384-i0T7fhfdITOg4A4MYgkfq8b6xOOtD9ov4HJiALDtSD2Ii9ppD9itImrQnxqlaB8G
bundle.tracing.debug.min.jssha384-GuiCx1WWyU7X+nko83MSgySDI02jIKI+7QWW9UVu4b3JkN2QDH4UwyED8MBGt26d
bundle.tracing.es5.debug.min.jssha384-uX7iKfuFUi5MxWaDQq5fJWUooFoWVGzzq1hFVUC+WaUZQli4xlOjXNv5hRlmiQyu
bundle.tracing.es5.jssha384-evs93c6kEAmyVgLiynmNx+K2936IrW2x2OocOFuwE9SdIDPwSm0pYg15SuVE7I+w
bundle.tracing.es5.min.jssha384-BY/kDQoO66/ZrElj59EYA9gcg+zb06BnnhgwWOEv7x613RTWATOQjA1mT6n6hklh
bundle.tracing.jssha384-fQyrB9M5D6ZDcM+P33vGvRSaoFVF5BnFt8qNzXyruGzRTiu20JI6Bc+Z8VlTS/3P
bundle.tracing.min.jssha384-mLp8eX2NZEYz/yYlB3hz0DAxA9qX7yneHI9PPB9DfnLCo4Z+yC1XQzP9D7b9oqS2
bundle.tracing.replay.debug.min.jssha384-p6vBcVox619CyOkOQVVnTp/XG4jwva87T6vrBCs60Mrc3blu6p5LmW28ymsSKNIL
bundle.tracing.replay.feedback.debug.min.jssha384-1/rtsnNuj6TxhJS/iioNuO9Pl5G9jZDs4JRQuTPNyUp7ZwIVjp17kDWIVbTG0r/Q
bundle.tracing.replay.feedback.jssha384-6KIDzvYdiWcvqhZX8Gwc/VJR7xnd74qtjG1N6bWP36YdQ+hVJehjpl/B7+4T8fuB
bundle.tracing.replay.feedback.min.jssha384-uxUoAHc9zy0f76Ln4TPsU8kXFevjaXeG/gPmw3KOGHIMbwXDWifJA57yYQsPKDeM
bundle.tracing.replay.jssha384-71a2ylBDVNV3mCsuMNYVJNlN41fPEiBefRZGYHGvzOJxaJBqz1GAoPAY/S5HEKHO
bundle.tracing.replay.min.jssha384-CI7S6VgmKo/Bk51r0xlS0kQOPkYtm9J4oCWlzRva+A7u5fVCABvuDmzkamYS/xAI
captureconsole.debug.min.jssha384-Sc+/O3F2tl7fIFX9naxKWz6GH4LDyVlksJjuzAYa4As1c+gJTIGAmRtRcREbFKT4
captureconsole.es5.debug.min.jssha384-dYVga7Z2xmt9ps/iB20Zk1o22AeXzp+7SxGcbyPOnxzxCGouhfHzA2A8IB+x/uvt
captureconsole.es5.jssha384-P4iXsx3cmQEB9KE1m/lDCuu8oBaT61tP1IBRGg3bL6NzT5qGAfqi11R599G7BxGN
captureconsole.es5.min.jssha384-saMLZuUJNTxQNnvp0UqI/fcn3Vt2jq2IQFqI0BpX1HtlR+ZTYRLl/HTp+Bf5moz4
captureconsole.jssha384-jF5A3CMviykUJ9J3ZKD4BlszvrgPOLK9tG/r9u6oXX6S4TYcbNtxgAtrgS2bvNVR
captureconsole.min.jssha384-5D6+8/c1TZhh0EVwPoguO1irQ7nltihBsTHQThTrF9fDddD1KKQHvBNa00bjt6EE
contextlines.debug.min.jssha384-l2cFkX0xt8FBiWZ/8JrgEeQpHNqNXm1heuBWlWHqnp2nBiWC5wbAGwWfngM1aOcJ
contextlines.es5.debug.min.jssha384-X7+QcEz1gpxlLBOVpNYBO+dpCUem8j341izRg3OLEzJXu3gQhyGxxZW+RNDUKXyA
contextlines.es5.jssha384-B5kIFD+zDmrk9grD6J2Y0j7T2qOq2zwjismUA/SJkWiwJxFL0QhdbZXRuDucSkQP
contextlines.es5.min.jssha384-L1V/E5Dn7BXLY2w9hO1L/ycH/AXttrP0sTxJBVQTJyUUMhsXKlCGdHgMxmQ9iPfz
contextlines.jssha384-pJkwe2Ds0y245c8AnI3ACKBXjszTXi18p/q7r6lVoI9hziV4I5lKrikod7ZP8KnD
contextlines.min.jssha384-w8I9tRPDFjGVbOHisMMV7zw9H8g/KBB6/gz1NFjFAAuMR1hxm8puc3FhSG8gH88t
debug-build.debug.min.jssha384-SC0ZHZFbLEK2OcOfccBifi8Ym65jvH+AxhQ31ZphHy/Z1GBk1ByhjaKM1a9CoU+D
debug-build.es5.debug.min.jssha384-wRMZNikfCcpe1IJkDJcahQQYY69AhnbhMz5/RPERf5XBersZ5AJmTBS7nYj3vcCc
debug-build.es5.jssha384-XHVD7/hbOMdYWZOV4REJv1QFSADRciR6l6d+bhqVgcgY/dugLsLsg+uK1X4W4+a1
debug-build.es5.min.jssha384-80pSbIcqIIbU/AJVNJf1AiUXNYk83SZN2kBtf6kZoevicpVsMlhCaZOtudCEVWqC
debug-build.jssha384-TfTYTrJ2p6a7Gp+iLKuMvJEtvSQQzDqSOwc/KTfJglBG+cYOHhDNkGmOfSQwmUp3
debug-build.min.jssha384-faa4hJmafrIp8yjKkA9G2bPi96EW02IKKlDvIOx14w/xXc94Pz1+7qsuijeii8Q1
debug.debug.min.jssha384-QOK+zJxg+2WKdaj+9eUPiKCRDmsD/mr/DaJr86cGR67pcZKu2NATx0uS/3a/Ex7a
debug.es5.debug.min.jssha384-0VoKyvOdkaVqaIMaHO7fftJoyMw+3lt41DHGqlsWPXElBOhkdhZPvs6vRcEXqxif
debug.es5.jssha384-x0ocVJC0m/NT990rO8IPl69GB8XJg8eZo+et9h5I3KvS71D05xdENrhft58MiRkd
debug.es5.min.jssha384-fVBA+BlURWujNLIKhaezop87P08VsNcHOQwjRd3bERSRMN05rbw6jpmJWTw0ufEU
debug.jssha384-rOavAFaDhNcIoeXl4i8gOV0zjhEXANds0EiKiN5suRUpLL0iyXJZjFcWnPfPih+5
debug.min.jssha384-ScpCgAgg6PPG4cqL4jaT8e3sgZ8r8hX8cSC7MtQWNK7G477dsPdfEjGOtiJ2lPyN
dedupe.debug.min.jssha384-VFWDLWMwxKKYu6K9jKwdJz8Ud4UhY53Y/Xexf+43+aYzI60lwUaBIXguTTFzThAi
dedupe.es5.debug.min.jssha384-HayU8KYc6EuSO3wrGDWhrsY/c5m+fxW+EbesJ/QUlqKvhMzf1D4stzRyPZAl3OgI
dedupe.es5.jssha384-GRnWiEOLxGgn+mbjNyaaYvTfrvMqRe2RDUHeksRrm3GQ97TkaLSUAJ2aUCjMNwfh
dedupe.es5.min.jssha384-X7qj29ZpVsLqeRk9WApqMe0Y41uJ/yp7k925tu+P5TyXc3CCytIc5oWGJEN/kpl9
dedupe.jssha384-wszK1wqPmJ7tq8smEtrvm0XZ7serOCAOrOM5JIjZQtQgKKNKbxanMfDVp6UGzbO0
dedupe.min.jssha384-T97Lf16BKmpufDJIIvuKNLZoA2+IzXmjvVWs++FCczTA5KHBXU1K8eo1S+cZoZ7s
extraerrordata.debug.min.jssha384-T/MousyglLgHgu7YV9kktf+aUSp4uv8Xm+Xy+LrQcHHIKa+KKx5MO0JFIGjn5Yqr
extraerrordata.es5.debug.min.jssha384-HAkGAga+zeKWQUxn6ozEBdb3FbKj1QaGDIYMhDCeKWbNnnSY3E4XscFwIRLkPJmw
extraerrordata.es5.jssha384-cENCcZZbhgouY8vnJRtwqO9WSwl/Ny4yRnoHH4N7vrnaG/PAPgCoaqs8XzC3Izny
extraerrordata.es5.min.jssha384-ACdalpseHdyaZqWvgB0YFNcotORbHc7gXcUZvf/3x1YFCd6vvgRXrrweeYw9sNzk
extraerrordata.jssha384-Pv9Ytw4d7Js1VMszUKrJ6cNhN/nialuhn1R+bzyo+ORfjrp/9ngi6cGUFOr1q3k0
extraerrordata.min.jssha384-OnUvZHwqxQWK/AaJBTnHj6DZ2oYvX7TPW9r9n/eLw/2GfT/Ix2f1NGT6rpA/TB8a
httpclient.debug.min.jssha384-StrPI5LYip+0YgXtlJPQrfdH+g2rkHvJMeztSiweShVySI7MmR27usNwCaAUJ0wm
httpclient.es5.debug.min.jssha384-uJwJvu0q2xIg7xaDo97CaX9/k6y17X6QNSvj6LqZJO+shwu7IM/VXq81Qw3HU1dk
httpclient.es5.jssha384-YeicQfmJu751hOSOWorZjSHzMS9WvbFUpsR6vS2dG61F1Lq9P1FHrdHdWEKRfu0+
httpclient.es5.min.jssha384-MLcQ4yUVg337cVNdgqk7OTARXcEpe+suyGfiDkiegQ0D52sJ+RDCwlfSeMqI4adk
httpclient.jssha384-nanDNMIkfZypTsGBmPw6v02ep6VchO4SE84m6j7aItHJgl/j0WZ6bD+7P0rmCcis
httpclient.min.jssha384-otjS21WutGy3S+iIi7fkrVQ/PZSckOUBtUj9CBLFM+9DvNFqDRrMKkA3yHOpDZlW
offline.debug.min.jssha384-+DRePmiZkk2sw4x0oJ6nzLxZ/1q6Hsm+r+i4f4dveKdZNHwFm31GNi5boyn95aLA
offline.es5.debug.min.jssha384-o7k1T8HiffPf98HE8atfFxGGTvLu3Zp1I8lIJviU9kDyl9HoHuuv6D3CzQllT9ul
offline.es5.jssha384-DusUtnE1FGgbctfJMitvznHidxD7GWx9SsTcwRdlnmN/nvdZ8QcPXLFdKQ3O5IGX
offline.es5.min.jssha384-Krt4vJHccMt+qXbhhsnALT4IFoQz2OX0+Y6wXPoWliuYJ4UsdRD7nnrkTqwDgRLi
offline.jssha384-PgeWTUFTvdgMavXjVz0GIUdkOo5J9wSVbrngv+NTaf6FfK2ovfdOuLe+uEd/vHOa
offline.min.jssha384-FDNNanPq3fgbEDTRR1L2U5yT2Da0nMr87IMq4HvJx3+UwH6C0x5yqeRBrFLJLcZt
replay.debug.min.jssha384-ZIqVl02WZkRpq6RhTSiKzLZ8CQA3WfyHUCU5H/cOQL3PP313a9mAj+QSDn+Q6996
replay.jssha384-WGcSQbhXekOb9nMlsFxUNmlIcbsoiBAdt5FgLemr9KSk1u2r+xYNe16DJaE8OCWm
replay.min.jssha384-CVP7310Uz0g/WVvVE65ipj84hEYZ1HagUCGFiNUoFJfzeLkf865HFx2lWMzOZJS2
reportingobserver.debug.min.jssha384-2NZ0SRTw7z2/47yCmqPZlIrXCskJQ/s446iBX9lCCrI+ZWBxX1K4VL/2M5DjOafs
reportingobserver.es5.debug.min.jssha384-7HK/mNzTpA3MdqPvcEOKqM2H+0lBP+ap5CX1u0OI2vrIdNJOgrCZIOIuDIy0OTIr
reportingobserver.es5.jssha384-zKE8BbndIdm1qmeK/hc20i5zjEx8Wc2P4ldqeSzvBaf711f2FkNGYU+vikSGnESI
reportingobserver.es5.min.jssha384-N5IC11N6X/GjMOlkkMVkI/3+gBf3JYWbRAZ8ExopXI4JqrW/df3a5wWKq7biYo/6
reportingobserver.jssha384-cYsz+qm+hH0b2TB9XD7vPUPYDcZiXuRJSek4ZgbdQtdBE6Uz7bAx1m6VTPUixByX
reportingobserver.min.jssha384-J6yG7CIClRxeh5p8hN8lP0XhMzkXZjadwPmO95PoE5b49vQ8VhP9Lx19M6Snzuqx
rewriteframes.debug.min.jssha384-YBu7cbtJ6WGnxRekjcid9q+qN+kZ5GJHuDcMog/vGozx3p1UBheO6qm74p5eT3qK
rewriteframes.es5.debug.min.jssha384-OBy+Rxqg+DPKLO3r1h40LV5ByxUPxb8HLtGYoP2cz1nwaYin3zglOsFFjGN6yeba
rewriteframes.es5.jssha384-bzEBXBEQwQKgsM6jbcW8oE7P7ugJfaXOje65vrPdzObbZn3Af/dSWR3c6mcRDEkN
rewriteframes.es5.min.jssha384-i5kXUQ7jV9+Efn+FAhFl3NSJsPDX0G0+DiZsHfYNpQhk8nagEYPuDGjIq1H50opB
rewriteframes.jssha384-9rke7YUcVmuW8mIwAGh/Kd5JovRi+92OSikKt1UfZkK4NLuasQz3SvrWTOnNfPdj
rewriteframes.min.jssha384-YVCofJrSkJ+4szVOiYhaoa7FDzQ6JfxuQhlH4IRkaKFh/hAxOiV7OnNxdcwhV4r7
sessiontiming.debug.min.jssha384-7lJVeu2Syq8O/PMy54cWfndTBpeWH84F3QB8ejd59o02k5k2og4vE8Q8OinP010O
sessiontiming.es5.debug.min.jssha384-8OLba07jMxQlqK3EHFjPKkKjhLkhfC9LsyJTPduIkh2GCzU23Knyxqnm0lQOLuV0
sessiontiming.es5.jssha384-AfjRkYAwimV2Gq1lvVLT6U0uxjELo1dIbiKiLbUpRlYQoOMP5QZK2s+uIgDhY+qe
sessiontiming.es5.min.jssha384-qxg5ys6T6OPEMG/KG/duEHx3Z0QCqYtXcOLYiXqlbO8zZ567qU9tjxD1EsKV7age
sessiontiming.jssha384-xJXXXms7Skl9VSozAiUKZaJFisGKzdRfpD7grOVKNy1MKJrMCPAonLOCoKKRbu1B
sessiontiming.min.jssha384-Ih7PZHnN7cOTnIlUsWzASEaApgzSdnKf6aBMPPLpD1KyLLlS5WFNtSigKBvQ/2Zm
transaction.debug.min.jssha384-gy6kWSYAQMVsDh9+LyPE/uvcHPW5FZYtTXWaLselbCRjU3oPoripDhfJOq2HCxJf
transaction.es5.debug.min.jssha384-I28Trec42XeIU88K5aF9T6voZmh97yzjk+VWAUi34wgbDo6h7xPpVVIsPtHs42ul
transaction.es5.jssha384-nps0Avk3jMiYenLNTEQHHVLUF+ozxVLw5ebPWE6+Qh3wgia7HQvGLFdc8fa0isRH
transaction.es5.min.jssha384-+tpcK3mGQto0T4zM8Ju4OyutScl9Zh0jd6TANkEnOVhps9/PW8GbqW9+T96jC5T4
transaction.jssha384-PJ0DpvvOlywZ8ItEnE7h5b+eGL27ydlz5pUFzj8qq+aEoOqsqgzQC4KgSOo1Qx2r
transaction.min.jssha384-RBADQhoVq+azSbDREWvOIg/k4xp+a0f1ejbPOOR9n/101DyCJO+lBPquwRjuLkje

Additional Configuration

Using defer

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.

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

DSNThe Data Source Name (DSN) key tells the Sentry SDK where to send events, ensuring they go to the right project.
. For example:

  • script-src: https://browser.sentry-cdn.com https://js.sentry-cdn.com
  • connect-src: *.sentry.io
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").