Config Plugin
The config plugin integrates with expo prebuild and EAS Build so that flags are set at native build time.
What it does
Section titled “What it does”When a native build runs, the config plugin will:
- Read
EXPO_BUILD_FLAGSfrom the environment (comma-separated flag names) - Generate the runtime
buildFlags.tsmodule with those flags enabled - Add an
EXBuildFlagsarray toInfo.plist(iOS) - Add a
<meta-data android:name="EXBuildFlags">tag toAndroidManifest.xml(Android)
The native metadata is informational — it lets you inspect which flags a given binary was built with. A convenience API for reading these values from native code is a planned goal.
-
Add the plugin to
app.jsonapp.json {"expo": {"plugins": ["expo-build-flags"]}} -
Set flags in your EAS build profile
eas.json {"build": {"staging": {"env": {"EXPO_BUILD_FLAGS": "newCheckout,betaDashboard"}}}} -
Build
Terminal window eas build --profile stagingThe generated
buildFlags.tswill havenewCheckoutandbetaDashboardset totrue.
Skipping the CLI in EAS
Section titled “Skipping the CLI in EAS”If you run build-flags override in a postinstall script (as recommended in the Quick Start), you’ll want to skip it during EAS builds since the config plugin already handles generation. Use --skip-if-env:
{ "scripts": { "postinstall": "build-flags override --skip-if-env EAS_BUILD" }}When EAS_BUILD is set (which EAS does automatically), the override command is a no-op. You can reference any CI var name here (not value).