Skip to content

Commit bf7b4a4

Browse files
authored
Merge branch 'master' into feat/android/tombstone_support
2 parents 46328f3 + fa5b04d commit bf7b4a4

File tree

1 file changed

+61
-47
lines changed
  • docs/platforms/javascript/guides/capacitor/migration/v2-to-v3

1 file changed

+61
-47
lines changed

docs/platforms/javascript/guides/capacitor/migration/v2-to-v3/index.mdx

Lines changed: 61 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,57 @@ sidebar_order: 7919
44
description: "Learn about migrating from Sentry Capacitor SDK 2.x to 3.x"
55
---
66

7-
<Alert level="warning" title="Important">
7+
Version 3 of the Sentry Capacitor SDK introduces API cleanup, version support changes, and adds Capacitor 8 support.
88

9+
The main goal of version 3 of Sentry Capacitor SDK is to provide compatibility with Sentry JavaScript version 10. To achieve this, the update includes breaking changes including the removal of deprecated APIs, reorganization of the npm package structure and also the refactoring on how you initialize Sentry Capacitor.
910

10-
Version 3 is still under development, this documentation may change before the final release.
11+
## Minimum Version Requirements
1112

13+
iOS, macOS, and tvOS have increased minimum version requirements:
1214

13-
</Alert>
15+
- **iOS**: 15.0+ (previously 11.0+)
16+
- **macOS**: 10.14+ (previously 10.13+)
17+
- **tvOS**: 15.0+ (previously 11.0+)
1418

15-
Version 3 of the Sentry Capacitor SDK primarily introduces API cleanup and version support changes.
16-
17-
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.
19+
## Self-Hosted Sentry Compatibility
1820

21+
If you are using a self-hosted Sentry instance, we recommend using version 24.4.2 or higher for full feature support.
1922

2023
## Major Changes in Sentry JS SDK v10
2124

2225
This update contains API cleanups related to `BaseClient`, `hasTracingEnabled`, and `logger` from `@sentry/core`.
23-
Each Sibling SDK has specific changes in version 10, follow the tutorials below to update the SDK.
26+
Each Sibling SDK has specific changes in version 10, follow the guides below to update the SDK.
2427

25-
- [Angular SDK 8.x to 9.x migration guide](/platforms/javascript/guides/angular/migration/v9-to-v10/).
26-
- [React SDK 8.x to 9.x migration guide](/platforms/javascript/guides/react/migration/v9-to-v10/).
27-
- [Vue SDK 8.x to 9.x migration guide](/platforms/javascript/guides/vue/migration/v9-to-v10/).
28-
- [Nuxt SDK 8.x to 9.x migration guide](/platforms/javascript/guides/nuxt/migration/v9-to-v10/).
28+
- [Angular SDK v9 to v10 migration guide](/platforms/javascript/guides/angular/migration/v9-to-v10/).
29+
- [React SDK v9 to v10 migration guide](/platforms/javascript/guides/react/migration/v9-to-v10/).
30+
- [Vue SDK v9 to v10 migration guide](/platforms/javascript/guides/vue/migration/v9-to-v10/).
31+
- [Nuxt SDK v9 to v10 migration guide](/platforms/javascript/guides/nuxt/migration/v9-to-v10/).
2932

3033
## Important Capacitor SDK `3.x` Changes
3134

3235
This section describes the changes in Sentry Capacitor SDK, version 3.
3336

34-
### Changes on How You Initialize the SDK on Projects Using Vue or Nuxt.
37+
### Changes on How You Initialize the SDK on Projects Using Vue or Nuxt
3538

36-
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`.
39+
Starting in version `3.0.0`, Vue and Nuxt options must be nested inside `siblingOptions` rather than passed directly to `Sentry.init()`.
3740

3841
```JavaScript diff {tabTitle: Vue}
3942
import * as Sentry from '@sentry/capacitor';
4043
import * as SentryVue from '@sentry/vue';
4144

