Skip to main content
This is the complete API reference for @expo/config-plugins. All exports are available from the main package:

Core Types

ConfigPlugin

Plugin.types.ts
The main plugin type. A function that receives an ExpoConfig and optional props, then returns a modified ExpoConfig. Example:

StaticPlugin

Plugin.types.ts
A plugin with props, as used in app.json. The first element is the plugin (string or function), the second is props. Example:
app.json

Mod

Plugin.types.ts
A mod is a function that modifies a specific native file. It receives the config with modResults (the file contents). Example:

ModConfig

Plugin.types.ts
Defines all available mods for iOS and Android platforms.

ExportedConfigWithProps

Plugin.types.ts
The config object passed to mod functions, including:
  • modResults: The parsed file contents
  • modRequest: Metadata about the current mod
  • modRawConfig: The original, unmodified config

Plugin Composition

withPlugins

withPlugins.ts
Apply multiple plugins to a config in sequence. Example:

withRunOnce

withRunOnce.ts
Ensure a plugin only runs once, even if applied multiple times. Example:

createRunOncePlugin

withRunOnce.ts
Helper to wrap a plugin with run-once logic. Example:

iOS Plugins

withInfoPlist

ios-plugins.ts
Modify the iOS Info.plist file. Example:

withEntitlementsPlist

ios-plugins.ts
Modify the iOS entitlements file. Example:

withXcodeProject

ios-plugins.ts
Modify the Xcode project (.xcodeproj). Example:

withAppDelegate

ios-plugins.ts
Modify the iOS AppDelegate.m file (dangerous - string manipulation). Example:

withPodfile

ios-plugins.ts
Modify the Podfile.

withPodfileProperties

ios-plugins.ts
Modify the Podfile.properties.json (key-value pairs). Example:

withExpoPlist

ios-plugins.ts
Modify the Expo.plist (Expo Updates configuration).

createInfoPlistPlugin

ios-plugins.ts
Helper to create Info.plist plugins. Example:

createEntitlementsPlugin

ios-plugins.ts
Helper to create entitlements plugins. Example:
Entitlements.ts

Android Plugins

withAndroidManifest

android-plugins.ts
Modify the AndroidManifest.xml. Example:

withStringsXml

android-plugins.ts
Modify android/app/src/main/res/values/strings.xml. Example:

withAndroidColors

android-plugins.ts
Modify android/app/src/main/res/values/colors.xml.

withAndroidColorsNight

android-plugins.ts
Modify android/app/src/main/res/values-night/colors.xml.

withAndroidStyles

android-plugins.ts
Modify android/app/src/main/res/values/styles.xml.

withMainActivity

android-plugins.ts
Modify the MainActivity.java file (dangerous - string manipulation).

withMainApplication

android-plugins.ts
Modify the MainApplication.java file (dangerous - string manipulation).

withAppBuildGradle

android-plugins.ts
Modify android/app/build.gradle. Example:

withProjectBuildGradle

android-plugins.ts
Modify android/build.gradle.

withSettingsGradle

android-plugins.ts
Modify android/settings.gradle.

withGradleProperties

android-plugins.ts
Modify android/gradle.properties as key-value pairs. Example:

createAndroidManifestPlugin

android-plugins.ts
Helper to create Android manifest plugins.

createStringsXmlPlugin

android-plugins.ts
Helper to create strings.xml plugins.

Advanced Mods

withMod

withMod.ts
Low-level function to add a mod to a specific platform and mod name. Example:

withDangerousMod

withDangerousMod.ts
Run code before any files are read. Useful for filesystem operations. Example:

withBaseMod

withMod.ts
Low-level function to create a base mod with provider capabilities.

Mod Compilation

compileModsAsync

mod-compiler.ts
Compile and execute all mods. This is called internally by Expo CLI.

evalModsAsync

mod-compiler.ts
Evaluate mods without adding base mods. Use for testing.

Helper Utilities

WarningAggregator

CodeGenerator

generateCode.ts
Generates code with headers like:

PluginError

errors.ts

Platform-Specific Configs

AndroidConfig

IOSConfig

Next steps