Skip to content
useffect.sh
Book 30 min with a senior
Architecture

JSI (JavaScript Interface)

The C++ API that lets JavaScript hold direct references to native objects with no serialization: the foundation of the New Architecture.

Definition

JSI, short for JavaScript Interface, is a lightweight C++ API that lets a JavaScript engine (Hermes, or JavaScriptCore) expose native objects directly to JavaScript, and the other way around. A JavaScript object can hold a reference to a C++ object and call its methods synchronously, with no JSON message queue in between. It is what replaces the asynchronous bridge of React Native’s old architecture, where every native call was serialized, queued, then deserialized on the other side. Fabric, Turbo Modules, Reanimated, Nitro Modules, and VisionCamera are all built on it. JSI is also engine-agnostic: the same native code works with Hermes or with JavaScriptCore, now maintained by the community. You run into it when you read the docs of a “JSI-based” library, write a HostObject in C++, or try to understand why a native call can now be synchronous.

In a real app

In practice an app developer almost never writes JSI by hand; they consume it through Turbo Modules, the Expo Modules API, or Nitro. The concept still matters when reading a crash. A stack trace going through jsi::Runtime, HostObject, or facebook::jsi::Function means the problem is in the native call layer, not in your JavaScript. And a synchronous JSI call blocks the JS thread until it returns: a slow native method called from onScroll shows up immediately.

The classic pitfall is threading. A JSI object belongs to the runtime that created it; touching it from another thread (a network callback, a native handler) corrupts memory or crashes without a useful message. Well-built libraries go through CallInvoker to hop back onto the JS thread. Related case: Reanimated’s worklets run in their own JSI runtime, which is why you cannot call a JS-thread function from a worklet without scheduleOnRN (runOnJS before Reanimated 4).

What I look at: the engine actually in use (global.HermesInternal), which libraries declare C++ in their podspec or CMakeLists.txt, and whether the project mixes bridge modules running through the interop layer with JSI modules touching the same native resources.

Sources

All 35 glossary terms

One of these is blocking your app?

30 minutes with a senior to look at the problem in your code. Free.