Migrate from 2.x to 3.x
Learn about migrating from Sentry Capacitor SDK 2.x to 3.x
Important
Version 3 is still under development, this documentation may change before the final release.
Version 3 of the Sentry Capacitor SDK primarily introduces API cleanup and version support changes.
The main goal of version 3 of Sentry Capacitor SDK is to provide compatibility with Sentry JavaScript version 10. This update includes breaking changes due to the upgrade to JavaScript SDK v10, the removal of deprecated APIs, reorganization of the npm package structure and also the refactoring on how you initialize Sentry Capacitor.
This update contains API cleanups related to BaseClient, hasTracingEnabled, and logger from @sentry/core. Each Sibling SDK has specific changes in version 10, follow the tutorials below to update the SDK.
- Angular SDK 8.x to 9.x migration guide.
- React SDK 8.x to 9.x migration guide.
- Vue SDK 8.x to 9.x migration guide.
- Nuxt SDK 8.x to 9.x migration guide.
This section describes the changes in Sentry Capacitor SDK, version 3.
Starting on version 3.0.0, calling sentry.init will break; to fix it, you will need to move the sibling parameters from the root option to siblingOptions inside the root of CapacitorOptions.
import * as Sentry from '@sentry/capacitor';
import * as SentryVue from '@sentry/vue';
Sentry.init({
- app: app,
attachErrorHandler: false,
dsn: '...',
enableLogs: true,
- attachErrorHandler: false,
- attachProps: true,
- attachErrorHandler: true,
- tracingOptions: ...
+ siblingOptions: {
+ vueOptions: {
+ app: app,
+ attachErrorHandler: false,
+ attachProps: true,
+ attachErrorHandler: true,
+ tracingOptions: ...
+ },
+ },
}, SentryVue.init);
to keep using logs, you need to move your parameters from Options._experimental.* into Options.*, the _experimental field was removed on version 3.0.0 but may return once new experimental fields appear.
This version will include more integrations by default and also a new Spotlight integration that works on both Web and Mobile. See the list below with the new integrations:
| Auto Enabled | Errors | Tracing | Replay | Additional Context | |
|---|---|---|---|---|---|
breadcrumbsIntegration | ✓ | ✓ | |||
browserApiErrorsIntegration | ✓ | ✓ | |||
dedupeIntegration | ✓ | ✓ | |||
functionToStringIntegration | ✓ | ||||
globalHandlersIntegration | ✓ | ✓ | |||
inboundFiltersIntegration | ✓ | ✓ | |||
linkedErrorsIntegration | ✓ | ✓ | |||
spotlightIntegration |
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").