DocsPluginsShowcaseReleases
npmStar us on GitHub
overviewcreate-bini-appbini-deploybini-routerbini-envbini-nativebini-serverbini-overlaybini-ssgvite plugins↗hono plugins↗

A native React framework for building cross-platform applications from a single codebase.

Resources

  • Documentation
  • Plugins
  • Showcase
  • Releases

Community

  • GitHub Discussions
  • Reddit
  • Discord
  • LinkedIn

More

  • npm
  • GitHub
  • Issues
  • License

© 2026 Bini Cooperation.

bini-native

Official

Automatic Tauri native wiring for Bini.js. Stop hand-editing src-tauri/ for common plugins.

Overview

bini-native scans your frontend source, works out which native capabilities your app uses, and wires up the Tauri side during tauri dev. It installs the matching npm packages, adds the Rust plugin crates, scaffolds capability files, and injects runtime polyfills so standard web APIs (like navigator.clipboard or new Notification()) automatically route to the native plugin when the app runs inside Tauri.

In a normal browser, the polyfills do nothing. They only run when the app is opened inside a Tauri native shell.

Requirements

  • A Tauri v2 project with src-tauri/
  • An entry file in src/ (like src/main.tsx)
  • Vite >= 8.0.0 (peer dependency)
  • bini-router >= 2 (peer dependency)
  • cargo on your PATH

Install

>_Terminal
$ npm install -D bini-native

Register it in your Bini.js config. biniNative() takes no options.

vite.config.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { biniNative } from 'bini-native'

export default defineConfig({
  plugins: [react(), biniNative()],
})

Quick Start

Run tauri dev. Wiring is written directly to src-tauri/ and stays on disk for later builds.

Important: Run tauri dev at least once (and again after adding a new native API) before your first tauri build. On a fresh checkout where tauri dev has never run, tauri build will not wire anything for you.
src
app
page.tsx
src-tauri
Cargo.toml
lib.rs
capabilities/default.json

Supported Plugins

A plugin is wired only if your source uses its web API or directly imports its corresponding npm package.

PluginDetected byPlatform
openeropenUrl(...), window.open(...), <a target="_blank">All
dialogshowOpenFilePicker, showSaveFilePickerAll
fsreadTextFile, writeTextFile, readFile, exists, etc.All
clipboard-managernavigator.clipboard.writeText / readTextAll
notificationnew Notification(...), Notification.requestPermissionAll
osplatform, version, arch, type, family, etc.All
geolocationnavigator.geolocationAll
httpfetch('http(s)://…') with a literal URLAll
storewindow.biniStoreAll
shellCommand.create, Command.sidecarAll
processexit, relaunchAll
sqlDatabase.loadAll
global-shortcutregisterGlobalShortcutDesktop
autostartsetAutoStart, isAutoStartEnabledDesktop
cligetMatchesDesktop
hapticsnavigator.vibrateMobile

Plugins like log, websocket, deep-link, updater, window-state, biometric, barcode-scanner, and nfc are detected by their package imports (e.g. import ... from '@tauri-apps/plugin-log').

Polyfills

Standard web APIs are automatically routed to the native plugin inside Tauri. You can write normal browser code:

src/app/settings/page.tsx
export default function Settings() {
  async function copyInvite() {
    await navigator.clipboard.writeText('https://example.com/invite')
  }

  async function openFile() {
    const [handle] = await showOpenFilePicker()
    const file = await handle.getFile()
    console.log(file.name)
  }

  return (
    <>
      <button type="button" onClick={copyInvite}>Copy</button>
      <button type="button" onClick={openFile}>Open file</button>
    </>
  )
}
Note: The dialog polyfill (getFile()) dynamically imports the filesystem plugin. If you use it, make sure to import or use the fs plugin somewhere in your source (e.g. import { readTextFile } from '@tauri-apps/plugin-fs') so bini-native wires it.

