You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The node-api-example-lib repo (including the example-app Expo project)
The main react-native-node-api README and related Callstack blog posts on Node-API / Hermes
Below are a few clarifying questions and my proposed plan.
Clarifying questions
Example naming & positioning in expo/examples
Expo examples seem to follow the with-<feature> naming pattern and are registered via meta.json, then consumable via npx create-expo --example <name>. For this one, is your preference:
with-node-api
with-react-native-node-api
or something more descriptive like with-node-api-native-module?
I’d like to align with Expo’s conventions and make it discoverable for people specifically searching for “Node-API”.
Where should the Node-API addon live?
In node-api-example-lib, the addon lives in the repo root and the Expo app is in ./example-app, consuming it via a local dependency and some Metro config. For the Expo example, which direction would you prefer?
A. Inline addon inside the example folder (e.g. with-node-api/addon/…), making the example completely self-contained.
B. Depend on a published package (if node-api-example-lib or a similar package is published to npm), so the example only shows usage.
C. Vendored copy of the addon as a local package (similar to a small workspace setup) to avoid npm publishing but still keep structure tidy.
My bias is to make the example runnable from create-expo without cloning any extra repos, so A or C seem most ergonomic.
How “heavy” should the build-from-source flow be in the example?
The current node-api-example-lib Expo app:
sets "buildReactNativeFromSource": true in app.json
uses npx expo prebuild
requires Android users to:
follow the “build React Native from source” steps in android/settings.gradle
set REACT_NATIVE_OVERRIDE_HERMES_DIR=$(npx react-native-node-api vendor-hermes --silent)
For the Expo example, do you want:
Option 1 – Full fidelity: replicate this flow (including Hermes vendoring + buildReactNativeFromSource) so the example is as “real” and up-to-date as the current Node-API setup; or
Option 2 – Slightly lighter: keep some of these steps but push the more advanced details into links to react-native-node-api docs (to reduce the wall of instructions in the example’s README)?
I’m happy to implement Option 1; just want to be sure that level of complexity is acceptable for an official Expo example.
React Native / Expo SDK version alignment
From the Callstack docs/blog, I understand that React Native + Hermes currently needs to be in a narrow version range to support Node-API (e.g. the 0.79.x constraint tied to the custom Hermes build). Expo examples, on the other hand, track specific Expo SDKs and their corresponding React Native versions.
For this example, would you like me to:
Pin the example explicitly to the “Node-API-friendly” React Native version range (even if that means it’s ahead of or slightly different from the Expo SDK that examples typically target), or
Keep React Native aligned with whatever version Expo recommends for new examples, and clearly document any extra constraints / caveats for Node-API?
Prebuilds and binary artifacts in the example repo
In node-api-example-lib, you run npm run build:rn to produce prebuilds for React Native. For the Expo example, should we:
Commit platform prebuilds (e.g. android / apple folders) into the example, so a fresh npx create-expo --example … + expo prebuild is enough; or
Keep the repo clean of generated binaries and instead add an explicit “Run npm run build:rn before expo prebuild” step to the README?
I’m leaning toward not committing binaries and having a single extra build step, but I’d like to follow whatever policy you (and the Expo maintainers) prefer.
Platform coverage & Web behavior
Since react-native-node-api currently targets iOS and Android, what behavior would you like for the Web target in the example?
A simple “not supported yet” screen / message when running on Web,
or a small graceful fallback (e.g. using a pure JS implementation on Web and the Node-API addon on native) to demonstrate conditional usage?
I can implement either, but I want to match your expectations for how “universal” this particular example should be.
High-level plan for the Expo example
Assuming the above questions are resolved, my plan is:
Example scaffolding
Create a new example folder (name based on your answer, e.g. with-node-api).
Register it in meta.json and verify it works with npx create-expo --example <name>.
Addon packaging & structure
Add either:
an inline minimal Node-API addon (C++ via CMake) inside the example, or
a small local package layout (e.g. packages/addon + apps/example) following the pattern from node-api-example-lib / with-yarn-workspaces,
Wire it up with cmake-rn and the prebuild layout expected by react-native-node-api.
Integrate the Node-API host & build flow
Add react-native-node-api as a dependency and configure:
Babel plugin (react-native-node-api/babel-plugin) for .node imports,
Metro config if needed to resolve the local addon package,
Activity
reckziegelwilliam commentedon Nov 30, 2025
Hi! I'd like to contribute an example app.
kraenhansen commentedon Nov 30, 2025
@reckziegelwilliam nice 👍
To be clear, this issue is tracking the creation of an example app in the Expo repo (following the process linked above).
I'd like for you to:
When step 4 is done, I'll assign the issue to you 👍
reckziegelwilliam commentedon Dec 1, 2025
Hi @kraenhansen, thanks for the extra context
I’ve gone through:
contributing.md+ README inexpo/examplesnode-api-example-librepo (including theexample-appExpo project)react-native-node-apiREADME and related Callstack blog posts on Node-API / HermesBelow are a few clarifying questions and my proposed plan.
Clarifying questions
Example naming & positioning in
expo/examplesExpo examples seem to follow the
with-<feature>naming pattern and are registered viameta.json, then consumable vianpx create-expo --example <name>. For this one, is your preference:with-node-apiwith-react-native-node-apiwith-node-api-native-module?I’d like to align with Expo’s conventions and make it discoverable for people specifically searching for “Node-API”.
Where should the Node-API addon live?
In
node-api-example-lib, the addon lives in the repo root and the Expo app is in./example-app, consuming it via a local dependency and some Metro config. For the Expo example, which direction would you prefer?with-node-api/addon/…), making the example completely self-contained.node-api-example-libor a similar package is published to npm), so the example only shows usage.My bias is to make the example runnable from
create-expowithout cloning any extra repos, so A or C seem most ergonomic.How “heavy” should the build-from-source flow be in the example?
The current
node-api-example-libExpo app:"buildReactNativeFromSource": trueinapp.jsonnpx expo prebuildandroid/settings.gradleREACT_NATIVE_OVERRIDE_HERMES_DIR=$(npx react-native-node-api vendor-hermes --silent)For the Expo example, do you want:
buildReactNativeFromSource) so the example is as “real” and up-to-date as the current Node-API setup; orreact-native-node-apidocs (to reduce the wall of instructions in the example’s README)?I’m happy to implement Option 1; just want to be sure that level of complexity is acceptable for an official Expo example.
React Native / Expo SDK version alignment
From the Callstack docs/blog, I understand that React Native + Hermes currently needs to be in a narrow version range to support Node-API (e.g. the 0.79.x constraint tied to the custom Hermes build). Expo examples, on the other hand, track specific Expo SDKs and their corresponding React Native versions.
For this example, would you like me to:
Prebuilds and binary artifacts in the example repo
In
node-api-example-lib, you runnpm run build:rnto produce prebuilds for React Native. For the Expo example, should we:android/applefolders) into the example, so a freshnpx create-expo --example …+expo prebuildis enough; ornpm run build:rnbeforeexpo prebuild” step to the README?I’m leaning toward not committing binaries and having a single extra build step, but I’d like to follow whatever policy you (and the Expo maintainers) prefer.
Platform coverage & Web behavior
Since
react-native-node-apicurrently targets iOS and Android, what behavior would you like for the Web target in the example?I can implement either, but I want to match your expectations for how “universal” this particular example should be.
High-level plan for the Expo example
Assuming the above questions are resolved, my plan is:
Example scaffolding
with-node-api).meta.jsonand verify it works withnpx create-expo --example <name>.Addon packaging & structure
packages/addon+apps/example) following the pattern fromnode-api-example-lib/with-yarn-workspaces,cmake-rnand the prebuild layout expected byreact-native-node-api.Integrate the Node-API host & build flow
react-native-node-apias a dependency and configure:react-native-node-api/babel-plugin) for.nodeimports,app.json/ prebuild configuration (includingbuildReactNativeFromSourceand any Hermes overrides, per your answer to Support module registration via calls tonapi_module_register#3).npm run ios/npx expo run:iosflow.Example UI & docs
node-api-example-lib’s calculator) that:react-native-node-apidocs and the longer-form blog posts for deeper dives.PR to Expo repo
expo/examples, tag you for review, and reference the originalreact-native-node-apiissue so the trail is clear.If this direction looks good overall (pending your answers to the questions above), I’ll go ahead and start implementing the example accordingly.