1.7 KiB
1.7 KiB
Module Configuration Reference
expo-module.config.json
Use expo-module.config.json for autolinking and module registration.
File placement depends on the module type:
- standalone module: place it at the package root, next to
package.json - local module: place it at the module root inside the app's local modules directory (
expo.autolinking.nativeModulesDir, ormodules/by default)
Example:
{
"platforms": ["android", "apple", "web"],
"apple": {
"modules": ["MyModule"],
"appDelegateSubscribers": ["MyAppDelegateSubscriber"]
},
"android": {
"modules": ["expo.modules.mymodule.MyModule"]
}
}
Fields
| Field | Description |
|---|---|
platforms |
Array of supported platforms. Valid values include android, apple, web, and devtools. You can also use granular Apple platforms such as ios, macos, and tvos, but apple is preferred when one Swift module supports multiple Apple targets. |
apple.modules |
Swift module class names |
apple.appDelegateSubscribers |
Swift AppDelegate subscriber class names |
android.modules |
Fully-qualified Kotlin module class names (package + class) |
Autolinking
Expo autolinking automatically discovers and links modules that have expo-module.config.json. No manual native project configuration needed — install via npm, run pod install.
- standalone modules are resolved from dependencies and search paths.
- local modules are resolved from the
modulesdirectory ornativeModulesDirif defined.
Resolution Order
- Explicit dependencies in
react-native.config.js - Custom
searchPathsdirectories - Local
nativeModulesDir(defaults to./modules/) - Recursive npm dependency resolution