# uniffi-bindgen-react-native

> Uniffi bindings generator for calling Rust from React Native

Latest version **0.31.0-6** (published 2026-09-25) · MPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install uniffi-bindgen-react-native
pnpm add uniffi-bindgen-react-native
yarn add uniffi-bindgen-react-native
bun add uniffi-bindgen-react-native
```

Provides the commands `ubrn`, `uniffi-bindgen-react-native`.

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.31.0-6 |
| Published | 2026-09-25 |
| First published | 2024-12-09 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| Author | James Hugman |
| Maintainers | jhugman |

## Links

- npm: https://www.npmjs.com/package/uniffi-bindgen-react-native
- Repository: https://github.com/jhugman/uniffi-bindgen-react-native
- Issues: https://github.com/jhugman/uniffi-bindgen-react-native/issues
- npm.io page: https://npm.io/package/uniffi-bindgen-react-native

## Recent versions

- 0.31.0-6 (latest) — 2026-09-25
- 0.31.0-5 — 2026-08-21
- 0.31.0-3 — 2026-05-28
- 0.31.0-2 — 2026-03-25
- 0.30.0-1 — 2026-02-27
- 0.29.3-1 — 2025-07-30
- 0.29.3-0 — 2025-06-12
- 0.29.0-0 — 2025-03-18
- 0.28.3-5 — 2025-03-18
- 0.28.3-4 — 2025-03-17
- 0.28.3-3 — 2025-03-03
- 0.28.3-2 — 2025-01-30
- 0.28.3-1 — 2024-12-10
- 0.28.3-0 — 2024-12-09

## README

[![CI](https://github.com/jhugman/uniffi-bindgen-react-native/actions/workflows/ci.yml/badge.svg)](https://github.com/jhugman/uniffi-bindgen-react-native/actions/workflows/ci.yml)
[![Compatibility (nightly matrix)](https://github.com/jhugman/uniffi-bindgen-react-native/actions/workflows/compat-nightly.yml/badge.svg)](https://github.com/jhugman/uniffi-bindgen-react-native/actions/workflows/compat-nightly.yml)
[![Compatibility (PR gate)](https://github.com/jhugman/uniffi-bindgen-react-native/actions/workflows/compat-pr.yml/badge.svg)](https://github.com/jhugman/uniffi-bindgen-react-native/actions/workflows/compat-pr.yml)

# 🦀 uniffi-bindgen-react-native

`uniffi-bindgen-react-native` is a tool that generates TypeScript bindings for Rust code, making it usable in React Native apps, web pages, and Node.js. It builds on [UniFFI](https://mozilla.github.io/uniffi-rs/latest/), Mozilla's bindings generator ecosystem.

With this tool, you can write your business logic once in Rust and access it seamlessly from TypeScript, whether you're developing for mobile platforms, the web or servers.

UniFFI provides procedural macros to describe your API, prioritizing expressivity and memory safety. This makes it ideal for portability.

## Packages

- **`uniffi-bindgen-react-native`** (npm) — CLI (`ubrn`), tooling, and the
  legacy-named runtime that older generated code imports from.
- **`@ubjs/core`** (npm) — same runtime bytes, new identity. New generated
  code imports from here. See [`typescript/README.md`](./typescript/README.md).
- **`@ubjs/node`** (npm) — N-API runtime backend; required for Node and Bun
  consumers of generated bindings. See [`runtimes/napi/README.md`](./runtimes/napi/README.md).

## ✨ Features

It provides tooling to generate safe and performant TypeScript to access Rust from:

- 📱 **React Native**
  - with JSI C++ to call Rust from TypeScript and back again, and
  - a Turbo-Module that installs the bindings into a running React Native library.
- 🌐 **Web pages**
  - with a WASM binding crate
- 🖥️ **Node.js** _(new)_
  - with the [`@ubjs/node`](https://www.npmjs.com/package/@ubjs/node) N-API runtime, loading your compiled Rust `cdylib` at runtime. See the [Node.js reference](https://jhugman.github.io/uniffi-bindgen-react-native/reference/nodejs.html).

All using the same proc macros: you annotate your Rust once, and build for Android, iOS, the Web, and Node.js.

Javascript hosts the Rust library, and `uniffi-bindgen-react-native` and `uniffi` facilitate the communication between the two:

- Same thread calling across the FFI from Javascript to Rust.
- Async calls from Javascript to Rust
- Same thread callbacks from Rust to Javascript
- Async callbacks from Rust to Javascript
- Pass by Reference (for "Objects")
- Pass by Value (for "Records")
- Enums and tagged unions

## Why use `uniffi-bindgen-react-native` instead of `wasm-bindgen`?

- `uniffi-bindgen-react-native` _generates_ a `wasm-bindgen` crate, from `uniffi` annotations.
- when you come to use your Rust crate in another context (say, from Python, or Kotlin, or React Native), then you can generate FFIs for those platforms, all with the same `uniffi` annotations.

## 🚀 Getting Started

If you're ready to start, then begin with a step-by-step tutorial to [make a Rust turbo-module](https://jhugman.github.io/uniffi-bindgen-react-native/guides/rn/getting-started.html) and then [run it in web page with WASM](https://jhugman.github.io/uniffi-bindgen-react-native/guides/rn/getting-started.html).

If you're new to UniFFI, then [**the UniFFI user guide**](https://mozilla.github.io/uniffi-rs/latest/)
or [**the UniFFI examples**](https://github.com/mozilla/uniffi-rs/tree/main/examples#example-uniffi-components) are interesting places to start.

## 🤔 Why `uniffi-bindgen-react-native`?

- 🧩 Spend more time writing TypeScript and Rust, less time hand-writing FFIs
- 🌍 Your Rust SDK is portable across multiple languages

## Who is using `uniffi-bindgen-react-native`?

- [@unomed/react-native-matrix-sdk](https://www.npmjs.com/package/@unomed/react-native-matrix-sdk)
- [ChessTiles on iOS](https://apps.apple.com/us/app/chesstiles/id6737867924) "uniffi-bindgen-react-native lets us run our performance critical solution search algorithm and business logic in Rust, while rapidly prototying the UI with React Native"
- [@fressh/react-native-uniffi-russh](https://www.npmjs.com/package/@fressh/react-native-uniffi-russh)

## Prior art and related projects

- [cawfree/react-native-webassembly](https://github.com/cawfree/react-native-webassembly)

## Notice

Now `uniffi-bindgen-react-native` supports WASM, the `React Native` no longer seems appropriate. In the near future, we'll change the name to `uniffi-bindgen-javascript`. Backwards compatibility will be ensured.

## Contributing

If this tool sounds interesting to you, please help us develop it! You can:

* View the [contributor guidelines](https://jhugman.github.io/uniffi-bindgen-react-native/).
* File or work on [issues](https://github.com/jhugman/uniffi-bindgen-react-native/issues) here in GitHub.
* Join discussions in the [#uniffi-bindgen-js:matrix.org](https://matrix.to/#/#uniffi-bindgen-js:matrix.org) room on Matrix.

## Code of Conduct

This project is governed by Mozilla's [Community Participation Guidelines](./CODE_OF_CONDUCT.md).

## Funding

`uniffi-bindgen-react-native` is led by James Hugman, with deep collaboration from the [Filament](https://filament.im) engineering team, funded by: 
- [Filament](https://filament.im)
- [Mozilla](https://future.mozilla.org)
- [Livekit](https://livekit.com/)

## License

[MPL-2.0](https://github.com/jhugman/uniffi-bindgen-react-native/blob/main/LICENSE)

---
_Source: https://npm.io/package/uniffi-bindgen-react-native · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