4245
Sentry.init({
4346
- app: app,
44-
attachErrorHandler: false,
45-
dsn: '...',
46-
enableLogs: true,
4747
- attachErrorHandler: false,
4848
- attachProps: true,
49-
- attachErrorHandler: true,
50-
- tracingOptions: ...
49+
- tracingOptions: { ... },
50+
dsn: '...',
5151
+ siblingOptions: {
52-
+ vueOptions: {
53-
+ app: app,
54-
+ attachErrorHandler: false,
55-
+ attachProps: true,
56-
+ attachErrorHandler: true,
57-
+ tracingOptions: ...
58-
+ },
52+
+ vueOptions: {
53+
+ app: app,
54+
+ attachErrorHandler: false,
55+
+ attachProps: true,
56+
+ tracingOptions: { ... },
57+
+ },
5958
+ },
6059
}, SentryVue.init);
6160
```
@@ -66,34 +65,50 @@ import * as SentryNuxt from '@sentry/nuxt';
6665

6766
Sentry.init({
6867
- Vue: Vue,
69-
attachErrorHandler: false,
70-
dsn: '...',
71-
enableLogs: true,
7268
- attachErrorHandler: false,
7369
- attachProps: true,
74-
- attachErrorHandler: true,
75-
- tracingOptions: ...
70+
- tracingOptions: { ... },
71+
dsn: '...',
7672
+ siblingOptions: {
77-
+ nuxtOptions: {
78-
+ Vue: Vue,
79-
+ attachErrorHandler: false,
80-
+ attachProps: true,
81-
+ attachErrorHandler: true,
82-
+ tracingOptions: ...
83-
+ },
73+
+ nuxtOptions: {
74+
+ Vue: Vue,
75+
+ attachErrorHandler: false,
76+
+ attachProps: true,
77+
+ tracingOptions: { ... },
78+
+ },
8479
+ },
8580
}, SentryNuxt.init);
8681
```
8782

88-
### Logs are Out of Experimental
83+
### Removed APIs
84+
85+
The following APIs have been removed or renamed:
86+
87+
- `BaseClient` → use `Client` instead
88+
- `hasTracingEnabled()` → use `hasSpansEnabled()` instead
89+
- Internal logger exports from `@sentry/core` → use `debug` and `SentryDebugLogger` types
90+
91+
### Logs Configuration Changes
92+
93+
Logging options have been moved out of the `_experiments` namespace. Update your configuration as follows:
94+
95+
```javascript diff
96+
Sentry.init({
97+
dsn: '...',
98+
- _experiments: {
99+
- enableLogs: true,
100+
- beforeSendLog: (log) => log,
101+
- },
102+
+ enableLogs: true,
103+
+ beforeSendLog: (log) => log,
104+
});
105+
```
106+
107+
### Integration Changes
89108

90-
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.
91-
92-
### Integration Changes
93-
94-
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:
95-
96-
| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** |
109+
This version restores several integrations that were previously missing and adds a new Spotlight integration that works on both Web and Mobile. The following integrations are now available:
110+
111+
| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** |
97112
|-------------------------------------------------------|:----------------:|:----------:|:-----------:|:----------:|:----------------------:|
98113
| <PlatformLink to="/configuration/integrations/breadcrumbs/">`breadcrumbsIntegration`</PlatformLink> || | | ||
99114
| <PlatformLink to="/configuration/integrations/browserapierrors/">`browserApiErrorsIntegration`</PlatformLink> ||| | | |
@@ -102,7 +117,6 @@ to keep using logs, you need to move your parameters from `Options._experimental
102117
| <PlatformLink to="/configuration/integrations/globalhandlers/">`globalHandlersIntegration`</PlatformLink> ||| | | |
103118
| <PlatformLink to="/configuration/integrations/inboundfilters/">`inboundFiltersIntegration`</PlatformLink> ||| | | |
104119
| <PlatformLink to="/configuration/integrations/linkederrors/">`linkedErrorsIntegration`</PlatformLink> ||| | | |
105-
| <PlatformLink to="/configuration/integrations/spotlight/">`spotlightIntegration`</PlatformLink> | | | | | |
106-
120+
| <PlatformLink to="/configuration/integrations/spotlight/">`spotlightIntegration`</PlatformLink> | | | | | |
107121

108122
<PageGrid/>

0 commit comments

Comments
 (0)