expo-module
This skill guides agents through creating and writing Expo native modules and views using the Expo Modules API with Swift, Kotlin, and TypeScript.
Identity proven by GitHub's verified organisation badge (expo)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode
- License
- MIT (permissive)
- Pin
- d4f4840pinned Oct 9, 2026
- Context cost
- about 1,500 tokenswhen the skill loads
- GitHub stars
- 2,682on expo/skills
- Scripts
- None found
What it does
“Guide for creating and writing Expo native modules and views using the Expo Modules API (Swift, Kotlin, TypeScript). Covers module definition DSL, native views, shared objects, config plugins, lifecycle hooks, autolinking, and type system. Use when building or modifying native modules for Expo. Not for migrating an existing Swift module from the definition DSL to the Expo Modules API 2.0 macros; use expo-migrate-module (from the expo-experiments plugin) for that.”
Generated summary from the skill's own text
This skill guides agents through creating and writing Expo native modules and views using the Expo Modules API with Swift, Kotlin, and TypeScript. It covers the module definition DSL, native views, config plugins, lifecycle hooks, and the autolinking system. Use it when building new native modules, wrapping platform SDKs, or adding native functionality to Expo apps.
When to use it
- Creating new Expo native modules or native views
- Adding native functionality like camera or sensors to Expo apps
- Wrapping platform SDKs for React Native consumption
- Building config plugins to modify native project files
When not to
- Migrating existing Swift modules from definition DSL to Expo Modules API 2.0 macros
- When expo-migrate-module skill is more appropriate
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add expo/skills --skill expo-moduleInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install expo/skills expo-module@d4f484024fec15196bfd3c272e953e3f983972cfInstalls the commit we checked (d4f4840).
Copy by hand
Download the folder at d4f4840 and put it in .claude/skills/expo-module for Claude Code and in .agents/skills/expo-module for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Claude Code plugin
/plugin install expo@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "expo-module" by Expo. Source, pinned to commit d4f484024fec15196bfd3c272e953e3f983972cf: https://github.com/expo/skills/tree/d4f484024fec15196bfd3c272e953e3f983972cf/plugins/expo/skills/expo-module 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/expo-module/ for Claude Code and .agents/skills/expo-module/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/expo/expo-module
SKILL.md at the pin
---
name: expo-module
description: Guide for creating and writing Expo native modules and views using the Expo Modules API (Swift, Kotlin, TypeScript). Covers module definition DSL, native views, shared objects, config plugins, lifecycle hooks, autolinking, and type system. Use when building or modifying native modules for Expo. Not for migrating an existing Swift module from the definition DSL to the Expo Modules API 2.0 macros; use expo-migrate-module (from the expo-experiments plugin) for that.
version: 1.0.0
license: MIT
---
# Writing Expo Modules
Complete reference for building native modules and views using the Expo Modules API. Covers Swift (iOS), Kotlin (Android), and TypeScript.
## When to Use
- Creating a new Expo native module or native view
- Adding native functionality (camera, sensors, system APIs) to an Expo app
- Wrapping platform SDKs for React Native consumption
- Building config plugins that modify native project files
- Adding Android, Apple, or web support to an existing Expo module
- Editing `expo-module.config.json`, config plugins, or lifecycle hooks
To migrate an existing Swift module from the definition DSL to the Expo Modules API 2.0 macros (`@ExpoModule`, `@JS`, `@Event`), use the `expo-migrate-module` skill (from the `expo-experiments` plugin) instead.
## References
Consult these resources as needed:
```
references/
create-expo-module.md Scaffolding and add-platform-support workflow, defaults, and quirks
native-module.md Module definition DSL: Name, Function, AsyncFunction, Property, Constant, Events, type system, shared objects
native-view.md Native view components: View, Prop, EventDispatcher, view lifecycle, ref-based functions
lifecycle.md Lifecycle hooks: module, iOS app/AppDelegate, Android activity/application listeners
config-plugin.md Config plugins: modifying Info.plist, AndroidManifest.xml, reading values in native code
module-config.md expo-module.config.json fields, file placement, and autolinking behavior
```
## Quick Start
Prefer `create-expo-module` over manually creating native module files and directories. In practice, the best path is usually to create the scaffold first and then build on top of it. The scaffold sets up the expected layout, `expo-module.config.json`, podspec or Gradle files, TypeScript bindings, and the standalone example app flow.
If an existing Expo module only needs another platform, use `create-expo-module add-platform-support` instead of manually copying native directories.
See [references/create-expo-module.md](references/create-expo-module.md) before scaffolding or extending a module. It covers:
- local vs standalone modules
- `--platform`, `--features`, `--barrel`, `--package-manager`, and non-interactive mode
- `expo.autolinking.nativeModulesDir`
- `add-platform-support` behavior and quirks
## Recommended Workflow
1. Choose the scaffold type first:
- **Local module** for one app
- **Standalone module** for reuse, monorepos, or publishing
2. Determine native `expo-module` features that you will need.
- Based on the user's instructions determine which feature scaffolding will be useful.
- Available features: `Constant`, `Function`, `AsyncFunction`, `Event`, `View`, `ViewEvent`, `SharedObject`
3. Scaffold deliberately:
- pass an explicit slug or path
- choose `--platform` intentionally instead of relying on defaults
- use `--features` to choose code samples which you will modify in the next step to match the real implementation.
4. Replace generated example code with the real implementation.
5. If you add a new platform later, prefer `add-platform-support` over manual file copying.
## Practical Scaffolding Rules
- Feature examples are **opt-in**. A newly scaffolded module may be minimal if no features were selected.
- `ViewEvent` implies `View`.
- Local modules do **not** generate an `index.ts` barrel by default. Use `--barrel` only if you want one.
- In non-interactive local scaffolding, pass the positional slug or path explicitly. `--name` changes the native class name, not the folder name.
- Local modules live in `expo.autolinking.nativeModulesDir` when configured, otherwise in `modules/`.
- Standalone modules have their own package metadata, scripts, and usually an example app. Local modules use the host app's tooling instead.
## Core File Shapes
The Swift and Kotlin DSL share the same structure. Swift is usually the clearest primary example; consult the references for feature-specific details.
## Module Structure Reference
The Swift and Kotlin DSL share the same structure. Both platforms are shown here for reference — in other reference files, Swift is shown as the primary language unless the Kotlin pattern meaningfully differs.
**Swift (iOS):**
```swift
import ExpoModulesCore
public class MyModule: Module {
public func definition() -> ModuleDefinition {
Name("MyModule")
Function("hello") { (name: String) -> String in
return "Hello \(name)!"
}
}
}
```
**Kotlin (Android):**
```kotlin
package expo.modules.mymodule
import expo.modules.kotlin.modules.Module
import expo.modules.kotlin.modules.ModuleDefinition
class MyModule : Module() {
override fun definition() = ModuleDefinition {
Name("MyModule")
Function("hello") { name: String ->
"Hello $name!"
}
}
}
```
**TypeScript:**
```typescript
import { requireNativeModule } from "expo";
const MyModule = requireNativeModule("MyModule");
export function hello(name: string): string {
return MyModule.hello(name);
}
```
### expo-module.config.json
```json
{
"platforms": ["android", "apple"],
"apple": {
"modules": ["MyModule"]
},
"android": {
"modules": ["expo.modules.mymodule.MyModule"]
}
}
```
Note: iOS uses just the class name; Android uses the fully-qualified class name (package + class). See `references/module-config.md` for all fields.
## Submitting Feedback
If you encounter errors, misleading or outdated information in this skill, report it so Expo can improve:
```bash
npx --yes submit-expo-feedback@latest --category skills --subject "expo-module" "<actionable feedback>"
```
Only submit when you have something specific and actionable to report. Include as much relevant context as possible.
If an AI agent repeatedly failed or the user had to take over an Expo task, load the expo-skill-feedback skill and follow its eval-candidate flow instead of reusing the command above.
From expo/skills at d4f4840, shown as plain text under its license: MIT (permissive). The license text is in plugins/expo/skills/expo-module/SKILL.md.
View SKILL.md on GitHub at d4f4840Files
- SKILL.md6.5 KB · 49922f864b63
- agents/
- openai.yaml367 B · cb7a56ee8e8a
- references/
- config-plugin.md2.0 KB · f1e0d7e421e4
- create-expo-module.md10 KB · d292f0cd5123
- lifecycle.md3.8 KB · b54a9c6e3d2e
- module-config.md1.8 KB · de6eba495e20
- native-module.md5.9 KB · 69c7cb2cc004
- native-view.md3.6 KB · cde788f4dfad
8 files, 34 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at d4f4840More from Expo
expo-app-intents
This skill adds Apple App Intents to Expo apps, enabling Siri voice commands and Shortcuts automation through Swift declarations that dispatch to JavaScript…
Claude Code, Codex, Cursor +4 · about 3.6K tokens · pinned 6 days ago
expo-sqlite
This skill enables SQLite database operations in Expo and React Native apps for structured data storage, offline queues, and persistent caches.
Claude Code, Codex, Cursor +4 · about 2.6K tokens · pinned 6 days ago
eas-app-stores
This skill configures and executes iOS and Android app builds and store submissions using EAS, Expo's app distribution service.
Claude Code, Codex, Cursor +3 · about 1.7K tokens · pinned 6 days ago
eas-hosting
This skill deploys Expo web applications and API routes to EAS Hosting, a managed edge platform running on Cloudflare Workers.
Claude Code, Codex, Cursor +3 · about 2.7K tokens · pinned 6 days ago
eas-observe
EAS Observe tracks startup, navigation, and custom-event performance in production Expo apps through instrumentation (AppMetricsRoot/ObserveRoot wrapper…
Claude Code, Codex, Cursor +3 · about 1.1K tokens · pinned 6 days ago
eas-simulator
Runs a user's app on a remote iOS or Android simulator hosted on EAS cloud infrastructure, accessible from machines without local simulator support like Linux…
Claude Code, Codex, Cursor +3 · about 6.3K tokens · pinned 6 days ago
Related in Mobile
expo-migrate-module
Converts the Swift source code of an existing Expo native module from the 1.0 definition DSL to the 2.0 macro API, keeping its JavaScript and TypeScript…
by ExpoOfficial publisher
Claude Code, Codex, Cursor +3 · about 2.5K tokens · pinned 6 days ago
clerk-expo
Adds Clerk authentication to Expo and React Native apps using the @clerk/expo SDK.
by ClerkOfficial publisher
Claude Code, Codex, Cursor +4 · about 2.7K tokens · pinned 6 days ago
expo-brownfield
This skill helps agents add React Native to existing native iOS or Android apps incrementally using Expo.
by ExpoOfficial publisher
Claude Code, Codex, Cursor +4 · about 1.4K tokens · pinned 6 days ago
create-mobile-app
This skill creates a new mobile app using Power Apps, Expo, React Native, and TypeScript targeted at iOS and Android platforms.
by MicrosoftOfficial publisher
Claude Code · about 51.1K tokens · pinned 6 days ago
clerk-android
This skill implements Clerk authentication in native Android apps written in Kotlin and Jetpack Compose by following the clerk-android SDK patterns and…
by ClerkOfficial publisher
Claude Code, Codex, Cursor +4 · about 2K tokens · pinned 6 days ago
clerk-swift
Integrates Clerk authentication into native Swift and iOS projects using ClerkKit and ClerkKitUI.
by ClerkOfficial publisher
Claude Code, Codex, Cursor +4 · about 2.9K tokens · pinned 6 days ago