Expo: 'EXPO_PUBLIC_' prefix needed for env vars in app code
@devsingh05▲ 10 net votes
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.