expo-module

Create Expo native modules and views using Swift, Kotlin, and TypeScript.

Updated Sep 11, 2026
One-click install
npx skills add https://github.com/CYRUS-pinto/pi-bot --skill expo-module-cyrus-pinto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: expo-module
Source: https://github.com/CYRUS-pinto/pi-bot/tree/main/.agents/skills/expo-module
Command: npx skills add https://github.com/CYRUS-pinto/pi-bot --skill expo-module-cyrus-pinto

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building native functionality for Expo apps requires coordinating Swift, Kotlin, TypeScript, config plugins, and autolinking configuration, which is error-prone without a structured reference for the Expo Modules API. ## Core Features & Use Cases - Module Scaffolding: Guides use of create-expo-module for local and standalone modules, including platform selection, feature examples, and add-platform-support for existing modules. - Module Definition DSL: Covers Name, Function, AsyncFunction, Property, Constant, Events, Records, Enums, Either types, and Shared Objects in Swift and Kotlin. - Native Views & Lifecycle: Documents View, Prop, EventDispatcher, view lifecycle hooks, AppDelegate subscribers, and Android activity/application listeners. - Config Plugins & Autolinking: Explains writing config plugins for Info.plist and AndroidManifest.xml plus expo-module.config.json fields and autolinking resolution. - Use Case: You need to wrap a platform SDK (camera, sensors) for React Native. Scaffold a module, define functions and events in Swift and Kotlin, and expose a typed TypeScript API. ## Quick Start Use the expo-module skill to scaffold a new local Expo native module with an async function and wire it up for iOS and Android.

Frequently Asked Questions about expo-module

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a new Expo native module?

Run npx create-expo-module with an explicit slug, choosing --local for app-internal modules or a standalone package for reuse. Pass --platform and --features to control generated platforms and example code, then replace the scaffold with your real implementation.

How do I add a platform to an existing Expo module?

Use npx create-expo-module add-platform-support with --platform apple, android, or web from the module root. It only adds platforms missing from expo-module.config.json and refuses to overwrite existing android or ios directories.

What is the difference between local and standalone Expo modules?

Local modules live inside one app, use the app's tooling, and skip dependency installation and example apps. Standalone modules have their own package.json, install dependencies, build TypeScript, and usually include an example app for testing.

Does the Expo Modules API support Kotlin coroutines?

Yes, AsyncFunction on Android supports Kotlin coroutines using the Coroutine block, letting you call suspending functions like withContext(Dispatchers.IO) directly inside the module definition.

How do I send events from native code to JavaScript in Expo?

Declare events with Events("onChange") in the module definition, then call sendEvent from Swift or Kotlin. In JavaScript, subscribe with the useEvent hook or addListener, and use OnStartObserving to begin producing events.

When should I not use this skill for Expo modules?

Do not use it to migrate an existing Swift module from the definition DSL to the Expo Modules API 2.0 macros like @ExpoModule and @JS. For that migration, use the expo-migrate-module skill from the expo-experiments plugin instead.