Skip to content
Open
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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The Sentry.init example in spotlight.mdx uses an undefined siblingSdk variable, causing a ReferenceError.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

The code example in docs/platforms/javascript/guides/capacitor/configuration/integrations/spotlight.mdx (lines 18-28) uses an undefined variable siblingSdk as the second argument to Sentry.init. This variable is not declared or imported, leading to a ReferenceError: siblingSdk is not defined at runtime if developers copy the example. This will cause application initialization to fail, as the example needs to specify a framework-specific SDK and its corresponding import.

💡 Suggested Fix

Replace siblingSdk with a framework-specific Sentry SDK init function (e.g., SentryVue.init) and add the corresponding import statement (e.g., import * as SentryVue from '@sentry/vue';) to the code example.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location:
docs/platforms/javascript/guides/capacitor/configuration/integrations/spotlight.mdx#L18-L28

Potential issue: The code example in
`docs/platforms/javascript/guides/capacitor/configuration/integrations/spotlight.mdx`
(lines 18-28) uses an undefined variable `siblingSdk` as the second argument to
`Sentry.init`. This variable is not declared or imported, leading to a `ReferenceError:
siblingSdk is not defined` at runtime if developers copy the example. This will cause
application initialization to fail, as the example needs to specify a framework-specific
SDK and its corresponding import.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 6119133

```
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`. For details and other general JavaScript SDK version 10 changes.
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