Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Spotlight
description: "The Spotlight integration enables real-time observability for errors, traces, logs, and performance data during local development."
---

<Alert level="info">
The `spotlightIntegration` is only supported in Sentry Capacitor SDK 3.0.0 and newer.
</Alert>

[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.

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.

### Usage

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.

```javascript diff
import * as Sentry from '@sentry/capacitor';

Sentry.init({
+ integrations: [
+ Sentry.spotlightIntegration({
+ sidecarUrl: 'IP:PORT/stream' //Only required when testing outside of a browser.
+ }),
]
}, siblingSdk);

Comment on lines +18 to +28

This comment was marked as outdated.

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
title: Migrate from 2.x to 3.x
sidebar_order: 7919
description: "Learn about migrating from Sentry Capacitor SDK 2.x to 3.x"
---

<Alert level="warning" title="Important">


Version 3 is still under development, this documentation may change before the final release.


</Alert>

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.


## Major Changes in Sentry JS SDK v10

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](/platforms/javascript/guides/angular/migration/v9-to-v10/).
- [React SDK 8.x to 9.x migration guide](/platforms/javascript/guides/react/migration/v9-to-v10/).
- [Vue SDK 8.x to 9.x migration guide](/platforms/javascript/guides/vue/migration/v9-to-v10/).
- [Nuxt SDK 8.x to 9.x migration guide](/platforms/javascript/guides/nuxt/migration/v9-to-v10/).

## Important Capacitor SDK `3.x` Changes

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

### Changes on How You Initialize the SDK on Projects Using Vue or Nuxt.

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`.

```JavaScript diff {tabTitle: Vue}
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);
```

```JavaScript diff {tabTitle: Nuxt}
import * as Sentry from '@sentry/capacitor';
import * as SentryNuxt from '@sentry/nuxt';

Sentry.init({
- Vue: Vue,
attachErrorHandler: false,
dsn: '...',
enableLogs: true,
- attachErrorHandler: false,
- attachProps: true,
- attachErrorHandler: true,
- tracingOptions: ...
+ siblingOptions: {
+ nuxtOptions: {
+ Vue: Vue,
+ attachErrorHandler: false,
+ attachProps: true,
+ attachErrorHandler: true,
+ tracingOptions: ...
+ },
+ },
}, SentryNuxt.init);
```

### Logs are Out of Experimental

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.

### Integration Changes

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** |
|-------------------------------------------------------|:----------------:|:----------:|:-----------:|:----------:|:----------------------:|
| <PlatformLink to="/configuration/integrations/breadcrumbs/">`breadcrumbsIntegration`</PlatformLink> | ✓ | | | | ✓ |
| <PlatformLink to="/configuration/integrations/browserapierrors/">`browserApiErrorsIntegration`</PlatformLink> | ✓ | ✓ | | | |
| <PlatformLink to="/configuration/integrations/dedupe/">`dedupeIntegration`</PlatformLink> | ✓ | ✓ | | | |
| <PlatformLink to="/configuration/integrations/functiontostring/">`functionToStringIntegration`</PlatformLink> | ✓ | | | | |
| <PlatformLink to="/configuration/integrations/globalhandlers/">`globalHandlersIntegration`</PlatformLink> | ✓ | ✓ | | | |
| <PlatformLink to="/configuration/integrations/inboundfilters/">`inboundFiltersIntegration`</PlatformLink> | ✓ | ✓ | | | |
| <PlatformLink to="/configuration/integrations/linkederrors/">`linkedErrorsIntegration`</PlatformLink> | ✓ | ✓ | | | |
| <PlatformLink to="/configuration/integrations/spotlight/">`spotlightIntegration`</PlatformLink> | | | | | |


<PageGrid/>
Loading