Help Center / Platforms / Configuration / Can I add 'async' or 'defer' to the script tag for the CDN version of the JavaScript browser SDK?

Can I add 'async' or 'defer' to the script tag for the CDN version of the JavaScript browser SDK?

Yes, you can, though keep in mind that any errors which occur in scripts which execute before the browser SDK script executes won’t be caught (because the SDK won’t be initialized yet).

In order to make this work, you’ll need to:

  1. Place the script tag for the browser SDK first, and
  2. Mark it, and all of your other scripts, defer (but not async), which will guarantee that it’s executed before any of the others.

All the help you could dream of

© 2021 • Sentry is a registered Trademark
of Functional Software, Inc.