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.

Copied
<script
  src="https://browser.sentry-cdn.com/7.3.0/bundle.min.js"
  integrity="sha384-SMm9LrmlAek2bjM6vZh0NHrmBfZuqEOnedawNH2iknxYwrBRgcHL0WSBsA/vvlSt"
  crossorigin="anonymous"
></script>

Performance Bundle

To use Sentry's performance tracing, an alternative bundle is needed. This allows us to keep the filesize down for users who only need error monitoring.

Copied
<script
  src="https://browser.sentry-cdn.com/7.3.0/bundle.tracing.min.js"
  integrity="sha384-kFNl8n8X8ud2ZbM+vvwflQGuybGR4UFYMjmWDJJ2sDmCwLSIoMmvUs0zBH4qDbu2"
  crossorigin="anonymous"
></script>

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 (named bundle.<modifiers>.js)
  • @sentry/browser and @sentry/tracing together (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-O3yzBjpa22QAMf2cZUy40FmxvC9s75JQo/H8EL2Fbb27E9DWCcbCIeABrxFD1PMS
bundle.es5.debug.min.jssha384-Tn3P00PkYoFdClv1TZo/Y+N5P6TrshJAcTMAvS21oTL4cYPjHG7Q4vuppZ/1wxWi
bundle.es5.jssha384-mXHMg0CxWdXwKDKeuQxYxLf2dP5hH5QDueB5qBZIOzYlQYs9mYwoue6LQUUVOEdC
bundle.es5.min.jssha384-yEBp5RCPNN/p/yK37sI+j1OBSpyiKJjpnG3NkbtDFWcR0Z/Wffm9NJOxWMcYe5Y1
bundle.jssha384-jHIkvml4lcIvlWFZnlgUuocHONQtEL+8bnyp8nrSZ8aANKRD6ehRQkEwHM8YUW7c
bundle.min.jssha384-SMm9LrmlAek2bjM6vZh0NHrmBfZuqEOnedawNH2iknxYwrBRgcHL0WSBsA/vvlSt
bundle.tracing.debug.min.jssha384-4NGHYFmlubPYr906f0SmV7nqtscT2WV3j9ebHjV1BTqKAv4wbQ2OcKgnqoN8KnE/
bundle.tracing.es5.debug.min.jssha384-maNJK9Ah0w2PynyK5sHam/gNRTNHutf98asuCbMP7TXBCruD0b/fiJ9xHriV1YRO
bundle.tracing.es5.jssha384-m4TSH+NytIyAk/03Xa4HvXohRygAriABNeDqy65e1Il0/HkH5GIlkYGPRTZq59LI
bundle.tracing.es5.min.jssha384-XX2OQS24NrjE+Ki84d/k1bBBaFtBkFRS/HzGMyXINwlELDoB9aHRyKjzn8Na9KI6
bundle.tracing.jssha384-nqQ/UyTYMaUZN2NVDJAXiTo5lxPpqSM8UWxJSjeWZ8NoCVp+az5JrPnJnbU3rB3X
bundle.tracing.min.jssha384-kFNl8n8X8ud2ZbM+vvwflQGuybGR4UFYMjmWDJJ2sDmCwLSIoMmvUs0zBH4qDbu2
captureconsole.debug.min.jssha384-DLV91PYOTncYn0RiKI6ll9HxyXoZ9QMkeoZ/1oGqAuu09e+L2kM7t/NHI5vA+Khf
captureconsole.es5.debug.min.jssha384-/CmR72F59MH00X0AOUPZhvhSVxDhiMRytkS58CeFWHC2xu7HsXVILTcPHwgeMidO
captureconsole.es5.jssha384-RIL5qzsCufVBJgfQ0RzO8fF8sGoNYcAbxytRQoYCX6LXCpdkWpnNg4wD6ChgrFZG
captureconsole.es5.min.jssha384-PSsYNOgXWfWDeoHtvsxvu5h1H+gXjJtyznKaYCYxrK2pPDRINQAHRlL0xmGqhhP7
captureconsole.jssha384-6SqEc41t6bcKEH1EJzG1HTJu7bcB3WBILPnsRuwws72O0WTmZgFM12Ad95nMOZGW
captureconsole.min.jssha384-5XCA8X7O9GqV0q9Gv5C4S+mPCawk9JPSKOuRifOmLB9oWTAo9aBCDPo9DnHKDy6a
debug.debug.min.jssha384-8IhmwehVK5qK1UVLFgRd2OR3qFYGI+W0qNvLkJe5vurSx3J4WKsCAU9Vd+djyaD0
debug.es5.debug.min.jssha384-Q1G+wTSLrRcPQ54ek1GNG9AzFj9qFlIdAaSINC7eGG2b0jyp/JZNGG/26amwX+aM
debug.es5.jssha384-ns52xBqUhsJVIidv7FLXv87GLU9NQuZyK5IJbdd90wK68RJvr2tE7nQ4syrXBM2a
debug.es5.min.jssha384-lB7k0D19Fth4vyOxgkjJ9dzoKo5vb7aweCpDnX1qC+mEwm0Qv3IsQUaaPIyG1wEm
debug.jssha384-IcayYrRT1tHid0tlVGEvwXJjQi7mG3C0W2ZchFN69sJ7WDfLEP5fvWH+Gucvw4iF
debug.min.jssha384-Ys32Ph4h6KbK1yoxTwVi7b1BG8L1kWe9hLZbXIP5CA4cP7oU9Xkn6mQfJ6CNgaZ9
dedupe.debug.min.jssha384-XJBONu9Gueqy6O/iiMt4q2grxhU+FxaC0QCdjW9tCdIwSIMVQm1KYnYCoqNBXHnF
dedupe.es5.debug.min.jssha384-JnZ/haNdPIgVKC+rYjjEo7F1mRqJDpfNvPYX/3VlvTvX/rjkPmtCI4+hNa+zTVdj
dedupe.es5.jssha384-VNew5zrpyvA7BckYkh1kHK/54TtdGSXhf/Vak32DHUHpNGvSlkJELD8CLDyM0afJ
dedupe.es5.min.jssha384-JcoiMLxOuYVnRct5pbfWffxekZ3YGJplGqyietgd7p9aW8+liE4JGcJ3/C7tZKXl
dedupe.jssha384-dlIwlVDQnlPSi5LxOoREjiVqkIvHkDwufDrY8Upow4iVyMaP2enzHiSH9kRQrY0L
dedupe.min.jssha384-4XF5Z2eJqVIDYrppFNQTcgJq0VC69GDv8b0U1Ch9IP7U8FZXghqgYDvv3yhlJelo
extraerrordata.debug.min.jssha384-BM6m6clqGbMAm8ciemHOqGK46temAGsE8LdRJSKKGncpHM8gIMoLnn/uvhZA67k8
extraerrordata.es5.debug.min.jssha384-hzIVwVxyVy/HNyuXAUCe1DR+O4KV4TcoblKQ/sZ/kEhe/ztgyZuhcP5BWWdBLFkW
extraerrordata.es5.jssha384-juSBhICmzwIWUSNx3sAULFuZdRhf1dKmw9IRcp+WwD5SupMMU/UeKsGuuzaJ7KaR
extraerrordata.es5.min.jssha384-+xhEP8S9HeuBzavG96laQzC71jeaM4xL87jWn8CmnkvLImWJcexRtoyJk99Cj+/C
extraerrordata.jssha384-7SXs7Ip1BANSacrdo+5poOUsvknlulgtwwRYDLLpWopKTO7r11I8qBExsBn8E7se
extraerrordata.min.jssha384-Y9HvnB1zZ5WA026fCOfbEeZ8c45ZQTkW/3yQ1j3EWkywrvtVOePVqQrVBBYbbS5+
offline.debug.min.jssha384-+SDfjXKvCctOdb0oouDTgh6oszAbJh45of/KbFmA89qnPeS4D+A1pz5bSYgtetjZ
offline.es5.debug.min.jssha384-Tb97BZOtzlZ9JwyaZsYENJSCgdyGqiK8xtNuNg8ifVc9tZ9OFGTNFO41FRnYPnXU
offline.es5.jssha384-AEvT67h4wwJYA6kiD7R5xsa5PBSKTA3+OZ20nQAMJiUcqczeS41Ld4U4oh9a0DGp
offline.es5.min.jssha384-VtmNMIHpAmrIMWteZNwM0FYveDXz+lqLWgJg9xVVzEnV0n/N5qaTdeuwV0LSnaXj
offline.jssha384-pYcB+vBOuk1EemEPVExEm15H4cE0bCjTxesfqlsJoX8VpF++BLWDi1HWqRAoFl80
offline.min.jssha384-B3OjjHCHHVUVDYhRYecxp6BhkAZhEyFu+wvSHeykQdIlEMcOB50p8xqi/SVvizEI
reportingobserver.debug.min.jssha384-VHTJGdgNPSe36nxx69EWWv6NPvnq1vyalj8M/VstVqvU9CaaZPVFWDojFh7TW9NK
reportingobserver.es5.debug.min.jssha384-LGL6qoR2csm+MUzPfHs/qraeAwCvbjkKxO0QcPQ38XZHU4epvW4rQjZ4nDaKylrL
reportingobserver.es5.jssha384-PNtqChwm8zMJaD99jl6Qu5QnBnCGssNznUT4GBB4xqDCqaGjm8u74RtPDyKlXPzT
reportingobserver.es5.min.jssha384-A078VbWZcNstxtsnW9QkDyv33y/Q7EcORpqf7D4pmMAp7X11x6DKMf8W0xhxFZCu
reportingobserver.jssha384-Xt/cAqGOjEufIlJ+JadC6Dh13k1WN9bG5quQW4uvN3WxAgBjuEvb8hlTJJ0BDtxx
reportingobserver.min.jssha384-INAUgo8KGUjyue30A00cAfpKh3mle8l0kG436bOVBqG0TMcBzxKBF55LQ87Sc/Ln
rewriteframes.debug.min.jssha384-p3w3Mrq4HHBh0bpKaBC7PJ0CxcJrn/cTLl/t/fTpRSgVhsPP9jAuVQvXgt4YVDe7
rewriteframes.es5.debug.min.jssha384-nF2LICkWuAVx0memNSNdRRq9/uQ6EkCzie9MkjvhUFypI/h+4rS4814yreTHDNtR
rewriteframes.es5.jssha384-E0PI0/Ui/T/FWaQsHsIrKoR4N+8rHxgB4X4d6dhqSPk9sKNh2k7J9c5TQqYJKSQm
rewriteframes.es5.min.jssha384-NitkCoc/eljyb2BpQ/42I9bST6kBcvq604WJuqd7BeZ31+OfcRVLb0p5ibTrCRCf
rewriteframes.jssha384-kZ5Mjn1izx82KwKhBtU5GBDsrh27dgjCtBvnMb5FfsrdQDfar9MIdmPZ3GTJzOMM
rewriteframes.min.jssha384-2xPHCeFgaSWfwklLHJJwOxgrzcYGD1Ik5csxHpmaTKF2K97pkgy72UuPTrBIbfOh
sessiontiming.debug.min.jssha384-at1zNg4aQXZ7pOy7Hz/GlDxjR0rrQWiPMNcQkWL3okROCltP6ssdv8ibX/IJKudF
sessiontiming.es5.debug.min.jssha384-u2ac9XNXVU9cF8/Era4bf1wB29E96DSi/IHfmTQ372ufkQ+P1C0nsOA8K4aAvA5m
sessiontiming.es5.jssha384-4byDVj6rlQhEDiRzTr9yXpIdwEQjOOex027RmocmQJ3CnFJjh6jKVa/Jx8wlxR8H
sessiontiming.es5.min.jssha384-8c9EtHGdWCCY3HKi0fXAtbbjgCd5R7ZLRZQ9p1lEPv3V10u/HAhSuaRRu9GodR8P
sessiontiming.jssha384-tX6fu57x2DKQD8ywdesMdrKTXVTSQFYUuHofpJ7IMs1wBc3vKOAL5m/Tw7gKcOGC
sessiontiming.min.jssha384-zY1rYx8A4mkAzAfzNn65wMSkZV/ldJ3UtX9sZgcaTLeOx/5KOBB5GlR5mBpwlI9u
transaction.debug.min.jssha384-Fu0D5LHlZTW365RolxTLqw26HccGDTS7dXg1ixusw4SbIa12sYmzbQUUGOA4bHAP
transaction.es5.debug.min.jssha384-9dA0axpn254eaWBL0LVfDWq0r050AQOXilMSspGTjt9wM7XDVn6/qEHTz1SbBpgp
transaction.es5.jssha384-2bqt+gpTQtkuzgeIf/m6JfGenzro/Nd18nDoHhQGrhcIce9Iw5AJR/n3g69fX+Cp
transaction.es5.min.jssha384-1ayGkHhGCTmPRy5dwsM/J7nM8+MamjnNlDjhqhvqs3qOQW2SFnjPK6Ktr32ctgeP
transaction.jssha384-4Uf9AfE1KQN8ixwv1ki238Ujmgq3sIQety7N+E4D8i5afx5FoB7LgrLZ/4asQEO9
transaction.min.jssha384-3r82y3UI9Hdafl/vHV2ntMo2eg2yOUCVGP4TxsBrfD63xYQwX8Sb4KcUaoqB3efM

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").