NativeLaunch
CI & Environments

Expo Environment Variables

We use Expo (EAS) Environment Variables & Secrets when building in EAS Cloud. Variables are injected at build/submit time on Expo’s servers and can be exposed to the app at runtime if they start with EXPO_PUBLIC_.

This page is only relevant if you deploy with EAS Cloud. If you build locally on GitHub runners, use GitHub Environments instead.


Setup

  1. Open your project on expo.devProject → Secrets. Add your keys one by one. expo secrets app environment

  2. If you use two Expo projects (preview/prod), repeat this step in each project so the names stay identical.

Keeping identical names across environments simplifies CI and code. Only values differ between projects.

Inside each environment click Add secret and create the same keys in both preview and production:

EXPO_PUBLIC_SUPABASE_PROJECT_URL=
EXPO_PUBLIC_SUPABASE_ANON_KEY=
EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID=
EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID=
EXPO_PUBLIC_GOOGLE_IOS_URL_SCHEME=
EXPO_PUBLIC_REVENUECAT_API_KEY_IOS=
EXPO_PUBLIC_REVENUECAT_API_KEY_ANDROID=
EXPO_PUBLIC_SENTRY_DSN=
EXPO_PUBLIC_ONESIGNAL_APP_ID=

app environment


Takeaway

  • ✅ Store variables in Expo project Secrets when building in EAS Cloud.
  • ✅ Use EXPO_PUBLIC_* only for values that can be bundled into the app.
  • ✅ Use build profiles (preview, production) and optional env overrides in eas.json.
  • ✅ For strict isolation, use two Expo projects (preview/prod) with identical variable names.
  • ❌ Do not commit .env.* with real values to the repo.

Resources