---
modificationDate: July 27, 2026
title: 'Expo Modules API: Get started'
description: Learn about getting started with Expo modules API.
---

<AgentInstructions>

## Submitting Feedback

If you encounter errors, misleading or outdated information, report it so Expo can be improved:

Preferred command:
npx --yes submit-expo-feedback@latest --category docs --subject "/modules/get-started/" "<actionable feedback>"

Direct HTTP fallback:
curl -X POST https://api.expo.dev/v2/feedback/docs-send -H 'Content-Type: application/json' -d '{"url":"/modules/get-started/","feedback":"🤖 Agent feedback for docs: <specific, actionable description> (<model>, <harness>)"}'

Only submit when you have something specific and actionable to report. Try to give the most context.

## Navigation

When answering a related or follow-up question, fetch the relevant page below as Markdown (.md) instead of guessing; use llms.txt for the full map.

You are here: Guides > Expo Modules API
Pages in this section:
- [Overview](https://docs.expo.dev/modules/overview.md)
- [Get started](https://docs.expo.dev/modules/get-started.md) (this page)
Full documentation tree: [llms.txt](https://docs.expo.dev/llms.txt)

</AgentInstructions>

This documentation is available as Markdown for AI agents and LLMs. See the [full Markdown index](/llms.txt) or append .md to any documentation URL.

# Expo Modules API: Get started

Learn about getting started with Expo modules API.

**There are two ways to get started with the Expo Modules API:** you can either initialize a new module from scratch or add the Expo Modules API to an existing module. This guide will walk you through creating a new module from scratch, and the [Integrating in an existing library](/modules/existing-library.md) covers the latter. For a full list of available options, see the [`create-expo-module` reference](/more/create-expo-module.md).

The two recommended flows to create a new module with Expo Modules API:

-   [Add a new module to an existing Expo application](/modules/get-started.md#add-a-new-module-to-an-existing-application), and use it to test and develop your module.
    
-   [Create a new module in isolation with a generated example project](/modules/get-started.md#create-a-new-module-with-an-example-project) if you want to reuse it in multiple projects or publish it to npm.
    

Both of these flows are covered in the next sections.

## Add a new module to an existing application

### Create the local Expo module

Navigate to your project directory (the one that contains the **package.json** file) and run the following command. This is the recommended way to create a local Expo module.

```sh
# npm
npx create-expo-module@latest --local

# yarn
yarn create expo-module --local

# pnpm
pnpm create expo-module --local

# bun
bun create expo-module --local
```

You can provide a meaningful module name in the CLI prompt. For the rest of the prompts, you can also accept the default suggestions.

Once you've run the command, you will see a new directory created in your project called **modules**. The directory structure should look like this:

`modules`

 `my-module`

  `android`

  `ios`

  `src`

  `expo-module.config.json`

  `index.ts`

Then, if your project doesn't have native projects generated (**android** and **ios** directories), run the following command, otherwise skip this command:

```sh
# npm
npx expo prebuild --clean

# yarn
yarn expo prebuild --clean

# pnpm
pnpm expo prebuild --clean

# bun
bun expo prebuild --clean
```

> **Note**: If you have a pre-existing **ios** directory in your project's root which was created using `npx expo prebuild`, you must reinstall the pods:
> 
>   
> 
> ```sh
> npx pod-install
> ```

### Use the local module

Import the local module in your application, for example in **App.js** or **App.tsx** or **src/app/index.tsx**:

```tsx
...
import MyModule from '@/modules/my-module';

export default function HomeScreen() {
  return (
    <View style={styles.container}>
      <Text>{MyModule.hello()}</Text>
    </View>
  );
}
```

Start the development server in your terminal so that when you edit the native module and build the app in the next step, the changes will be reflected in the app:

```sh
# npm
npx expo start

# yarn
yarn expo start

# pnpm
pnpm expo start

# bun
bun expo start
```

Congratulations! You have created a local Expo module. You can now start working on it.

> **Tip**: You can also use absolute import paths [by applying these configuration changes](https://expo.fyi/absolute-path-expo-modules.md).

### Edit the module

To develop and test your module locally, let's use Android Studio and Xcode for Android and iOS.

#### Android

1.  Open the **android** directory (that is generated by `npx expo prebuild` in step 1) from your project in Android Studio. It may take a while for Gradle to finish syncing the native directory project.
2.  Once the project is synced, open **modules/my-module/android/src/main/java/expo/modules/mymodule/MyModule.kt** file.
3.  Change `hello` function to return a different string, such as "Hello world! 🌎🤖" and save the file.
4.  Build the app by clicking **Run 'app'** button from top menu bar and you will see the changes on the screen.

You have to repeat the build step anytime you make a change to the native code to the changes.

#### iOS

1.  Open the **ios** directory (that is generated by `npx expo prebuild` in step 1) from your project in Xcode by running `xed ios` command.
2.  Under **Pods** > **Development Pods** > **MyModule**, open **MyModule.swift** file.
3.  Change `hello` function to return a different string, such as "Hello world! 🌎🍎" and save the file.
4.  Build your app by clicking **Run** button from top menu bar or press ⌘ Cmd + R, you will see the changes on the screen.

You have to repeat the build step anytime you make a change to the native code to the changes.

> **Tip**: Use `npx pod-install` to reinstall the pods if you add new native files to the module or when you modify **expo-module.config.json**.

> **Note**: There are also other flows for working on an Expo module in parallel with your application. For example, you can use a monorepo or publish to npm, as described in the [How to use a standalone Expo module](/modules/use-standalone-expo-module-in-your-project.md) guide.

## Create a new module with an example project

### Create the Expo module

To create a new Expo module from scratch, run the `create-expo-module` script as shown below. The script will ask you a few questions and then generate the native Expo module along with the example app for Android and iOS that uses your new module.

```sh
# npm
npx create-expo-module@latest my-module

# yarn
yarn create expo-module my-module

# pnpm
pnpm create expo-module my-module

# bun
bun create expo-module my-module
```

### Open the module and start the development server

Navigate to the module directory and then open the Android and/or iOS example project by running the following commands:

```sh
# npm
cd my-module
npm run open:android
npm run open:ios

# yarn
cd my-module
yarn run open:android
yarn run open:ios

# pnpm
cd my-module
pnpm run open:android
pnpm run open:ios

# bun
cd my-module
bun run open:android
bun run open:ios
```

Go to **example** directory and start the development server in your terminal so that when you edit the native module and build the app in the next step, the changes will be reflected in the app:

```sh
# npm
cd example
npx expo start

# yarn
cd example
yarn expo start

# pnpm
cd example
pnpm expo start

# bun
cd example
bun expo start
```

> **Note:** If you're using Windows, you can open the example project by opening the **android** directory in Android Studio, but you cannot open the iOS project files.

### Edit the module

#### Android

1.  Open **my-module/android/src/main/java/expo/modules/mymodule/MyModule.kt** file.
2.  Change `hello` function to return a different string, such as "Hello world! 🌎🤖" and save the file.
3.  Build the app by clicking **Run 'app'** button from top menu bar and you will see the changes on the screen.

You have to repeat the build step anytime you make a change to the native code to the changes.

#### iOS

1.  Under **Pods** > **Development Pods** > **MyModule**, open **MyModule.swift** file.
2.  Change `hello` function to return a different string, such as "Hello world! 🌎🍎" and save the file.
3.  Build your app by clicking **Run** button from top menu bar or press ⌘ Cmd + R, you will see the changes on the screen.

You have to repeat the build step anytime you make a change to the native code to the changes.

> **Tip**: Use `npx pod-install` to reinstall the pods if you add new native files to the module or when you modify **expo-module.config.json**.

## Next steps

Now that you have learned how to initialize a module and make simple changes to it, you can continue to a tutorial or dive right into the API reference.

[Tutorial: Creating a native module](/modules/native-module-tutorial.md) — A tutorial on creating a native module that persists settings with Expo Modules API.

[Expo Modules API Reference](/modules/module-api.md) — A reference to create native modules using Swift and Kotlin.
