From 978d165c78b5ab6062fcaf947e4b34ea459fa269 Mon Sep 17 00:00:00 2001
From: Antonis Lilis <antonis.lilis@sentry.io>
Date: Tue, 21 Apr 2026 14:32:10 +0200
Subject: [PATCH 1/3] feat(react-native): Document includeWebReplay and
 includeFeedback Metro options

Adds a "Reduce Bundle Size" section to the React Native Metro page
describing how to exclude the web Session Replay and User Feedback
packages from the bundle for users who don't need them.

includeFeedback is new in the upcoming Sentry React Native SDK release
(getsentry/sentry-react-native#6025). includeWebReplay has existed for
a while but was previously undocumented.
---
 .../react-native/manual-setup/metro.mdx       | 35 +++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/docs/platforms/react-native/manual-setup/metro.mdx b/docs/platforms/react-native/manual-setup/metro.mdx
index 9e49a5dfcdbc4..bc88e4ef31b91 100644
--- a/docs/platforms/react-native/manual-setup/metro.mdx
+++ b/docs/platforms/react-native/manual-setup/metro.mdx
@@ -72,6 +72,41 @@ const config = getSentryExpoConfig(__dirname, {
 });
 ```
 
+### Reduce Bundle Size
+
+If you're not using the Session Replay or User Feedback features, you can exclude their web-only packages from the bundle by opting out via the Metro Plugin options. When set to `false`, the Sentry Metro Plugin resolves the matching Sentry sub-packages to an empty module so they're not included in the output bundle.
+
+| Option             | Default | Effect when set to `false`                                               |
+| ------------------ | ------- | ------------------------------------------------------------------------ |
+| `includeWebReplay` | `true`  | Excludes `@sentry/replay` and `@sentry-internal/replay` from the bundle. |
+| `includeFeedback`  | `true`  | Excludes `@sentry-internal/feedback` from the bundle.                    |
+
+Note that these options only affect bundling. They do not disable the corresponding native (Android/iOS) integrations.
+
+```javascript {tabTitle:React Native} {filename:metro.config.js}
+const { getDefaultConfig } = require("@react-native/metro-config");
+const { withSentryConfig } = require("@sentry/react-native/metro");
+
+const config = getDefaultConfig(__dirname);
+module.exports = withSentryConfig(config, {
+  includeWebReplay: false,
+  includeFeedback: false,
+});
+```
+
+```javascript {tabTitle:Expo} {filename:metro.config.js}
+const { getSentryExpoConfig } = require("@sentry/react-native/metro");
+
+const config = getSentryExpoConfig(__dirname, {
+  includeWebReplay: false,
+  includeFeedback: false,
+});
+```
+
+<Alert level="info">
+`includeFeedback` requires `@sentry/react-native` version 8.9.0 or newer. <!-- TODO: confirm exact version on release -->
+</Alert>
+
 ### Wrap Your Custom Serializer
 
 If you already have a custom serializer, you can wrap it with the Sentry Metro Serializer and call `options.sentryBundleCallback` before serializing the bundle content.

From 77896fada2bfaf658cb1c278a1a17528d98a527c Mon Sep 17 00:00:00 2001
From: Antonis Lilis <antonis.lilis@gmail.com>
Date: Tue, 21 Apr 2026 14:34:04 +0200
Subject: [PATCH 2/3] Remove alert

---
 docs/platforms/react-native/manual-setup/metro.mdx | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/docs/platforms/react-native/manual-setup/metro.mdx b/docs/platforms/react-native/manual-setup/metro.mdx
index bc88e4ef31b91..660baf0a73dc2 100644
--- a/docs/platforms/react-native/manual-setup/metro.mdx
+++ b/docs/platforms/react-native/manual-setup/metro.mdx
@@ -103,10 +103,6 @@ const config = getSentryExpoConfig(__dirname, {
 });
 ```
 
-<Alert level="info">
-`includeFeedback` requires `@sentry/react-native` version 8.9.0 or newer. <!-- TODO: confirm exact version on release -->
-</Alert>
-
 ### Wrap Your Custom Serializer
 
 If you already have a custom serializer, you can wrap it with the Sentry Metro Serializer and call `options.sentryBundleCallback` before serializing the bundle content.

From 48d2236a0d5e1e2478249c7f0451a207b2e557d6 Mon Sep 17 00:00:00 2001
From: Antonis Lilis <antonis.lilis@sentry.io>
Date: Fri, 24 Apr 2026 11:01:58 +0200
Subject: [PATCH 3/3] refactor: Rename includeFeedback to includeWebFeedback,
 address review

- Rename `includeFeedback` to `includeWebFeedback` (mirrors the SDK
  rename in getsentry/sentry-react-native#6025 after @lucas-zimerman's
  feedback).
- Reword the intro to frame the bundle-size options around "not
  targeting React Native for Web", per @lucas-zimerman's suggestion.
---
 docs/platforms/react-native/manual-setup/metro.mdx | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/docs/platforms/react-native/manual-setup/metro.mdx b/docs/platforms/react-native/manual-setup/metro.mdx
index 660baf0a73dc2..912ccf7ba7b92 100644
--- a/docs/platforms/react-native/manual-setup/metro.mdx
+++ b/docs/platforms/react-native/manual-setup/metro.mdx
@@ -74,12 +74,12 @@ const config = getSentryExpoConfig(__dirname, {
 
 ### Reduce Bundle Size
 
-If you're not using the Session Replay or User Feedback features, you can exclude their web-only packages from the bundle by opting out via the Metro Plugin options. When set to `false`, the Sentry Metro Plugin resolves the matching Sentry sub-packages to an empty module so they're not included in the output bundle.
+If you're not targeting React Native for Web, you can exclude web-only packages like Session Replay and User Feedback from the bundle by opting out via the Metro Plugin options. When set to `false`, the Sentry Metro Plugin resolves the matching Sentry sub-packages to an empty module so they're not included in the output bundle.
 
-| Option             | Default | Effect when set to `false`                                               |
-| ------------------ | ------- | ------------------------------------------------------------------------ |
-| `includeWebReplay` | `true`  | Excludes `@sentry/replay` and `@sentry-internal/replay` from the bundle. |
-| `includeFeedback`  | `true`  | Excludes `@sentry-internal/feedback` from the bundle.                    |
+| Option                | Default | Effect when set to `false`                                               |
+| --------------------- | ------- | ------------------------------------------------------------------------ |
+| `includeWebReplay`    | `true`  | Excludes `@sentry/replay` and `@sentry-internal/replay` from the bundle. |
+| `includeWebFeedback`  | `true`  | Excludes `@sentry-internal/feedback` from the bundle.                    |
 
 Note that these options only affect bundling. They do not disable the corresponding native (Android/iOS) integrations.
 
@@ -90,7 +90,7 @@ const { withSentryConfig } = require("@sentry/react-native/metro");
 const config = getDefaultConfig(__dirname);
 module.exports = withSentryConfig(config, {
   includeWebReplay: false,
-  includeFeedback: false,
+  includeWebFeedback: false,
 });
 ```
 
@@ -99,7 +99,7 @@ const { getSentryExpoConfig } = require("@sentry/react-native/metro");
 
 const config = getSentryExpoConfig(__dirname, {
   includeWebReplay: false,
-  includeFeedback: false,
+  includeWebFeedback: false,
 });
 ```
 
