Skip to content

Commit

Permalink
Merge branch 'getsentry:master' into unreal-engine
Browse files Browse the repository at this point in the history
  • Loading branch information
tustanivsky authored Oct 24, 2024
2 parents c647b67 + 7db6d32 commit 5ca9e93
Show file tree
Hide file tree
Showing 25 changed files with 699 additions and 533 deletions.
4 changes: 2 additions & 2 deletions apps/changelog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-toolbar": "^1.0.4",
"@radix-ui/themes": "^2.0.3",
"@sentry/nextjs": "8.34.0",
"@sentry/nextjs": "8.36.0-beta.0",
"@spotlightjs/spotlight": "^2.1.1",
"next": "15.0.0-rc.1",
"next-auth": "^4.24.5",
Expand Down Expand Up @@ -63,4 +63,4 @@
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]"
}
}
}
2 changes: 1 addition & 1 deletion docs/platforms/android/session-replay/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ options.experimental.sessionReplay.maskAllImages = false

## Error Linking

Errors that happen on the page while a replay is running will be linked to the replay, making it possible to jump between related issues and replays. However, it's **possible** that in some cases the error count reported on the **Replays Details** page won't match the actual errors that have been captured. That's because errors can be lost, and while this is uncommon, there are a few reasons why it could happen:
Errors that happen while a replay is running will be linked to the replay, making it possible to jump between related issues and replays. However, it's **possible** that in some cases the error count reported on the **Replays Details** page won't match the actual errors that have been captured. That's because errors can be lost, and while this is uncommon, there are a few reasons why it could happen:

- The replay was rate-limited and couldn't be accepted.
- The replay was deleted by a member of your org.
Expand Down
10 changes: 8 additions & 2 deletions docs/platforms/apple/guides/ios/session-replay/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ options.experimental.sessionReplay.redactAllImages = false

## Error Linking

Errors that happen on the page while a replay is running will be linked to the replay, making it possible to jump between related issues and replays. However, it's **possible** that in some cases the error count reported on the **Replays Details** page won't match the actual errors that have been captured. That's because errors can be lost, and while this is uncommon, there are a few reasons why it could happen:
Errors that happen while a replay is running will be linked to the replay, making it possible to jump between related issues and replays. However, it's **possible** that in some cases the error count reported on the **Replays Details** page won't match the actual errors that have been captured. That's because errors can be lost, and while this is uncommon, there are a few reasons why it could happen:

- The replay was rate-limited and couldn't be accepted.
- The replay was deleted by a member of your org.
Expand All @@ -101,7 +101,13 @@ Errors that happen on the page while a replay is running will be linked to the r
### FAQ

Q: Does Session Replay work with SwiftUI?

A: Yes. It works with both UIKit and SwiftUI.

Q: Why are parts of my replay not masked?

A: Text views, input views, images, video players and webviews are all masked by default. Images with bundled assets aren't masked because the likelihood of these assets containing PII is low. If you encounter a view that should be masked by default, consider opening a [GitHub issue](https://github.com/getsentry/sentry-cocoa/issues).

