Skip to content

Commit e8bfe3f

Browse files
vaindlizokm
andauthored
feat: add flutter replay docs (#11611)
* feat: add flutte replay docs * Apply suggestions from code review Co-authored-by: Liza Mock <[email protected]> --------- Co-authored-by: Liza Mock <[email protected]>
1 parent cbd9baa commit e8bfe3f

File tree

5 files changed

+108
-6
lines changed

5 files changed

+108
-6
lines changed

docs/platforms/android/session-replay/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ options.experimental.sessionReplay.maskAllImages = false
115115

116116
## Error Linking
117117

118-
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:
118+
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:
119119

120120
- The replay was rate-limited and couldn't be accepted.
121121
- The replay was deleted by a member of your org.

docs/platforms/apple/guides/ios/session-replay/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ options.experimental.sessionReplay.redactAllImages = false
9292

9393
## Error Linking
9494

95-
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:
95+
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:
9696

9797
- The replay was rate-limited and couldn't be accepted.
9898
- The replay was deleted by a member of your org.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: Set Up Session Replay
3+
sidebar_order: 5500
4+
notSupported:
5+
description: "Learn how to enable the Mobile Session Replay Beta in your app."
6+
---
7+
8+
<Note>
9+
10+
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.
11+
12+
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.
13+
14+
</Note>
15+
16+
[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.
17+
18+
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/).
19+
20+
## Pre-requisites
21+
22+
Make sure your Sentry Flutter SDK version is at least 8.9.0, which is required for Session Replay.
23+
You can update your `pubspec.yaml` to the matching version:
24+
25+
```yaml
26+
dependencies:
27+
sentry_flutter: ^8.9.0
28+
```
29+
30+
## Setup
31+
32+
To set up the integration, add the following to your Sentry initialization:
33+
34+
```dart
35+
await SentryFlutter.init(
36+
(options) {
37+
...
38+
options.experimental.replay.sessionSampleRate = 1.0;
39+
options.experimental.replay.onErrorSampleRate = 1.0;
40+
},
41+
appRunner: () => runApp(MyApp()),
42+
);
43+
```
44+
45+
## Verify
46+
47+
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.
48+
49+
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`.
50+
51+
## Sampling
52+
53+
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:
54+
55+
1. <PlatformIdentifier name="replays-session-sample-rate" /> - The sample rate for
56+
replays that begin recording immediately and last the entirety of a user's session.
57+
2. <PlatformIdentifier name="replays-on-error-sample-rate" /> - The sample rate for
58+
replays that are recorded when an error happens. This type of replay will record
59+
up to a minute of events prior to the error and continue recording until the session
60+
ends.
61+
62+
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.
63+
64+
## Privacy
65+
66+
The SDK is recording and aggressively redacting (masking) all text and images, according to the configuration in `options.experimental.replay`.
67+
You can tune this and add custom masking rules to fit your needs. For example, you can explicitly mask or unmask widgets by type,
68+
or you can even have a callback to decide whether a specific widget instance should be masked:
69+
70+
```dart
71+
options.experimental.replay.mask<IconButton>();
72+
options.experimental.replay.unmask<Image>();
73+
options.experimental.replay.maskCallback<Text>(
74+
(Element element, Text widget) =>
75+
(widget.data?.contains('secret') ?? false)
76+
? SentryMaskingDecision.mask
77+
: SentryMaskingDecision.continueProcessing);
78+
```
79+
80+
You can find more details in the documentation for each method.
81+
82+
<Note>
83+
84+
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).
85+
86+
</Note>
87+
88+
To disable redaction altogether (not to be used on applications with sensitive data):
89+
90+
```dart
91+
options.experimental.replay.maskAllText = false;
92+
options.experimental.replay.maskAllImages = false;
93+
```
94+
95+
## Error Linking
96+
97+
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:
98+
99+
- The replay was rate-limited and couldn't be accepted.
100+
- The replay was deleted by a member of your org.
101+
- There were network errors and the replay wasn't saved.

docs/platforms/react-native/session-replay/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const config = getSentryExpoConfig(__dirname, {
128128

129129
## Error Linking
130130

131-
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:
131+
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:
132132

133133
- The replay was rate-limited and couldn't be accepted.
134134
- The replay was deleted by a member of your org.

docs/product/explore/session-replay/mobile/index.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,14 @@ These breadcrumbs are synced with the replay player and will auto-scroll as the
5656

5757
## SDKs Supported
5858

59-
Session Replay for mobile is currently available for Android, iOS, and React Native SDKs. Support for [Flutter](/platforms/flutter/) is being tracked on this [GitHub issue](https://github.com/getsentry/sentry-dart/issues/1193).
59+
Session Replay for mobile is currently available for Android and iOS on both native SDKs, as well as for React Native and Flutter.
6060

61-
We recommend updating to the latest, but the miminum versions supported are:
61+
We recommend updating to the latest version, but the minimum versions supported are:
6262

6363
- [iOS](/platforms/apple/guides/ios/session-replay/), [8.31.1](https://github.com/getsentry/sentry-cocoa/releases)
6464
- [Android](/platforms/android/session-replay/), [7.12.0](https://github.com/getsentry/sentry-java/releases)
6565
- [React Native](/platforms/react-native/session-replay/), [5.26.0](https://github.com/getsentry/sentry-react-native/releases)
66+
- [Flutter](/platforms/flutter/session-replay/), [8.9.0](https://github.com/getsentry/sentry-dart/releases)
6667

6768
## Frequently Asked Questions
6869

@@ -77,7 +78,7 @@ Additionally, we offer a self-serve deletion capability of individual replays in
7778
For most mobile applications, the performance overhead of our client SDK will be imperceptible to end-users. In our own testing, the overhead was not noticeable by end-users. However, this testing was not exhaustive and you may discover the recording overhead may negatively impact your mobile application performance depending on your application complexity.
7879

7980
To reduce the performance overhead, we only take screenshots when something changes on the screen. Our default frame rate is 1 frame (16ms) per second of the main thread time.
80-
If you experience any performance degradations after installing Session Replay, please open an issue on GitHub for your respective SDK: [Android](https://github.com/getsentry/sentry-java/issues/new/choose), [iOS](https://github.com/getsentry/sentry-cocoa/issues/new/choose) and [React Native](https://github.com/getsentry/sentry-react-native/issues/new/choose).
81+
If you experience any performance degradations after installing Session Replay, please open an issue on GitHub for your respective SDK: [Android](https://github.com/getsentry/sentry-java/issues/new/choose), [iOS](https://github.com/getsentry/sentry-cocoa/issues/new/choose), [React Native](https://github.com/getsentry/sentry-react-native/issues/new/choose), and [Flutter](https://github.com/getsentry/sentry-dart/issues/new/choose).
8182

8283
**How much does it cost to use Session Replay for mobile?**
8384

0 commit comments

Comments
 (0)