Skip to content

Commit fb43e96

Browse files
authored
feat(mobile): Add session-replay toggle for ios, react native and flutter (#14240)
## DESCRIBE YOUR PR Adds the session replay toggle for missing platforms ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs)
1 parent 3cfe838 commit fb43e96

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

docs/platforms/apple/common/index.mdx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori
3636

3737
<PlatformSection notSupported={["apple.tvos", "apple.watchos", "apple.visionos"]}>
3838

39-
<OnboardingOptionButtons options={['error-monitoring', 'performance', 'profiling']}/>
39+
<OnboardingOptionButtons options={['error-monitoring', 'performance', 'profiling', 'session-replay']}/>
4040

4141
</PlatformSection>
4242

@@ -117,6 +117,12 @@ func application(_ application: UIApplication,
117117
$0.sessionSampleRate = 1
118118
}
119119
// ___PRODUCT_OPTION_END___ profiling
120+
121+
// ___PRODUCT_OPTION_START___ session-replay
122+
// Record session replays for 100% of errors and 10% of sessions
123+
options.sessionReplay.onErrorSampleRate = 1.0
124+
options.sessionReplay.sessionSampleRate = 0.1
125+
// ___PRODUCT_OPTION_END___ session-replay
120126
}
121127

122128
return true
@@ -148,6 +154,12 @@ func application(_ application: UIApplication,
148154
profiling.sessionSampleRate = 1.f;
149155
};
150156
// ___PRODUCT_OPTION_END___ profiling
157+
158+
// ___PRODUCT_OPTION_START___ session-replay
159+
// Record session replays for 100% of errors and 10% of sessions
160+
options.sessionReplay.onErrorSampleRate = 1.0;
161+
options.sessionReplay.sessionSampleRate = 0.1;
162+
// ___PRODUCT_OPTION_END___ session-replay
151163
}];
152164

153165
return YES;
@@ -180,6 +192,12 @@ struct SwiftUIApp: App {
180192
$0.sessionSampleRate = 1
181193
}
182194
// ___PRODUCT_OPTION_END___ profiling
195+
196+
// ___PRODUCT_OPTION_START___ session-replay
197+
// Record session replays for 100% of errors and 10% of sessions
198+
options.sessionReplay.onErrorSampleRate = 1.0
199+
options.sessionReplay.sessionSampleRate = 0.1
200+
// ___PRODUCT_OPTION_END___ session-replay
183201
}
184202
}
185203
}

docs/platforms/dart/guides/flutter/index.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori
3232
'error-monitoring',
3333
'performance',
3434
'profiling',
35+
'session-replay',
3536
'logs',
3637
]}
3738
/>
@@ -124,6 +125,11 @@ Future<void> main() async {
124125
// Enable logs to be sent to Sentry
125126
options.enableLogs = true;
126127
// ___PRODUCT_OPTION_END___ logs
128+
// ___PRODUCT_OPTION_START___ session-replay
129+
// Record session replays for 100% of errors and 10% of sessions
130+
options.replay.onErrorSampleRate = 1.0;
131+
options.replay.sessionSampleRate = 0.1;
132+
// ___PRODUCT_OPTION_END___ session-replay
127133
},
128134
appRunner: () => runApp(
129135
SentryWidget(

docs/platforms/react-native/index.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ If you're using Expo, [read our docs](/platforms/react-native/manual-setup/expo/
5959
'error-monitoring',
6060
'performance',
6161
'profiling',
62+
'session-replay',
6263
]}
6364
/>
6465

@@ -84,6 +85,12 @@ Sentry.init({
8485
// Here, we'll capture profiles for 100% of transactions.
8586
profilesSampleRate: 1.0,
8687
// ___PRODUCT_OPTION_END___ profiling
88+
// ___PRODUCT_OPTION_START___ session-replay
89+
// Record session replays for 100% of errors and 10% of sessions
90+
replaysOnErrorSampleRate: 1.0,
91+
replaysSessionSampleRate: 0.1,
92+
integrations: [Sentry.mobileReplayIntegration()],
93+
// ___PRODUCT_OPTION_END___ session-replay
8794
});
8895
```
8996

0 commit comments

Comments
 (0)