Q: What's the lowest version of iOS supported?
A: Session Replay recording happens even on the lowest version supported by the Sentry SDK. (Today that's iOS 12.)

A: Session Replay recording happens even on the lowest version supported by the Sentry SDK, which is aligend with appstore support.
101 changes: 101 additions & 0 deletions docs/platforms/flutter/session-replay/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
title: Set Up Session Replay
sidebar_order: 5500
notSupported:
description: "Learn how to enable the Mobile Session Replay Beta in your app."
---

<Note>

Mobile support for Session Replay is in Beta. Features available in Beta are still work-in-progress and may have bugs. We recognize the irony.

If you have any questions, feedback or would like to report a bug, please open a [GitHub issue](https://github.com/getsentry/sentry-dart/issues/new?template=BUG_REPORT.yml) with a link to a relevant replay in Sentry if possible.

</Note>

[Session Replay](/product/explore/session-replay/) helps you get to the root cause of an error or latency issue faster by providing you with a reproduction of what was happening in the user's device before, during, and after the issue. You can rewind and replay your application's state and see key user interactions, like taps, swipes, network requests, and console entries, in a single UI.

By default, our Session Replay SDK masks all text content, images, and user input, giving you heightened confidence that no sensitive data will leave the device. To learn more, see [product docs](/product/explore/session-replay/).

## Pre-requisites

Make sure your Sentry Flutter SDK version is at least 8.9.0, which is required for Session Replay.
You can update your `pubspec.yaml` to the matching version:

```yaml
dependencies:
sentry_flutter: ^8.9.0
```
## Setup
To set up the integration, add the following to your Sentry initialization:
```dart
await SentryFlutter.init(
(options) {
...
options.experimental.replay.sessionSampleRate = 1.0;
options.experimental.replay.onErrorSampleRate = 1.0;
},
appRunner: () => runApp(MyApp()),
);
```

## Verify

While you're testing, we recommend that you set <PlatformIdentifier name="replays-session-sample-rate" /> to `1.0`. This ensures that every user session will be sent to Sentry.

Once testing is complete, **we recommend lowering this value in production**. We still recommend keeping <PlatformIdentifier name="replays-on-error-sample-rate" /> set to `1.0`.

## Sampling

Sampling allows you to control how much of your website's traffic will result in a Session Replay. There are two sample rates you can adjust to get the replays relevant to you:

1. <PlatformIdentifier name="replays-session-sample-rate" /> - The sample rate for
replays that begin recording immediately and last the entirety of a user's session.
2. <PlatformIdentifier name="replays-on-error-sample-rate" /> - The sample rate for
replays that are recorded when an error happens. This type of replay will record
up to a minute of events prior to the error and continue recording until the session
ends.

Sampling starts as soon as a session begins. The <PlatformIdentifier name="replays-session-sample-rate" /> is then evaluated. If the session is sampled, replay recording will start immediately. If not, <PlatformIdentifier name="replays-on-error-sample-rate" /> will be evaluated. If the session is sampled at this point, the replay will be buffered and will only be uploaded to Sentry if an error occurs.

## Privacy

The SDK is recording and aggressively redacting (masking) all text and images, according to the configuration in `options.experimental.replay`.
You can tune this and add custom masking rules to fit your needs. For example, you can explicitly mask or unmask widgets by type,
or you can even have a callback to decide whether a specific widget instance should be masked:

```dart
options.experimental.replay.mask<IconButton>();
options.experimental.replay.unmask<Image>();
options.experimental.replay.maskCallback<Text>(
(Element element, Text widget) =>
(widget.data?.contains('secret') ?? false)
? SentryMaskingDecision.mask
: SentryMaskingDecision.continueProcessing);
```

You can find more details in the documentation for each method.

<Note>

If you find that data isn't being redacted with the default settings, please let us know by creating a [GitHub issue](https://github.com/getsentry/sentry-dart/issues/new?template=BUG_REPORT.yml).

</Note>

To disable redaction altogether (not to be used on applications with sensitive data):

```dart
options.experimental.replay.maskAllText = false;
options.experimental.replay.maskAllImages = false;
```

## Error Linking

Errors that happen while a replay is running will be linked to the replay, making it possible to jump between related issues and replays. However, it's **possible** that in some cases the error count reported on the **Replays Details** page won't match the actual errors that have been captured. That's because errors can be lost, and while this is uncommon, there are a few reasons why it could happen:

- The replay was rate-limited and couldn't be accepted.
- The replay was deleted by a member of your org.
- There were network errors and the replay wasn't saved.
22 changes: 21 additions & 1 deletion docs/platforms/javascript/common/install/npm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,24 @@ notSupported:
- javascript.cloudflare
---

<PlatformContent includePath="getting-started-install" />
The npm package for Sentry offers several advantages for specific use cases:

- **Framework-specific features**: If you're using a framework like React or Vue, installing the corresponding Sentry SDK (e.g., `@sentry/react` or `@sentry/vue`) via npm provides framework-specific features and optimizations.

- **Full public API access**: The npm package exposes the complete set of Sentry's public APIs, allowing for more extensive customization and functionality.

- **Version control**: Installing via npm gives you full control over the SDK version, enabling you to manage updates and ensure compatibility with your project.

- **Build process integration**: Using the npm package allows for better integration with your build process and bundling tools.

```bash {tabTitle:npm}
npm install @sentry/browser --save
```

```bash {tabTitle:yarn}
yarn add @sentry/browser
```

```bash {tabTitle:pnpm}
pnpm add @sentry/browser
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ notSupported:
- javascript.nestjs
---

Sentry's JavaScript SDKs support ES2018 compatible browsers. The minimum supported browser versions are:
Sentry's JavaScript SDKs require ES2018 compatibility plus support for [`globalThis`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis). The minimum supported browser versions are:

- Chrome 63
- Chrome 71
- Edge 79
- Safari/iOS Safari 12
- Firefox 58
- Opera 50
- Samsung Internet 8.2
- Safari 12.1, iOS Safari 12.2
- Firefox 65
- Opera 58
- Samsung Internet 10

In addition, the Sentry JavaScript SDKs require the `fetch` API to be available. If you need to support browser-like environments that do not have `fetch` available, you should include a polyfill for the fetch API.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,45 +30,7 @@ The following options can be configured for the integration in `feedbackIntegrat

If you have `autoInject: true` a button will be inserted into the page that triggers the form to pop up so the user can enter their feedback. If instead you want to control when this injection happens, call the `feedback.createWidget()` method to get a reference to an `Actor` object, and then call `appendToDom()` to insert it into the page.

```javascript
const feedback = feedbackIntegration({
// Disable injecting the default widget
autoInject: false,
});

// Create and render the button
const widget = feedback.createWidget();

// Later, when it's time to clean up:
widget.removeFromDom();
```
```typescript {tabTitle: NextJS}
function ToggleFeedbackButton() {
const [feedback, setFeedback] = useState();
// Read `getFeedback` on the client only, to avoid hydration errors when server rendering
useEffect(() => {
setFeedback(Sentry.getFeedback());
}, []);

const [widget, setWidget] = useState();
return (
<button
type="button"
onClick={async () => {
if (widget) {
widget.removeFromDom();
setWidget(null);
} else {
setWidget(feedback.createWidget());
}
}}
>
{widget ? "Remove Widget" : "Create Widget"}
</button>
);
}
```

<PlatformContent includePath="user-feedback/manual-injection" />

Read more about how to [use your own UI](#bring-your-own-button) below.

Expand Down Expand Up @@ -257,7 +219,7 @@ You can use your own button instead of the default injected button to trigger th

```javascript
const feedback = feedbackIntegration({
// Disable injecting the default widget
// Disable the injection of the default widget
autoInject: false,
});

Expand All @@ -268,7 +230,7 @@ feedback.attachTo(document.querySelector("#your-button"), {
```typescript {tabTitle: NextJs}
function AttachToFeedbackButton() {
const [feedback, setFeedback] = useState();
// Read `getFeedback` on the client only, to avoid hydration errors when server rendering
// Read `getFeedback` on the client only, to avoid hydration errors during server rendering
useEffect(() => {
setFeedback(Sentry.getFeedback());
}, []);
Expand All @@ -294,7 +256,7 @@ Alternatively, you can call `feedback.createForm()` and have full control over w

```javascript
const feedback = feedbackIntegration({
// Disable injecting the default widget
// Disable the injection of the default widget
autoInject: false,
});

Expand All @@ -305,7 +267,7 @@ form.open();
```typescript {tabTitle: NextJS}
function CreateFeedbackFromButton() {
const [feedback, setFeedback] = useState();
// Read `getFeedback` on the client only, to avoid hydration errors when server rendering
// Read `getFeedback` on the client only, to avoid hydration errors during server rendering
useEffect(() => {
setFeedback(Sentry.getFeedback());
}, []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ You can use your own button instead of the default injected button to trigger th

```javascript
const feedback = feedbackIntegration({
// Disable injecting the default widget
// Disable the injection of the default widget
autoInject: false,
});

Expand Down
104 changes: 104 additions & 0 deletions docs/platforms/javascript/guides/nuxt/features/pinia.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
title: Pinia
description: "Learn about enabling Sentry's Pinia plugin in Nuxt."
---

To capture [Pinia](https://pinia.vuejs.org/) state data, add `trackPinia` to your client-side Sentry configuration:

```javascript {3} {filename:sentry.client.config.ts}
Sentry.init({
dsn: "___PUBLIC_DSN___",
trackPinia: true // `true` will apply default options
});
```

## Normalization Depth

By default, Sentry SDKs normalize any context to a depth of 3. You may want to increase this for sending Pinia states by passing `normalizeDepth` to the `Sentry.init` call:

```javascript {4} {filename:sentry.client.config.ts}
Sentry.init({
dsn: "___PUBLIC_DSN___",
trackPinia: true,
normalizeDepth: 10, // Or however deep you want your state context to be.
});
```

## Options

When enabling `trackPinia` with `true`, all default options are automatically applied. To configure the Pinia plugin manually, pass an options object to `trackPinia`.

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

While we try our best to filter out Personally Identifiable Information (PII) such as user passwords, we advise against sending sensitive information to Sentry.

</Alert>


### `attachPiniaState` (Boolean)

This is used to attach Pinia state to Sentry events. By default, this is set to `true`. If you don't want to attach Pinia state to events being sent to Sentry, set this to `false`:

```javascript {2} {filename:sentry.client.config.ts}
trackPinia: {
attachPiniaState: false
}
```

### `addBreadcrumbs` (Boolean)

This is used to add breadcrumbs to Sentry events. By default, this is set to `true`. If you don't want to add breadcrumbs to events being sent to Sentry, set this to `false`:

```javascript {2} {filename:sentry.client.config.ts}
trackPinia: {
addBreadcrumbs: false
}
```

### `actionTransformer` (Function)

This can be used to remove sensitive information from Pinia actions. The first parameter passed to the function is the Pinia action name. We send all actions by default, if you don't want an action name sent to Sentry, use `return null`:

```javascript {2-9} {filename:sentry.client.config.ts}
trackPinia: {
actionTransformer: (action) => {
if (action === "GOVERNMENT_SECRETS") {
// Return null to not log the action to Sentry
return null;
}

return action;
},
}
```

### `stateTransformer` (Function)

This is used to remove sensitive information from a Pinia state. The first parameter passed to the function is the Pinia state. We attach all state changes by default. If you don't want to attach state changes to events being sent to Sentry, use `return null`. Note, that if you choose not to send state to Sentry, your errors might not have the latest version attached:

```javascript {2-23} {filename:sentry.client.config.ts}
trackPinia: {
stateTransformer: (state) => {
if (state.topSecret.doNotSend) {
// Return null to not send this version of the state.
return null;
}

// Transform the state to remove sensitive information
const transformedState = {
...state,
topSecret: {
...state.topSecret,
// Replace sensitive information with something else
nuclearLaunchCodes: "I love pizza",
// or just remove it entirely
hiddenTreasureLocation: null,
},
// You should also remove large data that is irrelevant to debugging to not clutter your Sentry issues
giganticState: null,
};

return transformedState;
},
}
```
Loading

0 comments on commit 5ca9e93

Please sign in to comment.