Migrate from 6.x to 7.x
Learn about migrating from Sentry JavaScript SDK 6.x to 7.x
The v7 version of the JavaScript SDK requires a self-hosted version of Sentry 20.6.0
or higher.
The main goal of version 7 is to reduce bundle size. This version is breaking because we removed deprecated APIs, upgraded our build tooling, and restructured npm package contents. Below we will outline all the breaking changes you should consider when upgrading.
TL;DR If you only use basic features of Sentry, or you simply copy & pasted the setup examples from our docs, here's what changed for you:
- If you installed additional Sentry packages, such as
@sentry/tracing
alongside your Sentry SDK (e.g.@sentry/react
or@sentry/node
), make sure to upgrade all of them to version 7. - Our CDN bundles are now ES6 - you will need to reconfigure your script tags if you want to keep supporting ES5 and IE11 on the new SDK version.
- Distributed CommonJS files will be ES6. Use a transpiler if you need to support old node versions.
- We bumped the TypeScript version we generate our types with to
3.8.3
. Please check if your TypeScript projects using TypeScript version3.7
or lower still compile. Otherwise, upgrade your TypeScript version. whitelistUrls
andblacklistUrls
have been renamed toallowUrls
anddenyUrls
in theSentry.init()
options.- The
UserAgent
integration is now calledHttpContext
. - If you are using Tracing and with tracing enabled, you might have to make adjustments to your server's CORS settings.
Please see our detailed migration guide for more information on migrating from 6.x
to 7.x
.
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").