From e7a5f28abf0d0c367fd6bcc0b07b9fafd6f7ab78 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Mon, 16 Mar 2026 09:24:45 +0100 Subject: [PATCH 1/2] feat(react-native): Support SENTRY_ENVIRONMENT in bare React Native builds --- .../manual-setup/app-start-error-capture.mdx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/platforms/react-native/manual-setup/app-start-error-capture.mdx b/docs/platforms/react-native/manual-setup/app-start-error-capture.mdx index 5d134de7f5fb71..2821ae30b0dad6 100644 --- a/docs/platforms/react-native/manual-setup/app-start-error-capture.mdx +++ b/docs/platforms/react-native/manual-setup/app-start-error-capture.mdx @@ -40,6 +40,16 @@ Options from `sentry.options.json` are merged with options from `Sentry.init()` +### Setting the Environment + +If you need different `environment` values per build (e.g., production vs staging), set the `SENTRY_ENVIRONMENT` environment variable at build time. The SDK build scripts will override the `environment` in your `sentry.options.json` without modifying the source file. + +```bash +SENTRY_ENVIRONMENT=staging npx react-native run-android +``` + +This works in any CI/CD system by setting the environment variable in your build configuration. + ## Android Setup Initialize Sentry in your `MainApplication` class: From b6ff791e8bc22ef7f388183998922abad00092a7 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Fri, 20 Mar 2026 09:39:05 +0100 Subject: [PATCH 2/2] Update text for consistency Co-authored-by: Alex Krawiec --- .../react-native/manual-setup/app-start-error-capture.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/react-native/manual-setup/app-start-error-capture.mdx b/docs/platforms/react-native/manual-setup/app-start-error-capture.mdx index 2821ae30b0dad6..06b94749e20a65 100644 --- a/docs/platforms/react-native/manual-setup/app-start-error-capture.mdx +++ b/docs/platforms/react-native/manual-setup/app-start-error-capture.mdx @@ -42,7 +42,7 @@ Options from `sentry.options.json` are merged with options from `Sentry.init()` ### Setting the Environment -If you need different `environment` values per build (e.g., production vs staging), set the `SENTRY_ENVIRONMENT` environment variable at build time. The SDK build scripts will override the `environment` in your `sentry.options.json` without modifying the source file. +If you need different `environment` values for build (e.g., production vs staging), set the `SENTRY_ENVIRONMENT` environment variable at build time. The SDK build scripts will use this to override the `environment` in your `sentry.options.json` without modifying the source file. ```bash SENTRY_ENVIRONMENT=staging npx react-native run-android