What Are Config Plugins and When to Use Them
Understand how Expo's prebuild pipeline transforms app.json into native iOS and Android projects, and identify when a config plugin is needed to add a third-party native library.
Expo Managed Workflow and Native Files
In the Expo managed workflow, you never manually edit the ios/ or android/ folders. Instead, Expo's prebuild pipeline generates those native projects from app.json and your JavaScript dependencies. This is powerful for keeping native files in sync, but it creates a challenge: how do you customize native settings for third-party libraries that require specific native code changes?
What Is a Config Plugin
A Config Plugin is a JavaScript function that receives the current Expo app configuration object and returns a modified version of it. Expo's prebuild step applies all config plugins in sequence before generating native iOS and Android projects. Config plugins let you add permissions, modify build settings, add native files, and configure manifests — all from JavaScript, without touching native code directly.
// Minimal config plugin shape
const { withInfoPlist } = require('@expo/config-plugins');
module.exports = function withMyPlugin(config) {
// Receive config, return modified config
return withInfoPlist(config, (iosConfig) => {
iosConfig.modResults['NSCameraUsageDescription'] =
'We need camera access to scan QR codes.';
return iosConfig;
});
};All lessons in this course
- What Are Config Plugins and When to Use Them
- Writing Your First Config Plugin
- Modifying AndroidManifest and Info.plist
- Distributing Config Plugins as npm Packages