Skip to content

Commit 1c9bc9e

Browse files
Feat(Capcitor): Add Capacitor v3 migration guide (#15740)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR This PR adds a migration guide to Capacitor V3. It also adds a description to a new integration for spotlight. ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [x] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/) --------- Co-authored-by: Alex Krawiec <alex.krawiec@sentry.io>
1 parent a20792e commit 1c9bc9e

File tree

2 files changed

+137
-0
lines changed

2 files changed

+137
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: Spotlight
3+
description: "The Spotlight integration enables real-time observability for errors, traces, logs, and performance data during local development."
4+
---
5+
6+
<Alert level="info">
7+
The `spotlightIntegration` is only supported in Sentry Capacitor SDK 3.0.0 and newer.
8+
</Alert>
9+
10+
[Sentry Spotlight](https://spotlightjs.com/) is a local development tool that provides real-time observability for errors, traces, logs, and performance data during development. It allows you to see Sentry events in real-time without sending them to Sentry's servers, making it perfect for local debugging.
11+
12+
To set up Spotlight, follow the [Spotlight setup guide](https://spotlightjs.com/). Once Spotlight is running, you can enable the integration in your Capacitor app.
13+
14+
### Usage
15+
16+
The `spotlightIntegration` sends a copy of all Sentry events to your local Spotlight instance during development. This allows you to debug issues locally with full visibility into errors, transactions, and other telemetry data.
17+
18+
```javascript diff
19+
import * as Sentry from '@sentry/capacitor';
20+
21+
Sentry.init({
22+
+ integrations: [
23+
+ Sentry.spotlightIntegration({
24+
+ sidecarUrl: 'IP:PORT/stream' //Only required when testing outside of a browser.
25+
+ }),
26+
]
27+
}, siblingSdk);
28+
29+
```
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
title: Migrate from 2.x to 3.x
3+
sidebar_order: 7919
4+
description: "Learn about migrating from Sentry Capacitor SDK 2.x to 3.x"
5+
---
6+
7+
<Alert level="warning" title="Important">
8+
9+
10+
Version 3 is still under development, this documentation may change before the final release.
11+
12+
13+
</Alert>
14+
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.
18+
19+
20+
## Major Changes in Sentry JS SDK v10
21+
22+
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.
24+
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/).
29+
30+
## Important Capacitor SDK `3.x` Changes
31+
32+
This section describes the changes in Sentry Capacitor SDK, version 3.
33+
34+
### Changes on How You Initialize the SDK on Projects Using Vue or Nuxt.
35+
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`.
37+
38+
```JavaScript diff {tabTitle: Vue}
39+
import * as Sentry from '@sentry/capacitor';
40+
import * as SentryVue from '@sentry/vue';
41+
42+
Sentry.init({
43+
- app: app,
44+
attachErrorHandler: false,
45+
dsn: '...',
46+
enableLogs: true,
47+
- attachErrorHandler: false,
48+
- attachProps: true,
49+
- attachErrorHandler: true,
50+
- tracingOptions: ...
51+
+ siblingOptions: {
52+
+ vueOptions: {
53+
+ app: app,
54+
+ attachErrorHandler: false,
55+
+ attachProps: true,
56+
+ attachErrorHandler: true,
57+
+ tracingOptions: ...
58+
+ },
59+
+ },
60+
}, SentryVue.init);
61+
```
62+
63+
```JavaScript diff {tabTitle: Nuxt}
64+
import * as Sentry from '@sentry/capacitor';
65+
import * as SentryNuxt from '@sentry/nuxt';
66+
67+
Sentry.init({
68+
- Vue: Vue,
69+
attachErrorHandler: false,
70+
dsn: '...',
71+
enableLogs: true,
72+
- attachErrorHandler: false,
73+
- attachProps: true,
74+
- attachErrorHandler: true,
75+
- tracingOptions: ...
76+
+ siblingOptions: {
77+
+ nuxtOptions: {
78+
+ Vue: Vue,
79+
+ attachErrorHandler: false,
80+
+ attachProps: true,
81+
+ attachErrorHandler: true,
82+
+ tracingOptions: ...
83+
+ },
84+
+ },
85+
}, SentryNuxt.init);
86+
```
87+
88+
### Logs are Out of Experimental
89+
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** |
97+
|-------------------------------------------------------|:----------------:|:----------:|:-----------:|:----------:|:----------------------:|
98+
| <PlatformLink to="/configuration/integrations/breadcrumbs/">`breadcrumbsIntegration`</PlatformLink> || | | ||
99+
| <PlatformLink to="/configuration/integrations/browserapierrors/">`browserApiErrorsIntegration`</PlatformLink> ||| | | |
100+
| <PlatformLink to="/configuration/integrations/dedupe/">`dedupeIntegration`</PlatformLink> ||| | | |
101+
| <PlatformLink to="/configuration/integrations/functiontostring/">`functionToStringIntegration`</PlatformLink> || | | | |
102+
| <PlatformLink to="/configuration/integrations/globalhandlers/">`globalHandlersIntegration`</PlatformLink> ||| | | |
103+
| <PlatformLink to="/configuration/integrations/inboundfilters/">`inboundFiltersIntegration`</PlatformLink> ||| | | |
104+
| <PlatformLink to="/configuration/integrations/linkederrors/">`linkedErrorsIntegration`</PlatformLink> ||| | | |
105+
| <PlatformLink to="/configuration/integrations/spotlight/">`spotlightIntegration`</PlatformLink> | | | | | |
106+
107+
108+
<PageGrid/>

0 commit comments

Comments
 (0)