CDN

Sentry supports loading the JavaScript SDK from a CDN. Generally we suggest using our npm package (@sentry/browser) instead, as using the CDN can create scenarios where Sentry is unable to load due to networking issues or common extensions like ad blockers. If you must use a CDN, take a look at loading Sentry lazily with our JS loader, which provides a deferred version of our minified ES5 browser bundle. To see what other bundles are available, 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.46.0/bundle.tracing.min.js"
  integrity="sha384-lef0BoQ2pDQ1MbqZQ5/QmBWYdxENnGGpTrm7U9xSIBpduBAkPH0pnyDPGjszxK6I"
  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.46.0/bundle.tracing.replay.min.js"
  integrity="sha384-i0N5PCQC/58Xdc4rcTlIDFizWOOpCv6A63c3IKsKIecHbyrx2R/EM6llbNaQspzi"
  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.46.0/bundle.replay.min.js"
  integrity="sha384-7F86xgNfOlrMJSmWm0XjFk39CEixsBUWrIIYktoZ1ozcYURCEEQ6vlAAr3soTKDa"
  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.46.0/bundle.min.js"
  integrity="sha384-AfN9/2RSX7pLS3X2yieiMJYVrZpmuiiy+X2VmHvghWptYJJhkBmN1sqvjpwkxHCu"
  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: [new Sentry.BrowserTracing()],

  // We recommend adjusting this value in production, or using tracesSampler
  // for finer control
  tracesSampleRate: 1.0,
});

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)
  • each of the integrations in @sentry/integrations (named <integration-name>.<modifiers>.js)