Manual Setup

bini-native handles package installs and Rust registration, but some plugins require manual configuration in your Tauri files:

PluginWhat you need to do
httpDefine the allowed URL scopes in your capability file.
sqlEnable a driver feature (sqlite, mysql, or postgres) for tauri-plugin-sql in Cargo.toml.
updaterConfigure plugins.updater (public key, endpoints) and bundle.createUpdaterArtifacts in tauri.conf.json.
cliDefine arguments under plugins.cli in tauri.conf.json.
deep-linkRegister schemes and hosts under plugins.deep-link in tauri.conf.json.
nfcEnable the NFC capability in Xcode for iOS, and add the Android NFC permission yourself.
notification, geolocation, haptics, biometricAdd the Android manifest permissions and iOS/macOS Info.plist usage descriptions yourself.

bini-native will not modify your existing capability files. If you add a new plugin later, you must manually add its permissions to your capability JSON.

Platform Notes

  • Windows notifications in dev - unpackaged tauri dev builds have no Start Menu shortcut or AUMID, so Windows silently denies the permission. Run tauri build and install the result to test notifications properly.
  • Geolocation - the official Tauri geolocation plugin only supports Android, iOS, and macOS. It is still wired if your source uses it, but the permission request will fail on Windows and Linux.
  • Desktop-only / mobile-only plugins - these are placed behind #[cfg(...)] and target-conditional Cargo dependencies, so Android and iOS builds compile cleanly without the desktop-only crates.

CI / Production

Because wiring is a dev-only step, a pipeline that only runs tauri build will build whatever is committed. You have two options:

  • Commit the wiring: Run tauri dev locally, review the changes, and commit package.json, your lock file, src-tauri/Cargo.toml, src-tauri/src/lib.rs, the capability files, and the polyfill block in your entry file.
  • Run a short-lived dev command in CI: Trigger tauri dev in CI first, stop it once wiring finishes, and then run tauri build. Slower, but keeps generated files out of version control.
Was this helpful?
Previousbini-env
Nextbini-server

On this page

  • Overview
  • Requirements
  • Install
  • Quick Start
  • Supported Plugins
  • Manual Setup
  • Platform Notes
  • CI / Production
Edit this page on GitHub

bini-native

Official

Automatic Tauri native wiring for Bini.js. Stop hand-editing src-tauri/ for common plugins.

Overview

bini-native scans your frontend source, works out which native capabilities your app uses, and wires up the Tauri side during tauri dev. It installs the matching npm packages, adds the Rust plugin crates, scaffolds capability files, and injects runtime polyfills so standard web APIs (like navigator.clipboard or new Notification()) automatically route to the native plugin when the app runs inside Tauri.

In a normal browser, the polyfills do nothing. They only run when the app is opened inside a Tauri native shell.

Requirements

  • A Tauri v2 project with src-tauri/
  • An entry file in src/ (like src/main.tsx)
  • Vite >= 8.0.0 (peer dependency)
  • bini-router >= 2 (peer dependency)
  • cargo on your PATH

Install

>_Terminal
$ npm install -D bini-native

Register it in your Bini.js config. biniNative() takes no options.

vite.config.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { biniNative } from 'bini-native'

export default defineConfig({
  plugins: [react(), biniNative()],
})

Quick Start

Run tauri dev. Wiring is written directly to src-tauri/ and stays on disk for later builds.

Important: Run tauri dev at least once (and again after adding a new native API) before your first tauri build. On a fresh checkout where tauri dev has never run, tauri build will not wire anything for you.
src
app
page.tsx
src-tauri
Cargo.toml
lib.rs
capabilities/default.json

Supported Plugins

A plugin is wired only if your source uses its web API or directly imports its corresponding npm package.

