◉RORK LABJP
●SUBDOMAIN — Rork can now connect your web app to a subdomain only, leaving your root domain and www untouched (12/1)●UPDATES — expo-updates 58.0.23 fixes Android release builds embedding a stale runtime version●FLASH END — Intro pricing for Gemini Flash models ends 12/31, 29 days from now. Time to recheck AI feature costs●HMR — Some report the dev server picking up another server's bundle and then exiting●FIRST VIEW — Map the first screen for a normal launch, a notification, and a link, and back navigation stops surprising you●CARBON — Gemini 4 Carbon and Argon are now at standard rates: $4.00 input, $20.00 output per 1M tokens●SUBDOMAIN — Rork can now connect your web app to a subdomain only, leaving your root domain and www untouched (12/1)●UPDATES — expo-updates 58.0.23 fixes Android release builds embedding a stale runtime version●FLASH END — Intro pricing for Gemini Flash models ends 12/31, 29 days from now. Time to recheck AI feature costs●HMR — Some report the dev server picking up another server's bundle and then exiting●FIRST VIEW — Map the first screen for a normal launch, a notification, and a link, and back navigation stops surprising you●CARBON — Gemini 4 Carbon and Argon are now at standard rates: $4.00 input, $20.00 output per 1M tokens
Articles/Dev Tools
⬡ Dev Tools/2026-03-27Advanced

Rork Max × Expo Modules API: Building and Distributing Custom Native Modules

Learn how to design, implement, test, and publish custom native modules using the Expo Modules API. Extend Rork Max with platform-specific features using Swift and Kotlin.

Rork Max236Expo Modules APINative Modules5React Native244Swift48Kotlin4npm Publishing

✦ Premium Article

Why Custom Native Modules Matter

Rork Max covers a remarkable range of app development needs through AI-powered code generation and the Expo ecosystem. However, when building production-grade applications, you'll inevitably encounter situations where existing libraries fall short.

Accessing proprietary hardware sensors, building high-performance bridges to specific OS APIs, or wrapping third-party SDKs — these scenarios demand writing native code directly. The Expo Modules API provides a modern, elegant solution to this challenge.

Compared to the legacy React Native Bridge, the Expo Modules API delivers significant improvements in type safety, performance, and developer experience.

We'll build a small accelerometer module and follow it all the way through: Swift and Kotlin implementations, the TypeScript layer, testing, and npm publication. Toward the end I've also written up the design traps I only discovered after running the module on a real device.

Who this article is for:

  • Developers who have shipped (or are about to ship) a Rork Max app
  • React Native developers ready to dive into native platform extensions
  • Anyone wanting to publish reusable native modules as npm packages

Expo Modules API Architecture and Design Philosophy

How It Differs from the Legacy Bridge

The traditional React Native Bridge relied on JSON serialization for JavaScript-to-native communication. While flexible, this approach had fundamental limitations.

Legacy Bridge issues:

  • Performance overhead from asynchronous JSON serialization
  • No type safety (prone to runtime errors)
  • Different implementation patterns required for iOS and Android

Expo Modules API solutions:

  • Synchronous communication via JSI (JavaScript Interface) for better performance
  • Type-safe design that leverages native Swift/Kotlin types directly
  • Unified, declarative API across both platforms
// Legacy Bridge — asynchronous communication via JSON
// NativeModules.MyModule.doSomething(callback)
 
// Expo Modules API — synchronous JSI-based calls
import { requireNativeModule } from 'expo-modules-core';
const MyModule = requireNativeModule('MyModule');
const result = MyModule.doSomething(); // Synchronous result

Module Lifecycle

Modules built with the Expo Modules API follow this lifecycle:

  1. Registration: Automatic module discovery via expo-module.config.json
  2. Definition: Module definition by extending the Module class in Swift/Kotlin
  3. Linking: Expo's autolinking integrates the module into native projects automatically
  4. Runtime: Direct invocation from JavaScript through JSI
✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Understand the Expo Modules API architecture and implement modules in Swift and Kotlin from scratch
✦Apply unit testing and E2E testing strategies for custom native modules
✦Master the workflow for publishing your module as an npm package for the community
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⬡ Dev Tools2026-05-06
Adding a Development Build (Expo Dev Client) to a Rork Expo Project
Added a native module to an older Rork Expo (React Native) app and Expo Go stopped opening it? Following the official docs as of November 2026: the three ways to make a development build, how to tell when a rebuild is needed, Expo Update channels, and what to keep in Rork versus your own machine.
⬡ Dev Tools2026-04-28
Implementing Screen Time Control Apps with Rork Max — Family Controls / DeviceActivity / ManagedSettings
A complete walkthrough for shipping a Screen Time-style app with Rork Max — covering Family Controls authorization, DeviceActivity scheduling, and ManagedSettings shielding via custom native modules and a DeviceActivityMonitor extension.
⬡ Dev Tools2026-04-05
Rork Max × WidgetKit & Live Activities in Practice — From Home Screen to Dynamic Island
A complete guide to implementing iOS Widgets, Lock Screen widgets, and Dynamic Island Live Activities with Rork Max. Covers WidgetKit fundamentals, Timeline update strategies, App Intents integration, and monetization.