Each bundle is offered in both ES6 and ES5 versions, and for each version there are three bundle varieties: unminified, minified, and minified with debug logging. (That last version can be helpful for times when you need to debug an issue which only occurs in production. In a development environment, it makes most sense to use the unminified bundle, which always includes logging.)

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 and @sentry/tracing bundled together, compiled to ES5 and minified, with debug logging included
FileIntegrity Checksum
bundle.debug.min.jssha384-19zn9paYH5cITUzETuS8cNR6WhtYYC8XPKMoFaMTC58T393KVeNq+fDB2leFjtIo
bundle.es5.debug.min.jssha384-DATw+vlp2LakqilWjtxIC2fj0ettRbKWjl06/pXPxJp2Hi0OlnNK69KXC1SCFPOt
bundle.es5.jssha384-mofL3MrxStbYgerIpd8zpGdWUktbxsBw+k3zOeOQ6n8vs1xoKihA7gDmlffCcgZu
bundle.es5.min.jssha384-3BMGlc9HwA4FtU9kjHJzOWr+qVZmys/AdE+SG/GBAS0PRTzsJNJGAMj9eDt5BSdA
bundle.jssha384-2GMphzIu0KzyrxDUkv+FmwOuedFWAFt7akWCMmjanEL8dT/2dU9RMJQOc2VUJCI2
bundle.min.jssha384-AfN9/2RSX7pLS3X2yieiMJYVrZpmuiiy+X2VmHvghWptYJJhkBmN1sqvjpwkxHCu
bundle.replay.debug.min.jssha384-iT8n/6FFM0HkbLWT8wdTNgOui+IYV11oCKqPdXnEwowmKYDwm6RqlpdjPV2tZUI6
bundle.replay.jssha384-oikoO9BlXEM0YxI40/eePCf8GxjX7OTWR0ZN6vXxI0+M12cqjT1nTBiQ8iKKWh86
bundle.replay.min.jssha384-7F86xgNfOlrMJSmWm0XjFk39CEixsBUWrIIYktoZ1ozcYURCEEQ6vlAAr3soTKDa
bundle.tracing.debug.min.jssha384-IYifE816Wohqy9P5ZRioMM/47xZsSV7UT46prxZhnf95hOfIugJyxL+RQ+1ZM48Z
bundle.tracing.es5.debug.min.jssha384-784kpwpzj/gOkaZDlPE9lyk5KWgvPHOP6v6GMSixEsCZ7bcsWdt+H6Lgyysxm54x
bundle.tracing.es5.jssha384-945BHM8sxDcvdTfsh137tFvGtLTyy5t9Sq6HM26VWUp2m+Qx2G+d27L0wxTms4VW
bundle.tracing.es5.min.jssha384-gU9p4Cholfs2V/OYSjkUd8anEU1L6cnA6IGjaWS2QahKPJVNt3SdwTBjYS6DSahk
bundle.tracing.jssha384-joy34LbUHf9pf41buVtwzM4rn/SYWNlKconU2YX6WG3ZtQOeXeA8tdoTaqp2qZo4
bundle.tracing.min.jssha384-lef0BoQ2pDQ1MbqZQ5/QmBWYdxENnGGpTrm7U9xSIBpduBAkPH0pnyDPGjszxK6I
bundle.tracing.replay.debug.min.jssha384-/UT56MnbaovbO4t2bkmX40cuMbD9TMgKAIRselNVBnNEKDhCuo3KX+yAZLE8WyHc
bundle.tracing.replay.jssha384-qUyIugjjevi7THsLXHOtlbeG/nQrOW8rmHwZKSVbaQuLRqAePJIlT+lThSC3BSai
bundle.tracing.replay.min.jssha384-i0N5PCQC/58Xdc4rcTlIDFizWOOpCv6A63c3IKsKIecHbyrx2R/EM6llbNaQspzi
captureconsole.debug.min.jssha384-lKiVSQ7dc1CT5Y+tEputiIsWLoLxzb7oBgja21NfR5vOVYfyEfTtzSqXbx2Il9SQ
captureconsole.es5.debug.min.jssha384-zACfGogFT7j0NvrezJ7uekU58N8BngcJX6ts6PG7ysXUx/78KYzauiUCR/dFDXDb
captureconsole.es5.jssha384-B2rhAzSKepfXcxpJ3m0+T193J91lEY4onIQO/HJ8WCkVOAng9HoJyZWKiVPNha5O
captureconsole.es5.min.jssha384-ZSUSKqEz/aznShtU2vCMVxOhy3rKjgD3FXFXm7bam+2rMkA2y9c1Rqn6la+PKQVP
captureconsole.jssha384-TH71/DYFq+sR8H/Wg1smUYNKwnk1Pj5jC1vhRs+md2v7oO170JctwtfTIBbqD2e8
captureconsole.min.jssha384-7lpd6sOP37KAOroUL6KRrrfUmbslfeA6PmxjRl1eXiUiKBzwj/R0ft1mzFh3N/mP
debug.debug.min.jssha384-mRqT2Z0C4rCXgit/3CibnB3rKA5cKXo4gxZayUa+YS2kvzLHScTX6za60n2otG3n
debug.es5.debug.min.jssha384-SKrP95YiI1F8fq22pzE954jmEN/VEUBzRiEKUTQ6HFrjVoVrEN0/MuYWUQLElv3j
debug.es5.jssha384-04MylU4Aah4nx0J/y0EAoUbZ9GMiuAhQbhdvtoQ7G9L7AlryqXyLE7DIxo68O9Ix
debug.es5.min.jssha384-759ftxpp3BVHdgxlyo9C08vmwTb9/uhUFgLRsVz5vDbDUrsbVG/mwwkT++Cq074I
debug.jssha384-5HPfqLeLgFIrsAzf41Z70Ac+T3CCG3KSyWo46TbLOtQXTnKFvq9kUQg2LvvwmQks
debug.min.jssha384-x1NMqqq1Vj7Dg3W68MesnbHb/WW6vziGyUHxWxVmHwNtSAJmgCgNW8yBRC3tLq+a
dedupe.debug.min.jssha384-7F5TxsEf2FGpzM+kqYobddxSh9JXMyNegkqexP4P+Wwl977iNxnVCSPu3cGQmKKE
dedupe.es5.debug.min.jssha384-iDSpfdoek5231QAQDEdIfUl4OoRRZpsvWRd/AeeUZLPekMbm/aaNOsw2yPyAfK38
dedupe.es5.jssha384-aamTg14uSV+KyJ0Y/4pDnGurTMEZtFelddhR3bRxUUqDPA70ut8Iw5y9WmeUHB9g
dedupe.es5.min.jssha384-N0T1wdiR4uhn5t48loZxDS6pNdRNRnCLY3rVEpYwUrobaJTfITDw8K5U8JSgKpbs
dedupe.jssha384-tjGUyZyCShi891WJgBbQNpxFdx/kHQS4T6G5tgu3aMQBheQ9SN7+fhKopbmEUWHU
dedupe.min.jssha384-WHZEuy0sLLgMaSgxHZKVJerwqFd03thZLVcJpaVm8xlfWsSS0iwQ/fUYwi3M/gv/
extraerrordata.debug.min.jssha384-1y5BacO5/ukfEjBq8awmbHU/eK2tEywOcL3E+vgkCchmBEE5VaMgB3dsMafG33Pw
extraerrordata.es5.debug.min.jssha384-E1Q3Gh2V66qDefI0N5dW6QSOk7cwt1HJfq1+0sS3cSLnlBH5Zed8Ea3hJnU2lCz3
extraerrordata.es5.jssha384-XP0gMU/bmRpBxCZl0wXnC7nRdTauWFY3QLbW1RUBCi4h+u/18Zb4RRlk7rg91jQ+
extraerrordata.es5.min.jssha384-KBtX2MZ2setxPmpGalGJYWQ8GO6Q9DAtzsuidnbuYDEVJ7Z2DvGkQonZ48cj1+HR
extraerrordata.jssha384-UynZphX0+NhvUFIZOsvANFnDJh4Qk+hFgX8CdA15uLEFoXXnkvNJmNxE9wrxBOn0
extraerrordata.min.jssha384-Vlehiy4DKjt8Y1KQIUr98PZrJjPDtkvB2GwkjQkWLzP2DdTI6r61BFG4XzJHf8Nb
httpclient.debug.min.jssha384-+4Ts6ihhi0kKwp7mcQRJTiQJ1Ke2eOAsilyvvWzYQ+RXeMC9uKteWzG3iKMqAFaU
httpclient.es5.debug.min.jssha384-+/3YnVp+4idA3LzcrmXRVSJ2hl8frPa4Km/2XDSIbX37SHFhbm813X51CaY/JPNR
httpclient.es5.jssha384-6+C9U53AulX4nzchAS3qrWhR6bPjhWVBKPNDhYt9y9WgkVRw0IF862SaNtFKkV2W
httpclient.es5.min.jssha384-DqRMPTleSBtoEbBY5dg19PwAD2SRr5vi+K6DqDF0t3uIEYQdVNrQtiM8eSwFts6D
httpclient.jssha384-GABwjJuowAvqvxUDcaSPQaSgMOlHi1z5WjCwHkDS1hIfCJoulC4+TwKfHkUovpCs
httpclient.min.jssha384-Gx0GpcEAysDGwAceIUqCLDf8qN15Jcl6BMqExULCVqij5Gul7Rbfnjx+ZOz5Nk42
offline.debug.min.jssha384-6dPOsYfDGknEehXQHxqOL4jc5cqnb6wnH92zT/1zN5KBtPTvRID6IOk0zVxBSd91
offline.es5.debug.min.jssha384-In79wjcSUUQM3nCPNLIlt1L9votbqqvjt4PvjCltgQvyCrX6AZ9L/ZE3PMdH8kjG
offline.es5.jssha384-enASEOPynkSW67PoTIS6VkOSHmcjA4ArOWwo8Wul4WCqkeiMDp9hB8sUNNY0lZNv
offline.es5.min.jssha384-XiCe+YUmaqfF2sbBoNm+FHqNFojrlfcFP0pxMrx87Eq3lNprQM9/JbSAKbhY8IFG
offline.jssha384-4G1Rvgte+kk4lgYN7gKNM+MYOR+4WCTGCHLWgnYCEfxMyKBTh023VtZuqN2X6TPW
offline.min.jssha384-qa1VllpABPF5a5x52WqKtfY40q1U7CWoVFRaXIKYpRhCbXa6jle/s3vNddFjJCP9
replay.debug.min.jssha384-xbN0QRwPCKKs7Ml5JfM82xGr/iBNMdvIEB19PGcUYH/sqSHNMsFtSEW2rBhhGcYq
replay.jssha384-V0eN+0PHxCxBVG6R2V9qdfp9Kfr7DpCRQsjlVe69xoRERBrIIxRBxxA3ClJIle69
replay.min.jssha384-2XMT8bYnFnhIdmgjELuTZVUAPTzOuYKhAGXCcVK+eVUUrYlY9H5RS0va+X6iPbzU
reportingobserver.debug.min.jssha384-lGt+7FE40PEzg4fPf3pJoT3oDo6OpishzuaIHdQ2KfvQqtCsPWzbmbKzllHo8jJB
reportingobserver.es5.debug.min.jssha384-OmdDaYU3BqdDU2N4/KcLpygQuUzWiPlLmH/hRlm/YZn7T+MJdDE+E8zcqYcn5NVl
reportingobserver.es5.jssha384-emEg2H6XUgZDZai0O5wLrta3v9DjkvsVDMgQVI+QpBVw9zt/OceMebeiLiHwp3PV
reportingobserver.es5.min.jssha384-NvTqhJjP94wXD8LztNJpjUGmdh0+D0A53ia3MA495fCOnPfvrLzzipON+RdmtNsl
reportingobserver.jssha384-apDV++NYfEMPybHbzCztGWVZBrFidu5d9ifNBFW6xRyNchO9eLR8RbyksVOFnyhw
reportingobserver.min.jssha384-U0AwLv1VJZWKrW6NbxxhJ9b8x1m7A04GZTFrclMx7SDfYOLTue8klK0uIpaNcumt
rewriteframes.debug.min.jssha384-k4oT6I2UE3beYNgwBDDayXkp9H4mNttfvf5MZtIKYBXEFMpN5MvAQhN6Fjs5QOus
rewriteframes.es5.debug.min.jssha384-rakwIr1UjbJuYNQYKAZEm4KieEdHZY6VkHcOm0e5NWAdYX6MNqfomoffweFSPOOS
rewriteframes.es5.jssha384-KIs39JYm/plocWbmdQGOn3SSwUd+q44I4bqfbsnvOkIcG7P1QCmtupMABV4X9yOy
rewriteframes.es5.min.jssha384-4ojsOuMcGB2m15aMgtn29J+zTWMaWnVLBc3n36RGbcgz+JxCxN9/dr/W9ggGueIp
rewriteframes.jssha384-dttgnbOrAoclvALNHZ7X6tiAHM+wiab/sAoN7GaonFke10Wr5ofA8yr0iw8GkXJz
rewriteframes.min.jssha384-AqPTFFIe8Nlrq2+aou3Qv7vaKUragYyigpx52BoH+/39FPCYU+B08SOUzSiMgigA
sessiontiming.debug.min.jssha384-qTBAqKNeQWbJnxxRpwLFarEylmsjoMu3juMrGGuvG+WWrJEQTKfE57YZ9G2vY0od
sessiontiming.es5.debug.min.jssha384-FeySZXtkws08aI21+m/NZ0AdEEGDRbHxixLrNi6UgapX3nvNvGSabMpjBj/XeY8d
sessiontiming.es5.jssha384-WL/S+j79sfdUWVe812ekSidOwg5L3Hj5rnGp3cy7Er9Dv41F69kSOuqhQVWDv6sA
sessiontiming.es5.min.jssha384-GGx5mk8/ApFAWc+CEnk0C6bkwkVb9oU1FjU0mJ0UMUsELbB4ZzyzLX8cz1vuPp5J
sessiontiming.jssha384-q5nu+otkRTCfSUPn/QQ5WHZtk1cC3K0VCXV8nTjTBxAXDE/dFVIToaQZBgDG+TiQ
sessiontiming.min.jssha384-tp19htfUaCS5ZLuYt2bgMkZcMCPwDMM9aBQX3t2A33wDOnxfgr60Dur4jTAhZPe0
transaction.debug.min.jssha384-sshWr3T0eo+/4tRzzbDSLNVZI4C7olVBCwdyvIIGwlxg7aNQnAwcyRTfDwLyoaIK
transaction.es5.debug.min.jssha384-DPFn4zt1w4HrDoNq6whBAwnMJa8trFRdNVyblPHN8iU79swZF8TlgtesYt2HZC79
transaction.es5.jssha384-FGil9khDvgJdejyToR+eVlpUP/4SZKG+PEyAiwdYulIrLEXKclepdIFG6oc5z2d7
transaction.es5.min.jssha384-5m4MIwhrfaSqWJfvHV5ni4SNhoZhP0G+4+d533l8OyjKgYMPik2pDb0Zyb6CXwNk
transaction.jssha384-ze11Gv3W6SOhPf7alPielb/Gs1D/VliohlMnIogExAduq4Ikm8/yNQSQZ9qAoHar
transaction.min.jssha384-xRa5ckVMJKpLOKA38cpI32M+V3CNbjt8UrJV9Zsorhx8GAH1JbryBokvJs0RF0GV

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 DSN. For example:

  • script-src: https://browser.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").