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