Every Expo project has one file that describes the app itself: its name, its version, its icon and its store identifiers. Expo reads it to decide how the project loads in Expo Go, what Expo Prebuild generates, and what goes into the manifest for over-the-air updates. When a name, an icon or an identifier doesn't show up the way you expect, this file and the command that prints Expo's view of it are where you look first.

Key terms

  • app config: the file at the project root (usually app.json, app.config.js or app.config.ts) that holds the app's Expo configuration.
  • slug: a URL-friendly name for the project that is unique across your Expo account.
  • npx expo config: the Expo CLI command that prints the final configuration Expo CLI uses after it has resolved the app config.

One file next to package.json

The app config must sit at the root of the project, next to package.json. It is either JSON, usually app.json, or code, usually app.config.js or app.config.ts. The default template creates app.json, and this lesson sticks to it. The code forms produce the config by running a script. The next lesson covers them, along with the full list of file names Expo looks for and which one wins, including app.config.json, which takes precedence over app.json.

If you work in VS Code, the Expo Tools extension adds auto-completion for the properties in app.json, which saves a trip to the reference for every key name.

The template's "expo" wrapper

The template's app.json has a single top-level key, expo, and every setting lives inside it. When the config has a top-level expo object, Expo uses that object as the config and ignores every other top-level key. A property written next to expo instead of inside it does nothing, and Expo CLI tells you so. A stray version key at the root produces this warning:

Warning: Root-level "expo" object found. Ignoring extra key in Expo config: "version"

The wrapper is optional in every form. An app.json with name and slug at the root and no expo key works too. In app.config.js or app.config.ts the properties usually go at the top level of the exported object, and Expo unwraps an expo key there as well, so the rule above applies to static and dynamic configs alike.

Properties a typical app sets

The Trailmix example below is the app.json of a hiking app. Each of its keys controls one thing:

  • name: a required string, the app name shown on the home screen and inside Expo Go.
  • slug: also required, the URL-friendly project name.
  • version: the version string. On iOS it becomes CFBundleShortVersionString, on Android versionName.
  • orientation: default, portrait or landscape. Without it the app isn't locked to either.
  • icon: a local path or a remote URL to the icon image. A 1024x1024 PNG is recommended.
  • userInterfaceStyle: light, dark or automatic. It defaults to light, and on Android it needs expo-system-ui installed to work.
  • scheme: the URL scheme that opens the app. It is a build-time setting with no effect in Expo Go.
  • ios.bundleIdentifier and android.package: identifiers you make up, which must be unique on the App Store and the Play Store.
  • plugins: the list of config plugins. The template lists expo-router and expo-splash-screen there.

The template also turns on two flags under experiments: typedRoutes and reactCompiler.

Asking Expo what it resolved

Your file and the config Expo works with are not the same thing. npx expo config displays the final configuration Expo CLI uses after resolution, so it is the way to check a change instead of trusting the file.

Run it in the Trailmix project and the output holds everything you wrote plus values Expo adds itself, such as sdkVersion, platforms and an _internal object. Config plugins can add keys as well: expo-router, which Trailmix lists under plugins, adds extra.router. Expo also fills gaps. Without a name, it takes the name from package.json, or the project folder name. Without a slug, it slugifies the lowercased name. Without a version, it uses the one in package.json, or 1.0.0 when that has none. These defaults only apply to keys your config leaves out.

The command takes a few flags, shown in the second example:

  • --json writes the config to stdout as JSON instead of the readable default.
  • --full prints all the project config data instead of only the app config object.
  • -t or --type picks which type of config to show: public, prebuild or introspect. The public type matters once the app reads its own config, later in this section.

When a change to app.json doesn't seem to take effect, npx expo config tells you whether Expo saw it. If the value is missing there, check that it sits inside expo and that the key name is spelled as in the reference.

Code Examples

json
{
  "expo": {
    "name": "Trailmix",
    "slug": "trailmix",
    "version": "1.2.0",
    "orientation": "portrait",
    "icon": "./assets/images/icon.png",
    "scheme": "trailmix",
    "userInterfaceStyle": "automatic",
    "ios": {
      "bundleIdentifier": "com.example.trailmix"
    },
    "android": {
      "package": "com.example.trailmix"
    },
    "plugins": ["expo-router"]
  }
}
bash
# Print the config Expo CLI resolved
npx expo config

# The same config as JSON on stdout
npx expo config --json

# All project config data, not only the app config object
npx expo config --full
✓ Completed