PluginDetected byPlatform
openeropenUrl(...), window.open(...), <a target="_blank">All
dialogshowOpenFilePicker, showSaveFilePickerAll
fsreadTextFile, writeTextFile, readFile, exists, etc.All
clipboard-managernavigator.clipboard.writeText / readTextAll
notificationnew Notification(...), Notification.requestPermissionAll
osplatform, version, arch, type, family, etc.All
geolocationnavigator.geolocationAll
httpfetch('http(s)://…') with a literal URLAll
storewindow.biniStoreAll
shellCommand.create, Command.sidecarAll
processexit, relaunchAll
sqlDatabase.loadAll
global-shortcutregisterGlobalShortcutDesktop
autostartsetAutoStart, isAutoStartEnabledDesktop
cligetMatchesDesktop
hapticsnavigator.vibrateMobile

Plugins like log, websocket, deep-link, updater, window-state, biometric, barcode-scanner, and nfc are detected by their package imports (e.g. import ... from '@tauri-apps/plugin-log').

Polyfills

Standard web APIs are automatically routed to the native plugin inside Tauri. You can write normal browser code:

src/app/settings/page.tsx
export default function Settings() {
  async function copyInvite() {
    await navigator.clipboard.writeText('https://example.com/invite')
  }

  async function openFile() {
    const [handle] = await showOpenFilePicker()
    const file = await handle.getFile()
    console.log(file.name)
  }

  return (
    <>
      <button type="button" onClick={copyInvite}>Copy</button>
      <button type="button" onClick={openFile}>Open file</button>
    </>
  )
}
Note: The dialog polyfill (getFile()) dynamically imports the filesystem plugin. If you use it, make sure to import or use the fs plugin somewhere in your source (e.g. import { readTextFile } from '@tauri-apps/plugin-fs') so bini-native wires it.

Manual Setup

bini-native handles package installs and Rust registration, but some plugins require manual configuration in your Tauri files:

PluginWhat you need to do
httpDefine the allowed URL scopes in your capability file.
sqlEnable a driver feature (sqlite, mysql, or postgres) for tauri-plugin-sql in Cargo.toml.
updaterConfigure plugins.updater (public key, endpoints) and bundle.createUpdaterArtifacts in tauri.conf.json.
cliDefine arguments under plugins.cli in tauri.conf.json.
deep-linkRegister schemes and hosts under plugins.deep-link in tauri.conf.json.
nfcEnable the NFC capability in Xcode for iOS, and add the Android NFC permission yourself.
notification, geolocation, haptics, biometricAdd the Android manifest permissions and iOS/macOS Info.plist usage descriptions yourself.

bini-native will not modify your existing capability files. If you add a new plugin later, you must manually add its permissions to your capability JSON.

Platform Notes

  • Windows notifications in dev - unpackaged tauri dev builds have no Start Menu shortcut or AUMID, so Windows silently denies the permission. Run tauri build and install the result to test notifications properly.
  • Geolocation - the official Tauri geolocation plugin only supports Android, iOS, and macOS. It is still wired if your source uses it, but the permission request will fail on Windows and Linux.
  • Desktop-only / mobile-only plugins - these are placed behind #[cfg(...)] and target-conditional Cargo dependencies, so Android and iOS builds compile cleanly without the desktop-only crates.

CI / Production

Because wiring is a dev-only step, a pipeline that only runs tauri build will build whatever is committed. You have two options:

  • Commit the wiring: Run tauri dev locally, review the changes, and commit package.json, your lock file, src-tauri/Cargo.toml, src-tauri/src/lib.rs, the capability files, and the polyfill block in your entry file.
  • Run a short-lived dev command in CI: Trigger tauri dev in CI first, stop it once wiring finishes, and then run tauri build. Slower, but keeps generated files out of version control.
Was this helpful?
Previousbini-env
Nextbini-server

On this page

  • Overview
  • Requirements
  • Install
  • Quick Start
  • Supported Plugins
  • Manual Setup
  • Platform Notes
  • CI / Production
Edit this page on GitHub