All skills
expo avatar

/expo-module

@5c8f62e official
by expoexpo/skills2.6k stars
156

Framework (OSS). 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.

Use this Skill: https://skilld.dev/gh/expo/skills/expo-module

This session only. Nothing lands on disk.

referencesmodule-config.md

≈441 tokens on demand. Your agent reads this file only when SKILL.md points to it.

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, or modules/ 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 modules directory or nativeModulesDir if defined.

Resolution Order

  1. Explicit dependencies in react-native.config.js
  2. Custom searchPaths directories
  3. Local nativeModulesDir (defaults to ./modules/)
  4. Recursive npm dependency resolution

Source: SKILL.md on GitHub

No alerts17d4 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    The skill provides developer documentation and reference guides for creating and writing Expo native modules and views. All code examples and scripts align with legitimate development practices, and no security risks were identified.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 5c8f62e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 2 months ago
version
1.0.0
  • TypeScript
  • expo
  • native-modules
  • swift
  • kotlin
  • react-native
  • ios
  • android
  • config-plugins

README badge

README badge for expo/skills/expo-module

Guides you through creating and modifying Expo native modules in Swift (iOS) and Kotlin (Android), with TypeScript bindings. Use this skill when building native modules, native views, config plugins, or wrapping platform SDKs for React Native consumption.

Generated from the current SKILL.md.

What is the difference between a local module and a standalone module?
Local modules are for a single app and live in expo.autolinking.nativeModulesDir or modules/ folder, using the host app's tooling. Standalone modules have their own package metadata, scripts, and example app, and are intended for reuse, monorepos, or publishing.
Should I manually create native files or use create-expo-module?
Use create-expo-module to scaffold. It sets up the expected layout, expo-module.config.json, podspec/Gradle files, TypeScript bindings, and the example app flow. Manually creating files is error-prone and not recommended.
How do I add a new platform to an existing Expo module?
Use create-expo-module add-platform-support instead of manually copying native directories. This ensures correct file placement and configuration.
What platforms does this skill cover?
Swift (iOS), Kotlin (Android), and TypeScript. The skill provides DSL patterns for all three to create modules, native views, and shared objects.
Do I need to manually edit expo-module.config.json?
The scaffold generates it automatically, but you may need to edit it to register native modules and configure platform-specific settings like fully-qualified class names for Android.

Generated from the current SKILL.md. These answers refresh after source changes.