expo-config-pluginlisted
Install: claude install-skill fatihkan/badi
# expo-config-plugin
A guide to writing Expo Config Plugins. Automatically modifying native files (Info.plist, AndroidManifest.xml, build.gradle, Podfile) during prebuild. Plugin compose discipline, dangerous-mod usage, and the registration/test flow. The prebuild process itself lives in `expo-prebuild`.
## What It Does
- iOS `Info.plist`, `entitlements.plist`, `Podfile`, `xcodeproj` modification
- Android `AndroidManifest.xml`, `build.gradle`, `MainApplication.kt`, `strings.xml` modification
- Plugin mod compose (`withPlugins`)
- File writing with `withDangerousMod` (last resort)
- Plugin tests (snapshot)
- Registration and parameter passing in `app.config.ts`
## Plugin Structure
```ts
// plugins/withMyPlugin.ts
import {
ConfigPlugin,
withInfoPlist,
withAndroidManifest,
withDangerousMod,
} from "expo/config-plugins";
type Props = { apiKey: string };
const withMyPlugin: ConfigPlugin<Props> = (config, { apiKey }) => {
// iOS
config = withInfoPlist(config, (cfg) => {
cfg.modResults.MyApiKey = apiKey;
cfg.modResults.NSCameraUsageDescription = "Camera access required";
return cfg;
});
// Android
config = withAndroidManifest(config, (cfg) => {
const app = cfg.modResults.manifest.application?.[0];
if (app) {
app["meta-data"] = app["meta-data"] || [];
app["meta-data"].push({
$: { "android:name": "com.myapp.API_KEY", "android:value": apiKey },
});
}
return cfg;
});
return config;
};
export default w