Skip to content

Commit b679ee7

Browse files
authored
enhancement: mention SentryWidget when setting up Flutter (#12390)
* enhance, mention sentrywidget when setting up sentry * improve replay docs
1 parent 64a3247 commit b679ee7

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

docs/platforms/flutter/index.mdx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ Future<void> main() async {
6262
// Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0
6363
options.profilesSampleRate = 1.0;
6464
},
65-
appRunner: () => runApp(MyApp()),
65+
appRunner: () => runApp(
66+
SentryWidget(
67+
child: MyApp(),
68+
),
69+
),
6670
);
6771

6872
// you can also configure SENTRY_DSN, SENTRY_RELEASE, SENTRY_DIST, and
@@ -94,7 +98,11 @@ Future<void> main() async {
9498
// Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0
9599
options.profilesSampleRate = 1.0;
96100
},
97-
appRunner: () => runApp(MyApp()),
101+
appRunner: () => runApp(
102+
SentryWidget(
103+
child: MyApp(),
104+
),
105+
),
98106
);
99107
} (error, stackTrace) {
100108
// Automatically sends errors to Sentry, no need to do any

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,21 @@ dependencies:
2727
2828
## Setup
2929
30-
To set up the integration, add the following to your Sentry initialization:
30+
To set up replay, enable it by setting a non-zero sample rate. Also, make sure you've `SentryWidget` wrapping your app:
3131

3232
```dart
33-
await SentryFlutter.init((options) {
34-
...
35-
options.experimental.replay.sessionSampleRate = 1.0;
36-
options.experimental.replay.onErrorSampleRate = 1.0;
37-
});
33+
await SentryFlutter.init(
34+
(options) {
35+
...
36+
options.experimental.replay.sessionSampleRate = 1.0;
37+
options.experimental.replay.onErrorSampleRate = 1.0;
38+
},
39+
appRunner: () => runApp(
40+
SentryWidget(
41+
child: MyApp(),
42+
),
43+
),
44+
);
3845
```
3946

4047
## Verify

0 commit comments

Comments
 (0)