From 7b656e08d27e0b7db6af726ba03994d628f44662 Mon Sep 17 00:00:00 2001 From: betegon Date: Wed, 27 May 2026 08:51:57 +0200 Subject: [PATCH] docs(react-native): document .env.local for Expo auth token MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The wizard expandable mentioned "env.local" (missing the leading dot, now fixed) but never showed what it should contain. The Expo plugin snippet showed a bare shell export command which doesn't work for EAS builds. Changes: - Expo plugin snippet: replace shell export with .env.local file format and add a note about using EAS secrets for EAS builds - expo.mdx Notes: replace vague "use an environment variable" with explicit .env.local and EAS secret guidance - index.mdx + expo.mdx: fix "env.local" → ".env.local" typo in wizard task expandables --- docs/platforms/react-native/index.mdx | 2 +- docs/platforms/react-native/manual-setup/expo.mdx | 4 ++-- includes/react-native-expo-plugin-code-snippet.mdx | 12 +++++++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/platforms/react-native/index.mdx b/docs/platforms/react-native/index.mdx index 88a21b1c656e5..ccc3e6703b140 100644 --- a/docs/platforms/react-native/index.mdx +++ b/docs/platforms/react-native/index.mdx @@ -46,7 +46,7 @@ npx @sentry/wizard@latest -i reactNative - Wrap the _Bundle React Native code and images_ Xcode project build phase script to upload generated source maps and collect bundled node modules. - Add _Upload Debug Symbols to Sentry_ Xcode project build phase. - Run `pod install`. -- Store build credentials in _*ios/sentry.properties*_, _*android/sentry.properties*_ and _*env.local*_. +- Store build credentials in _*ios/sentry.properties*_, _*android/sentry.properties*_ and _*.env.local*_. - Configure Sentry for the supplied DSN in your _*layout.tsx*_/_*App.tsx*_file. diff --git a/docs/platforms/react-native/manual-setup/expo.mdx b/docs/platforms/react-native/manual-setup/expo.mdx index d7159b016a6b8..07f7e2d9d5e78 100644 --- a/docs/platforms/react-native/manual-setup/expo.mdx +++ b/docs/platforms/react-native/manual-setup/expo.mdx @@ -29,7 +29,7 @@ npx @sentry/wizard@latest -i reactNative - Wrap the _Bundle React Native code and images_ Xcode project build phase script to upload generated source maps and collect bundled node modules. - Add _Upload Debug Symbols to Sentry_ Xcode project build phase. - Run `pod install`. -- Store build credentials in _*ios/sentry.properties*_, _*android/sentry.properties*_ and _*env.local*_. +- Store build credentials in _*ios/sentry.properties*_, _*android/sentry.properties*_ and _*.env.local*_. - Configure Sentry for the supplied DSN in your _*layout.tsx*_ file. @@ -165,6 +165,6 @@ To verify that everything is working as expected, build the `Release` version of ## Notes -- Don't commit your auth token. Instead, use an environment variable like `SENTRY_AUTH_TOKEN`. +- Don't commit your auth token. Store it in `.env.local` as `SENTRY_AUTH_TOKEN` for local builds, and as an [EAS secret](https://docs.expo.dev/eas/environment-variables/) for EAS builds. - Source maps for the `Release` version of your application are uploaded automatically during the native application build. - During development, the source code is resolved using the Metro Server and source maps aren't used. This currently doesn't work on web. diff --git a/includes/react-native-expo-plugin-code-snippet.mdx b/includes/react-native-expo-plugin-code-snippet.mdx index b7d1abe646d9d..8ccc7b5113d5a 100644 --- a/includes/react-native-expo-plugin-code-snippet.mdx +++ b/includes/react-native-expo-plugin-code-snippet.mdx @@ -55,9 +55,15 @@ export default withSentry(config, { -Add auth token to your environment: +Add your auth token to a `.env.local` file in the root of your project: -```bash +```properties {filename:.env.local} # DO NOT COMMIT YOUR AUTH TOKEN -export SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___ +SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___ ``` + + + +Do not commit your auth token. Add `.env.local` to your `.gitignore`. For EAS builds, add `SENTRY_AUTH_TOKEN` as an [EAS secret](https://docs.expo.dev/eas/environment-variables/) instead of using a `.env.local` file. + +