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.getCurrentHub().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.86.0/bundle.tracing.min.js"
  integrity="sha384-X0u7ees6tL/3/yHvuOQBEpGaA+oEfr1JdwgMp19GBVYlS8h0KmwgT9p77TSl2QPo"
  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.86.0/bundle.tracing.replay.min.js"
  integrity="sha384-c/1PqNA1mivj+S1r6zxdwqS888VcgBlS3bvgEo2bEo39317T4FT/ek+kR7FS4rgH"
  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.86.0/bundle.replay.min.js"
  integrity="sha384-zvFKnOWhk2ph5ibRPO3Bg79ntFUMz/sAPVW+AGuYAvksBC5hsjr31jgAnzb035q1"
  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.86.0/bundle.min.js"
  integrity="sha384-DKEsQVGnTKtfn6PfChkIOgSCxKThbXXXGE6wsvINt2qnGrcsE7W6ZUp8Gdmuug7Q"
  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-wyqJxQDzHaFfnVhQFTCeU/19mahKMUvX4n2KzTXBWgHg+8FAeH4yDWvkbKB4CVh0
bundle.es5.debug.min.jssha384-3fCeK0RNKZ2xMPXf4GQlOL3Qiobzy3kf/rkxlEWyIY5Pfspy2llfiXsQyGztp/nj
bundle.es5.jssha384-x89Awjh3Vh9vEv04DuzwTxx4r4+9vwLCffaUFnC4Wyps9XSGFt41MLB27yLkd94N
bundle.es5.min.jssha384-wWiksP2DlrilocvGrFTJP3uDfz799NkBtqAA8DIG2WlmzVYILYoTr1ewMCbR5c38
bundle.feedback.debug.min.jssha384-A227b4JlVdpTnd4V5lp8KJqDPPhFTV8eFORRfDk4h4wLlGTonL+Q97UboVW6bMuV
bundle.feedback.jssha384-cRqSWfWFno7GRS3kUnP7ye+lLldf8yKfw9qPM0hAtJY63KzjQ+vQm9nWMyBR3/yL
bundle.feedback.min.jssha384-masdRGGxC/pgrIg7rRW1U2MikXlr89sy3w9N8bUQ+Z6ivFV+maTbzSUwOI7y9vYY
bundle.jssha384-Lv76pbPW1d9SJkVXxZecivigkAzO5htp5K9xEJubv1w/jQ+uVN+MF9vg3+RC4M0m
bundle.min.jssha384-DKEsQVGnTKtfn6PfChkIOgSCxKThbXXXGE6wsvINt2qnGrcsE7W6ZUp8Gdmuug7Q
bundle.replay.debug.min.jssha384-1oE/8nLAbXBafNSdwSYei/axO4FwO5pR4VP0X83C4ShkUaHqFNi3dAU0O8KU3CoU
bundle.replay.jssha384-mvxLZhrNUmRTiLF1xNBuA8GshlriJ0Xrs+TwTvrJkNqUc/b5uHpMLfr/+5SAfhs9
bundle.replay.min.jssha384-zvFKnOWhk2ph5ibRPO3Bg79ntFUMz/sAPVW+AGuYAvksBC5hsjr31jgAnzb035q1
bundle.tracing.debug.min.jssha384-pGtXDLqXWyGMvH30OWAHjbVhX+XzL8mJnu6LJvx5gIPxJ2VFbYBCt7ESbxrZOHml
bundle.tracing.es5.debug.min.jssha384-8CVMNEXpZ32T4P0buD6k+ZpVaTKM7msnXvtDjOADVo99Kt9sHvunS3sMC0nkvE84
bundle.tracing.es5.jssha384-Tdvve/PSgICr1mbHUDsq0AulwUyNnLXHVLsAHq3Eqot7JSBDnPyi/hwArvh8jJZd
bundle.tracing.es5.min.jssha384-mAyn3zHRDsW18sJ8PNjfvNy+8urvPiu5jQjrrE2ld5bcyJFhWewBjiAzriB+vjI3
bundle.tracing.jssha384-jurIuWcGPTq/Pe7XnFUIAgYjQuO2UHSC8zlQ+zt904mY+sbXen4CECBAUFYaTdmN
bundle.tracing.min.jssha384-X0u7ees6tL/3/yHvuOQBEpGaA+oEfr1JdwgMp19GBVYlS8h0KmwgT9p77TSl2QPo
bundle.tracing.replay.debug.min.jssha384-Bmx6jEhsn0W0s5AWEjYnz5acdy1oDPaUKk/azz3ONUc/pR8+YUbTJn38cOuCL8J/
bundle.tracing.replay.feedback.debug.min.jssha384-znb2Ow6DP1Ch5yW+u+oPHclVHzli9TkQVbIiWeU/eHTCDapBRjSYFyNQEt5GP5+E
bundle.tracing.replay.feedback.jssha384-JyEh2ZsF8YaDHN1M/gKXJOYSlEQcDWpc1Gbv/qhVn6undSubUjueKCMspRCzfR7S
bundle.tracing.replay.feedback.min.jssha384-3fKC3KsdiRT07aZV/LVMHsU+/udUHP5F6rc26UkHNwWVOa5locnNhI6uFb+N/FYK
bundle.tracing.replay.jssha384-ZZw9tpVrq/S5oyKorV77VzqN5yy3BCGULeWHFAoe05whYEnlGef9sHho9FvhQR/7
bundle.tracing.replay.min.jssha384-c/1PqNA1mivj+S1r6zxdwqS888VcgBlS3bvgEo2bEo39317T4FT/ek+kR7FS4rgH
captureconsole.debug.min.jssha384-xZkFQqFS3POFA7xC28L8K2HclPtyBcWJy5lj4k2zUd1rTAYYHuRMtrlOV5tUHnxe
captureconsole.es5.debug.min.jssha384-8zNpPJhlo4EuQ9CK+UF4OvBg6nm+e4EjAIW6/Z4khjPk2oQUUSQNG7BRJFgiAK9b
captureconsole.es5.jssha384-cC8e1oXkAKw5hcIiUMTSL8frGn8fSQPoq+3qWo4J7xX7x93GB8DK6Ck3P0q7ej0m
captureconsole.es5.min.jssha384-6lUjVyWACQDIKQp24tutxujZQtf/WULahVDdE87qNxnvnLz/4+f+qfV3TTMWMkRJ
captureconsole.jssha384-NmZhoGUt39CZlHsJW/vB2e0q0/nRo9gcGwXpqVO4kRUBhPuMZoeHo2q3mJjxHwHd
captureconsole.min.jssha384-4rwerZS9c14q77dhHy497sXKsOUQFxC9utPbzltIWndaCoGpkQtDDmNcOsN996pI
contextlines.debug.min.jssha384-eXfMCT+hXvJ3dRefBWcdj0rhFW262e/U3rZ4hFXnUUEa8pIuPN6RQHdERqkSjAmu
contextlines.es5.debug.min.jssha384-5QplpXY9Nan7fpeLjjtEDE/w8kTdbNlhJXU1z3d1zA8N2hTdQYTYc3PNpCKM3InN
contextlines.es5.jssha384-nu7KSQm4W586GzFa8c3jnke1p03fHyUUOaTwim3sye/wbPRwbrm93XYcqt/7oWDe
contextlines.es5.min.jssha384-dlzM+pI+jf0dPlDmvcjjw5ZxafquXjG0o/CDlxIwOzTIAun11qX7mfuKJzCgmEcT
contextlines.jssha384-t6+MQi7SLh0bVxvqL6nw6sv3fFyl4Gnq6n4lOkprXBgerkvyA6OSOYuYP/DPhbz1
contextlines.min.jssha384-hvo/s7yjrn6ZrxEKgwp4PtnpzwCTKiuiXG6cBt9qkeN3SeUTwJufYUu1g9k3hRoM
debug-build.debug.min.jssha384-yHJBZbHG/MD768Ph1Ckd/8mDR1HpM8wPVRldUVVc28oiNA87CWVR5x0jHjJB3KI2
debug-build.es5.debug.min.jssha384-C2GbF3o5SuXW8tGbcctVVGVwpbVLXd0GXuWOG+0gwf5a+IkJngGzz25ZgdwYnj9E
debug-build.es5.jssha384-6CCq6mxtJM1sn9qpEfgYJkzFKN+6vCmrteP2xV7Ass6DxYBC3YsAy6eAvqwx6bRA
debug-build.es5.min.jssha384-iPU25p5L8QR+ViSdrhAjuqcxln2NymFL7gc360RXMpy8TDSmVdzAJAeGWlU26mIU
debug-build.jssha384-nCCmJwbWEA68foMwkPaJF3DHeRaqY5JKItoOTiwJZ3Se7Nd+/XgF0qMbEbq1LO7l
debug-build.min.jssha384-5Ps+HjwXXLqM4CJdJRngNIObksADqSqKlFVEL/dHIU4//xnVNVG/sSlZWwfyzJxm
debug.debug.min.jssha384-1MYNREV0cVHnq4BpwPsuQUqFmP2KxU/OKV9eUQoLa2zdtDinM4PrU0umZG8qYux+
debug.es5.debug.min.jssha384-yMkdoisJRqnBs9IH3aqhCmhjctLIUejcswz9GQ53AYYVgC7rF0dz4WdYInYNBwbn
debug.es5.jssha384-/0opQIn02SBoL4q0Enx2miL42xfkRAykDSoSrtp3oXawr4Uh/zhnomZDCu3G3uC5
debug.es5.min.jssha384-lc2QC2CABiM2bADe4z1kueuGsTMXeR3TTnwqBNlUez8uNfKF1xdHrR2fdIBDVovF
debug.jssha384-RJDux6ez2oVSV+/PFaLqpcF8DVYJ1gaBMBcMP/vNBu5L3RCQmhLvUOgy17Noj7r5
debug.min.jssha384-1ACFh7l9g9qQcWwnemysuGAZinKxhxL4lcXuZKY4OpAmsOV4STOMCM1lp+Z/8/sk
dedupe.debug.min.jssha384-JoeIR2eAaoCiwo9TOxSZMhsqS2iuq8WkWsezrM0W0KcXhwBreBBXdE+9eNjCNsoo
dedupe.es5.debug.min.jssha384-ZBOZ1ckGkMeECTiimTRfTOc5v7/4OlFZT+V4dBnbk9oEg5YbSWM/9JcKUVsfXGar
dedupe.es5.jssha384-2EApd1rvQlNqG2PbNX2AhCDHrhftxiM1nV0PerXynCqr6uBMYU7YwlhofPL8JxJY
dedupe.es5.min.jssha384-O6BnSbSqNXLYBrufuCafkE6EqJRK+rMcT7B0iYAy5DLN+446drZFK3t7u9YYAyrK
dedupe.jssha384-GS6aIhbvcW7pwkbRc742Mz/mNG7w9SpXRQsiS0Dd5Ow8wRv0veYI8L/lTsFmV8cq
dedupe.min.jssha384-9iLVBZkT9u1uFcRVAjvF1g8BJe3Yb38mEGR+7uQ1SVuh2jRMqYvfjs5q51Cx6T+A
extraerrordata.debug.min.jssha384-Oy6cjpnYqDCOt3ybgEwhZx5Eh0vxEfnZdUvmeUAS9bZONb1Ik8eqh0E3blNTlCuz
extraerrordata.es5.debug.min.jssha384-CC60coPhF2QF9FfZnz1XO9YH6BLSlNdpJYWSW2qicSvFekRkTa77fIcDUSprko2f
extraerrordata.es5.jssha384-4/JeTjf3dwLAttlaDbegSFFWlejFAfMZtntYtE+0xKsQ+OIP9tLAhNYU9ZIL9wXE
extraerrordata.es5.min.jssha384-BFHqwaLKiRO3meyFdTOWVCf4ZUnIh1bz242LxQvazia44m91Z+h3zJHVHQVsFTc2
extraerrordata.jssha384-7ekICiYIgXJKnwZsUAOeOG8qzRyHa0IhkHs+gg19hExCh7xFPnuVqA7CxsIYSSzl
extraerrordata.min.jssha384-ueJ89mK9TU1rupNYz01XqBv5BnX0R11i/M9xjcXUYzKzu4suaQmbaiohbjUdoaPp
httpclient.debug.min.jssha384-bSL1uoPGQLVMmda6H89ciOBHmxgNDmTbSQphfBd37OzwDdk5ivQSvzyuDG9U/qO7
httpclient.es5.debug.min.jssha384-ULJdobX6AoPWZt/v6y1j6stf5gU16B9NpO+81rCABcujiWR0O+BTn15J2aEOp1if
httpclient.es5.jssha384-NyLTmPnD1KtkS/D5TJgx9LOlobQV8b54n76wZD2YaLVCiUDKyy5ypWJRhPPR87kM
httpclient.es5.min.jssha384-teA6UZZBJwmVHsjOKcU+ER9bJyz9rnSK+4qtJ1sDkuVA9Jv2CLeINUDrQpbUfffw
httpclient.jssha384-Lkz4JJgOm915zRnHXeotZ8tkYtbBpW+UZ1BxvH6sm4BOdyOjL/efgOVDX8dUyBOr
httpclient.min.jssha384-BtmQPAnUp8uddRLEUk5XHyKrGyBLc2tStlE71NzDASLTbVeDwymHh1R+f0Xkgmu2
offline.debug.min.jssha384-/vtiloJkyfZP3hGRWcwiB30cd/EOVKSlEW/3y+fTQER2Y8A3MXdwkmVtC4TU469Z
offline.es5.debug.min.jssha384-SLmMCq0UcFAbT8kfHoozj3KvOoLRr7kCH1/6LSqtsNrIyiDRC2P8qz3ctp1FNaIn
offline.es5.jssha384-Q7ldxUk9cJC0Hu91z1Okm2wAY+7merwv/c7JfcyLmIUmhuLNBTKgrabaqbnEAKHe
offline.es5.min.jssha384-UMS65k1knH8FdQ9guCV/jegy8krPVc+1zaE/vNE/9qMKUJloEWJPYhDCxb+Ysy+O
offline.jssha384-hYcy3kwns4WqGc70GRpJgDL1/qq6lIhSXVUGHon07zFlGeBg2yGHnpnGuKFfLRz5
offline.min.jssha384-nInblDChdCaxlC4VDJ3rzX7PjyiBlQl+bOXYJGxFUj6AhNLnL4DVES+iVIyu3J+p
replay.debug.min.jssha384-rXNrgwHfdqacj06dXkAKoB4vPjU6Pihvi8OEd+hHpIbUcOjtCClaD+yQJAwlEW6D
replay.jssha384-LxMsyftqtjEFlVrBGjhbWwpimy4NCMWd0rMvjNOX5+2Pan/KzN1rMvOGwTuMVWMY
replay.min.jssha384-roKHXkII92EmtAWFuo8AMqkP6p4Y58H6Cy7v6T7xz4DPkKunICSgeAfWRqB4YTsx
reportingobserver.debug.min.jssha384-gLaBG1PpCcMCbuyOcJTor8ejnsvCUQfkmjm5vdGRg/JiwOIFIuwrgHBXAQvRm0iV
reportingobserver.es5.debug.min.jssha384-faDWfgKmQkIOiUF3r/hAgy+jx3wVVE+PoJA6JTlW4HUzAfriSV3FYDRkc2odAILO
reportingobserver.es5.jssha384-zwGCnqRMHDvZ0i57dcmlUgVCV7JDLIrS4Y9cyT9JXZMuPGcxOrA+OFBWXatnU/Tg
reportingobserver.es5.min.jssha384-Nj0UxFAu/0SqTfCMcvWNFhEEaiyoPsgP7QdzyP8luCDdLvQbuI1R4rAO+kemgvcW
reportingobserver.jssha384-FNHe72Y5wE7ERScIPRPnUGy1XsheHgHHq671mlMTb093GfWPMm1RpI4nbcoSnoV2
reportingobserver.min.jssha384-zNxS5vUkko2Ucsw3c0EEU7WrZtG2qgF/v3u3e6ox+8FndGU66cqtfE1bxf/WcKHo
rewriteframes.debug.min.jssha384-Js7H8B3JBSvNNg8dEGFik8rx8Qlr9Sitqwcvk3xjLLKM+dBCCNpoaAO+wJHvuI1t
rewriteframes.es5.debug.min.jssha384-JifqFNMRdC8avYEFLTTJ+t+MPp7GRhCgT7KqV3IHP/PYUiyOAtJDL6iLfQzS2X7n
rewriteframes.es5.jssha384-9mo899YpaB+/1mN1qQf5JlJ/Omei7/cLnFK6jCewv8mPGlgnr5vUXicDT9KPV/LM
rewriteframes.es5.min.jssha384-MrIS3wFnJD9WrH+NhyAxMqs8pC3dF6D/IJ2lWFyoU/QAi/fDqD6JiFaNdnobpoL1
rewriteframes.jssha384-Me7+7EHIfm/Q656mNs3lxWYxxl27axWHlGzdnCa0m7igmuJQc2AjqkOG/d5v+vW6
rewriteframes.min.jssha384-0GOKnjqA1PtMZRq598TB3kgNgBChdTdBapO/t+BKQHzp2os2lVBXwunrB8hLP6vS
sessiontiming.debug.min.jssha384-IydhqftrWW6iLKfSg05qF2nJaNmxKYXI9qcp5AEWckprDn+VTbS0u2fnzD59A5Cj
sessiontiming.es5.debug.min.jssha384-sRm98r3rp/NaO5X7156kaRGPV6cP0WOBb4afLs+nqCXGab8COrXNDQFM/iubpAis
sessiontiming.es5.jssha384-8+ZBvZLk8m7J2VTv1NqIwi0p4YXMp92M5fF3rSU5S54er0X6oQvJHX1EvWDyVVyo
sessiontiming.es5.min.jssha384-NBHDFrCgVo0/5DYtiGK+6qUMSYx+BHlIgX/o9V771CQxW9kvGOVWAzrQIBucmrA4
sessiontiming.jssha384-KdpgBKhdA4ZzSQgxfjbSTcq28KKDs6DyiOQRboNqBkKF5nKpMu/EdPnEUZxsq7if
sessiontiming.min.jssha384-T+9CGjm33TF8ifJrn1AhlDvDn1euzhB/47PeO8v//m9pUimEmvULTpw1kY5LaCcs
transaction.debug.min.jssha384-J8J+137Mc6MZiaRq9S8KxBLNR/SNu8/KHRL+LVigQEQ8yqwQdnOc8aSTYUSpmO9w
transaction.es5.debug.min.jssha384-bzKPGNhxp3G85BLJhja8cj0DCt8oO4Csnd0AaOe6zy7vWxLNVlQsEWoTezRRYdab
transaction.es5.jssha384-c0KJ6LfU3C2TBRh40+8cDkA4KT77EXBe1JF7huKU0aHIikQZpo7E8+oBXBF18AQd
transaction.es5.min.jssha384-9Bo+qzXCWXqgFE7Z9gjY7vUA1oHFMu7koNNP7h8i9lTlOe+DJcTFlbGQBshRFhEz
transaction.jssha384-gmRhe79ACk3iVWcOrpqURNsn+n6plqTXA/Q66/TZ5Mq3qKbZaLvsUa8uz+CSKhG+
transaction.min.jssha384-aIt117G+XkGvz+VZb29RMwlQlT4Gtb5jiHFdIlGz3WWdk+VUtiNmjEWWRwVPUskl

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!) to suggesting an update ("yeah, this would be better").