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
Expand Up @@ -13,7 +13,7 @@ The following options can be configured in the `options.replay` field of your Se
| Key | Type | Default | Description |
| ------------------------ | -------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| sessionSampleRate | `double` | `0` | The sample rate for replays that begin recording immediately and last the entirety of the user's session. `1.0` collects all replays, and `0` collects none. |
| onErrorSampleRate | `double` | `0` | 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. `1.0` captures all sessions with an error, and `0` captures none. |
| onErrorSampleRate | `double` | `0` | The sample rate for replays that are recorded when an error happens or when feedback is captured. This type of replay will record up to 30 seconds of events prior to the trigger and continue recording until the session ends. `1.0` captures all sessions with an error or feedback, and `0` captures none. |
| quality | [SentryReplayQuality](https://pub.dev/documentation/sentry_flutter/latest/sentry_flutter/SentryReplayQuality.html) | `SentryReplayQuality.medium` | Defines the image quality of the session replay. The higher the quality, the more accurate the replay will be, but also more data to transfer and more CPU load. |

## Configure Network Details
Expand Down
12 changes: 6 additions & 6 deletions docs/platforms/dart/guides/flutter/session-replay/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@ A user session starts when the Sentry SDK is initialized or when the application

The session will be terminated if the application has spent in the background more than 30 seconds or when the maximum duration of 60 minutes is reached. You can adjust the [session tracking interval](/platforms/dart/guides/flutter/configuration/releases/#sessions) to extend or shorten the duration of a single replay, depending on your needs. Note that if the application exits abnormally while running in the background, the session will also be terminated.

### Replay Captures on Errors Only
### Buffered Replays for Errors and User Feedback

If you prefer not to record an entire session, you can elect to capture a replay only if an error occurs. In this case, the integration will buffer up to one minute worth of events prior to the error being thrown. It will continue to record the session, following the rules above regarding session life and activity. Read the [sampling](#sampling) section for configuration options.
If you prefer not to record an entire session, you can elect to capture a replay only when an error occurs or when your app captures feedback. In this case, the integration will buffer up to 30 seconds worth of events prior to the trigger. It will continue to record the session, following the rules above regarding session life and activity. For the built-in <PlatformLink to="/user-feedback/#sentryfeedbackform">`SentryFeedbackForm`</PlatformLink>, the buffer is sent when the form opens, so the replay shows what happened before the user started entering feedback. Read the [sampling](#sampling) section for configuration options.

## 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:
Sampling allows you to control how much of your app's traffic will result in a Session Replay. There are two sample rates you can adjust to get the replays relevant to you:

1. `sessionSampleRate` - The sample rate for replays that begin recording immediately and last the entirety of a user's session.
2. `onErrorSampleRate` - 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.
2. `onErrorSampleRate` - The sample rate for replays that are recorded when an error happens or when feedback is captured. This type of replay will record
up to 30 seconds of events prior to the trigger and continue recording until the session ends.

Sampling starts as soon as a session begins. The `sessionSampleRate` is then evaluated. If the session is sampled, replay recording will start immediately. If not, `onErrorSampleRate` 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.
Sampling starts as soon as a session begins. The `sessionSampleRate` is then evaluated. If the session is sampled, replay recording will start immediately. If not, `onErrorSampleRate` 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, your app calls `Sentry.captureFeedback()`, or the built-in feedback form opens.

## PII & Privacy Considerations

Expand Down
16 changes: 10 additions & 6 deletions docs/platforms/dart/guides/flutter/user-feedback/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ The user feedback API allows you to collect user feedback while utilizing your o

<PlatformContent includePath="user-feedback/sdk-api-example/" />

## SentryFeedbackWidget
## SentryFeedbackForm

Use the `SentryFeedbackWidget` to let users send feedback data to Sentry.
Use the `SentryFeedbackForm` to let users send feedback data to Sentry. In Sentry Flutter SDK versions before `9.21.0`, this class is named `SentryFeedbackWidget`.

The widget requests and collects the user's name, email address, and a description of what occurred. When an event identifier is provided, Sentry pairs the feedback with the original event, giving you additional insights into issues.

Expand All @@ -38,7 +38,7 @@ The image below provides an example of the widget, though yours may differ depen

### Integration

One possible use for the `SentryFeedbackWidget` is to listen for specific Sentry events in the `beforeSend` callback and show the widget to users. Users also can take a screenshot from their app's UI if the `SentryWidget` is wrapped around the main app widget.
One possible use for the `SentryFeedbackForm` is to listen for specific Sentry events in the `beforeSend` callback and show the widget to users. Users also can take a screenshot from their app's UI if the `SentryWidget` is wrapped around the main app widget.

```dart
// The example uses the `NavigatorState` to present the widget. Adapt as needed to your navigation stack.
Expand All @@ -57,7 +57,7 @@ Future<void> main() async {

final context = navigatorKey.currentContext;
if (context != null && context.mounted) {
SentryFeedbackWidget.show(
SentryFeedbackForm.show(
context,
associatedEventId: event.eventId,
screenshot: screenshot,
Expand All @@ -74,9 +74,13 @@ Future<void> main() async {
}
```

### Session Replay
Comment thread
sentry-junior[bot] marked this conversation as resolved.

The `SentryFeedbackForm` works with <PlatformLink to="/session-replay/">Session Replay</PlatformLink> on iOS and Android in Sentry Flutter SDK `9.0.0` and later. With <PlatformLink to="/session-replay/#sampling">`onErrorSampleRate`</PlatformLink> set, the SDK buffers up to 30 seconds of the user's session and sends it when the form opens or when your app calls `Sentry.captureFeedback()`. This way, the replay shows what led the user to report the problem instead of only their interactions with the form.

### Customization

You can customize the `SentryFeedbackWidget` to your needs by modifying the `SentryFeedbackOptions` class, which is provided by the `SentryFlutter.init` options.
You can customize the `SentryFeedbackForm` to your needs by modifying the `SentryFeedbackOptions` class, which is provided by the `SentryFlutter.init` options.

```dart
SentryFlutter.init((options) {
Expand All @@ -90,7 +94,7 @@ SentryFlutter.init((options) {
});
```

The following table lists all the options you can customize to change behavior of the `SentryFeedbackWidget`.
The following table lists all the options you can customize to change behavior of the `SentryFeedbackForm`.

| Option | Type | Default | Description |
| - | - | - | - |
Expand Down
Loading