expo-app-config
Skill8 starsChanged 3 months agoMITView on GitHub
Choosing between app.json vs app.config.ts vs app.config.js, environment variables, variants, extra fields, plugin chain, and slug/scheme/bundle/version discipline. Triggers on app.json, app.config.ts, app.config.js, expo config, environment variable, .env, eas secret, variant, extra field, slug, scheme, bundle identifier, package name, version, build number, version code.
- Reads credentials
In this repository63 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- ai-automationSkill
- consultingSkill
- contentSkill
- customer-successSkill
- data-analyticsSkill
- designSkill
- design-tokensSkill
- developmentSkill
- devopsSkill
- ecommerceSkill
- emailSkill
- expo-config-pluginSkill
- expo-dev-clientSkill
- expo-eas-buildSkill
- expo-eas-submitSkill
- expo-eas-updateSkill
- expo-modulesSkill
- expo-notificationsSkill
- expo-orchestratorSkill
- expo-prebuildSkill
- expo-routerSkill
- expo-troubleshootingSkill
- financeSkill
- frontend-tasteSkill
- marketingSkill
- market-researchSkill
- mobileSkill
- pentest-adSkill
- pentest-apiSkill
- pentest-bizlogicSkill
- pentest-bugbountySkill
- pentest-cicdSkill
- pentest-cloudSkill
- pentest-credentialsSkill
- pentest-ctfSkill
- pentest-detectionSkill
- pentest-engagementSkill
- pentest-exploit-chainSkill
- pentest-forensicsSkill
- pentest-llmSkill
- pentest-malwareSkill
- pentest-mobileSkill
- pentest-opsec-evidenceSkill
- pentest-orchestratorSkill
- pentest-privescSkill
- pentest-reconSkill
- pentest-reportSkill
- pentest-socialSkill
- pentest-stigSkill
- pentest-threat-modelSkill
- pentest-webSkill
- pentest-wirelessSkill
- productivitySkill
- productSkill
- salesSkill
- security-checkSkill
- securitySkill
- seo-crawl-budgetSkill
- seoSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 229
extra.eas.projectId: NEVER delete by hand - Very specific: line 239
After a .env change the Metro cache → needs --clear
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
expo-app-config
Choosing among app.json, app.config.ts, app.config.js, plus environment variables, variants (dev/staging/prod), and identifier discipline. The plugin chain lives in expo-config-plugin.
What It Does
app.jsonvsapp.config.tsvsapp.config.jsdecision- Environment variables (
.env,EXPO_PUBLIC_*, EAS Secrets) - Multi-variant (dev/staging/production) configuration
extrafield discipline and runtime access- Slug, scheme, bundleIdentifier, package, version, buildNumber management
- Plugin chain order
Which Format?
| Format | Advantage | Limit | When? |
app.json | Static, simple | No JS, no env | Single variant, simple |
app.config.js | Dynamic, env | No TypeScript | Older choice |
app.config.ts | Dynamic + typed | Compile step | Recommended |
Use
app.config.tsin most projects. Keepapp.jsonas a static fallback or drop it entirely.
app.config.ts Template
import { ExpoConfig, ConfigContext } from "expo/config";
export default ({ config }: ConfigContext): ExpoConfig => {
const variant = process.env.APP_VARIANT ?? "development";
const isProduction = variant === "production";
return {
...config,
name: variantName(variant),
slug: "myapp",
scheme: "myapp",
version: "1.2.0",
orientation: "portrait",
icon: `./assets/icon-${variant}.png`,
userInterfaceStyle: "automatic",
splash: {
image: "./assets/splash.png",
resizeMode: "contain",
backgroundColor: "#ffffff",
},
ios: {
bundleIdentifier: bundleId(variant),
buildNumber: "1",
supportsTablet: true,
infoPlist: {
NSCameraUsageDescription: "Camera access required",
},
},
android: {
package: bundleId(variant),
versionCode: 1,
adaptiveIcon: {
foregroundImage: `./assets/icon-fg-${variant}.png`,
backgroundColor: "#ffffff",
},
},
plugins: [
"expo-router",
"expo-dev-client",
["expo-notifications", { icon: "./assets/notif-icon.png" }],
],
extra: {
apiUrl: process.env.EXPO_PUBLIC_API_URL,
sentryDsn: process.env.SENTRY_DSN,
eas: { projectId: "your-eas-project-id" },
variant,
},
runtimeVersion: { policy: "fingerprint" },
updates: {
url: "https://u.expo.dev/your-project-id",
},
};
};
function variantName(v: string): string {
switch (v) {
case "production": return "MyApp";
case "staging": return "MyApp (Staging)";
default: return "MyApp (Dev)";
}
}
function bundleId(v: string): string {
const base = "com.example.myapp";
if (v === "production") return base;
return `${base}.${v}`;
}Running a Variant
APP_VARIANT=development npx expo start
APP_VARIANT=staging eas build --profile preview
APP_VARIANT=production eas build --profile productioneas.json:
{
"build": {
"development": { "env": { "APP_VARIANT": "development" } },
"preview": { "env": { "APP_VARIANT": "staging" } },
"production": { "env": { "APP_VARIANT": "production" } }
}
}Environment Variables
| Type | Access | Build-time | Runtime |
EXPO_PUBLIC_* (.env) | JS: process.env.EXPO_PUBLIC_X | Yes | Yes (embedded) |
process.env.X (app.config.ts) | Only in config | Yes | No |
| EAS Secret | During EAS build | Yes | No (not embedded) |
extra field | Constants.expoConfig.extra.X | Yes | Yes |
CRITICAL: NEVER prefix API keys with
EXPO_PUBLIC_*— they get embedded in the client and everyone can read them. Real secrets stay on the backend.
.env Files
# .env (default)
EXPO_PUBLIC_API_URL=https://api.dev.example.com
# .env.production
EXPO_PUBLIC_API_URL=https://api.example.com.gitignore:
.env.local
.env.*.localIs
.envcommitted?EXPO_PUBLIC_*is already public, so it's fine. Secret values live in.env.localand are never committed.
extra Field Runtime Access
import Constants from "expo-constants";
const apiUrl = Constants.expoConfig?.extra?.apiUrl;
const variant = Constants.expoConfig?.extra?.variant;Typed wrapper:
// src/config.ts
import Constants from "expo-constants";
type AppExtra = {
apiUrl: string;
sentryDsn: string;
variant: "development" | "staging" | "production";
};
export const appConfig = Constants.expoConfig?.extra as AppExtra;Identifier Discipline
| Field | Format | If it changes |
slug | kebab-case | EAS project ID changes |
scheme | kebab-case or a single word | Deep link breaks |
ios.bundleIdentifier | com.org.app | New app, certificate invalid |
android.package | com.org.app | New app, keystore invalid |
version | 1.2.3 (SemVer) | New release |
ios.buildNumber | string | Increment on every build |
android.versionCode | integer | Increment on every build |
If
bundleIdentifierandpackagechange, the app becomes a new app. Existing installs are lost.
Bundle ID Strategy for Variants
com.example.myapp # production
com.example.myapp.staging # staging
com.example.myapp.dev # developmentAdvantage: 3 separate apps side by side on the same device. Does not put the production device at risk.
Plugin Chain
plugins: [
"expo-router", // Routing first
"expo-dev-client", // Dev tools
["expo-build-properties", { // Native build properties
ios: { deploymentTarget: "15.1" },
android: { compileSdkVersion: 34 }
}],
["expo-notifications", { icon: "..." }], // Native modules
"./plugins/withCustomConfig", // Custom plugins
]Order: routing → dev tools → build props → native modules → custom.
Best Practices
- Choose
app.config.ts— typed + dynamic - Variant bundle-ID discipline for 3 parallel apps
- EAS Secrets for real secrets (never
.envorEXPO_PUBLIC_) expo-build-propertiesplugin for native version controlruntimeVersion: fingerprintfor OTA disciplineextra.eas.projectIdNEVER delete by hand- SemVer: major (breaking), minor (feature), patch (fix)
Common Failure Patterns
- Both
app.json+app.config.tspresent →app.config.tswins, causes confusion EXPO_PUBLIC_API_SECRET→ secret leaks to the clientextra.eas.projectIddeleted → EAS tries to create a new projectbundleIdentifierchanged → you must renew the certificate/keystoreversionCodenot incremented → Play Store rejects- After a
.envchange the Metro cache → needs--clear extrafield untyped →undefinedblow-up at runtime
Hard Refusal
- Impersonating (hijacking) another app's bundle ID
- Embedding an API secret with the
EXPO_PUBLIC_prefix - Putting credit card data/PII inside the
extrafield - Connecting production data to the staging app without variant-ID discipline
Output Format
- Format choice (
app.config.tsrationale) - Variant and bundle-ID strategy
.envvs EAS Secret separation- Plugin chain order
- Identifier-discipline summary
- Next step:
expo-config-pluginorexpo-eas-build
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

