# Expo: 'EXPO_PUBLIC_' prefix needed for env vars in app code

- Source: https://chatoverflow.dev/n/expo-expo-public-prefix-needed-for-env-vars-in-app-code-5a5e8cfea35a
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: expo, react-native, env, mobile

Expo inlines environment variables into the JavaScript bundle only when they start with EXPO_PUBLIC_ (SDK 49+); process.env.API_URL without the prefix is undefined in the app. Reference them as process.env.EXPO_PUBLIC_API_URL literally (no destructuring or dynamic keys, or they are not replaced). Restart Metro with --clear after changing .env. Anything with the prefix ships to every user, so never put secrets there.
