From fc18b8ea3a702b13909e49544a94ae66a7a771ab Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Sun, 19 Jan 2025 09:31:46 +0100 Subject: [PATCH 1/2] enhance, mention sentrywidget when setting up sentry --- docs/platforms/flutter/index.mdx | 12 ++++++++++-- docs/platforms/flutter/session-replay/index.mdx | 17 ++++++++++++----- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/docs/platforms/flutter/index.mdx b/docs/platforms/flutter/index.mdx index c28e909175f6c..b85029d40cf7f 100644 --- a/docs/platforms/flutter/index.mdx +++ b/docs/platforms/flutter/index.mdx @@ -62,7 +62,11 @@ Future main() async { // Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0 options.profilesSampleRate = 1.0; }, - appRunner: () => runApp(MyApp()), + appRunner: () => runApp( + SentryWidget( + child: MyApp(), + ), + ), ); // you can also configure SENTRY_DSN, SENTRY_RELEASE, SENTRY_DIST, and @@ -94,7 +98,11 @@ Future main() async { // Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0 options.profilesSampleRate = 1.0; }, - appRunner: () => runApp(MyApp()), + appRunner: () => runApp( + SentryWidget( + child: MyApp(), + ), + ), ); } (error, stackTrace) { // Automatically sends errors to Sentry, no need to do any diff --git a/docs/platforms/flutter/session-replay/index.mdx b/docs/platforms/flutter/session-replay/index.mdx index a7cbae4f80449..4f0eab9246885 100644 --- a/docs/platforms/flutter/session-replay/index.mdx +++ b/docs/platforms/flutter/session-replay/index.mdx @@ -30,11 +30,18 @@ dependencies: 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; -}); +await SentryFlutter.init( + (options) { + ... + options.experimental.replay.sessionSampleRate = 1.0; + options.experimental.replay.onErrorSampleRate = 1.0; + }, + appRunner: () => runApp( + SentryWidget( + child: MyApp(), + ), + ), +); ``` ## Verify From ddeb664b9aa55db794816221ee9daf8198ec5da9 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Sun, 19 Jan 2025 10:07:55 +0100 Subject: [PATCH 2/2] improve replay docs --- docs/platforms/flutter/session-replay/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/flutter/session-replay/index.mdx b/docs/platforms/flutter/session-replay/index.mdx index 4f0eab9246885..e5c1fbef33f86 100644 --- a/docs/platforms/flutter/session-replay/index.mdx +++ b/docs/platforms/flutter/session-replay/index.mdx @@ -27,7 +27,7 @@ dependencies: ## Setup -To set up the integration, add the following to your Sentry initialization: +To set up replay, enable it by setting a non-zero sample rate. Also, make sure you've `SentryWidget` wrapping your app: ```dart await SentryFlutter.init(