EXPO_PUBLIC_ variables

Environment variables whose names start with EXPO_PUBLIC_. Metro reads them from .env files at startup and inlines their values into the bundle wherever process.env.EXPO_PUBLIC_NAME is written out in full. They are visible to anyone with the app, so they hold configuration such as the API URL, never secrets.

Minimal example

ts
const apiUrl = process.env.EXPO_PUBLIC_API_URL;

Learn this concept

Lesson 4.3 · Expo device networking

Used in exercises

Exercise 4.4 · Expo app shell
Prerequisite conceptsMetro
RelatedLAN IP