Listoca
Deployment

The app on EAS

The variables each EAS environment needs before a preview or store build, which of them need a new build, and the commands to set them.

The native app is built on EAS, one stage at a time: development, preview and production. Each stage has the same name three times in apps/native/eas.json: the build profile, the EAS environment whose variables go into the build, and the update channel its builds listen on. The commands are on the Native app page.

Where a build's values come from

Only from the stage's EAS environment. apps/native/.env is git-ignored, so EAS doesn't upload it. A variable the environment doesn't set falls back to its default in apps/native/.env.schema, and those defaults are the local stack's.

Left to those defaults, a preview or production build would talk to 127.0.0.1. So both stages check their environment first: EXPO_PUBLIC_SUPABASE_URL and EXPO_PUBLIC_POWERSYNC_URL must be https URLs, and EXPO_PUBLIC_SUPABASE_KEY must be set.

  • bun run eas:build:preview, eas:build:production and the two update commands run the check on your machine before they start (eas env:exec with the stage's variables, your local .env ignored), and stop with the missing names.
  • A build started with eas build directly stops on EAS's server, while it reads apps/native/app.config.ts (releaseEnvProblems), before anything is compiled.

An eas update run by hand isn't checked: use bun run eas:update:<stage>.

The variables

VariableValueRead
EXPO_PUBLIC_SUPABASE_URLhttps://api.example.combundle
EXPO_PUBLIC_SUPABASE_KEYthe publishable key (SUPABASE_PUBLISHABLE_KEY on the server)bundle
EXPO_PUBLIC_POWERSYNC_URLhttps://sync.example.combundle
EXPO_PUBLIC_SITE_URLhttps://www.example.com; only an https URL turns on Universal and App Linksbuild
EXPO_PUBLIC_GOOGLE_WEB_CLIENT_IDthe web OAuth client id, the one Supabase Auth has; empty = no Google buttonbundle
EXPO_PUBLIC_GOOGLE_IOS_CLIENT_IDthe iOS OAuth client idbuild
EXPO_PUBLIC_REVENUECAT_IOS_KEYRevenueCat's public App Store SDK key; empty = purchases off on iOSbundle
EXPO_PUBLIC_REVENUECAT_ANDROID_KEYRevenueCat's public Play Store SDK key; empty = purchases off on Androidbundle
EXPO_PUBLIC_SENTRY_DSNthe listoca-native project's DSN; empty = no crash reportsbundle
EXPO_PUBLIC_ANALYTICS_PROVIDERumami, custom or emptybundle
EXPO_PUBLIC_UMAMI_WEBSITE_IDwith Umami: the site's idbundle
EXPO_PUBLIC_UMAMI_SCRIPT_URLwith a self-hosted Umami: the web app's script URLbundle
EXPO_PUBLIC_ANALYTICS_CUSTOM_URLwith custom: where the events gobundle
SENTRY_AUTH_TOKENuploads the build's source maps; see Sentrybuild

Leave these out:

  • EXPO_PUBLIC_REVENUECAT_TEST_KEY: the Test Store key is for development builds only, and RevenueCat stops a release build that carries it.
  • EXPO_PUBLIC_SENTRY_ENVIRONMENT: without it, Sentry names the environment after the build's update channel.
  • NODE_ENV: Expo sets it.

The comments in apps/native/.env.schema describe each variable in more detail.

Build or bundle

  • build: apps/native/app.config.ts or the Sentry plugin reads the value while EAS builds the native app. EXPO_PUBLIC_SITE_URL decides the associated domains, EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID the URL scheme of Google's sign-in. A change needs a new build through the store, and a raised version in apps/native/app.json (see Updates without a store release on the Native app page).
  • bundle: the value goes into the JavaScript. An update carries a change: eas:update:preview and eas:update:production build the bundle with the stage's environment.

Per stage

  • production: the values of your production server (Coolify or the plain Docker setup), the store keys, Sentry, analytics.
  • preview: builds for testers, so the values of a staging server if you run one, else the production ones. Testers then work on real data.
  • development: a development build loads its JavaScript from Metro on your machine, and Metro reads your local apps/native/.env. The EAS environment only needs the build values: EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID, and EXPO_PUBLIC_SITE_URL if you test links on a phone.

Setting them

On expo.dev (the project → Environment variables), or with the EAS CLI from apps/native. The EXPO_PUBLIC_ values end up in the app, where anyone can read them, so they are plaintext:

eas env:create --environment production --name EXPO_PUBLIC_SUPABASE_URL --value https://api.example.com --visibility plaintext
eas env:create --environment production --name EXPO_PUBLIC_POWERSYNC_URL --value https://sync.example.com --visibility plaintext

Add --force to change a value that exists. To check a stage:

eas env:list --environment production

eas env:pull --environment production writes the stage's values to apps/native/.env.local, which your local Metro then uses too. Delete the file afterwards, or development builds talk to the production server.

Sentry

The Sentry plugin in apps/native/app.json (org birkmdev, project listoca-native) uploads source maps at the end of every release build. Give it a token, as a secret:

eas env:create --environment production --name SENTRY_AUTH_TOKEN --value <token> --visibility secret

Without Sentry, set SENTRY_DISABLE_AUTO_UPLOAD to true instead, or the upload fails the build. The source maps of an update are uploaded by hand (Monitoring).

Then build

From the repo root:

bun run eas:build:production

EAS counts the build number up (appVersionSource: remote). The store credentials (signing, the APNs key and FCM for push) live on EAS too: eas credentials, or the prompts of the first build. LAUNCH.md lists what the stores need before the first submission.

  • Native app: the build and update commands, the update rules.
  • Monitoring: Sentry for the app and the web.
  • Payments: the RevenueCat keys and the paywall.

On this page