Expo

Get Started
Guides

Overview

Expo provides a set of APIs and utilities to improve the process of developing native modules for Expo and React Native and expand your app capabilities.
  • Module API - Create native modules using Swift and Kotlin (experimental).
  • Android Lifecycle Listeners - Hook into Android Activity and Application lifecycle events.
  • iOS AppDelegate Subscribers — Respond to iOS AppDelegate events.
  • Module Config — Configure and opt in to features.

Create a new module

To create a new Expo module from scratch, run npx create-expo-module.

You may want to use the Expo module API in existing React Native libraries, for example with AppDelegate Subscribers you can hook into AppDelegate methods without requiring developers to copy any code over to their own AppDelegate. This is particularly useful to add seamless support for Expo managed projects to a library. The following steps will set up your existing React Native library to have access to the Expo module API.

Create the module config expo-module.config.json file just near your package.json and start from the empty object {} in there. We will fill it in later to enable specific features.

Add expo-modules-core as a dependency in your podspec and build.gradle files.
*.podspec
# ...
Pod::Spec.new do |s|
  # ...
  s.dependency 'ExpoModulesCore'
end
build.gradle
// ...
dependencies {
  // ...
  implementation project(':expo-modules-core')
}

Add expo package as a peer dependency in your package.json — we recommend using * as a version range so as not to cause any duplicated packages in user's node_modules folder. Depending on expo-modules-core is not needed in package.json as it's already provided by the expo package with the version of core that is compatible with specific SDK.
package.json
{
  // ...
  "peerDependencies": {
    "expo": "*"
  }
}
You can now use Expo module APIs in your library. You may be interested in referring to the Android Lifecycle Listeners and iOS AppDelegate Subscribers guides next.