Automatic Tauri native wiring for Bini.js. Stop hand-editing src-tauri/ for common plugins.
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.
src-tauri/src/ (like src/main.tsx)>= 8.0.0 (peer dependency)bini-router >= 2 (peer dependency)cargo on your PATHRegister it in your Bini.js config. biniNative() takes no options.
Run tauri dev. Wiring is written directly to src-tauri/ and stays on disk for later builds.
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.A plugin is wired only if your source uses its web API or directly imports its corresponding npm package.
| Plugin | Detected by | Platform |
|---|---|---|
| opener | openUrl(...), window.open(...), <a target="_blank"> | All |
| dialog | showOpenFilePicker, showSaveFilePicker | All |
| fs | readTextFile, writeTextFile, readFile, exists, etc. | All |
| clipboard-manager | navigator.clipboard.writeText / readText | All |
| notification | new Notification(...), Notification.requestPermission | All |
| os | platform, version, arch, type, family, etc. | All |
| geolocation | navigator.geolocation | All |
| http | fetch('http(s)://…') with a literal URL | All |
| store | window.biniStore | All |
| shell | Command.create, Command.sidecar | All |
| process | exit, relaunch | All |
| sql | Database.load | All |
| global-shortcut | registerGlobalShortcut | Desktop |
| autostart | setAutoStart, isAutoStartEnabled | Desktop |
| cli | getMatches | Desktop |
| haptics | navigator.vibrate | Mobile |
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').
Standard web APIs are automatically routed to the native plugin inside Tauri. You can write normal browser code:
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.bini-native handles package installs and Rust registration, but some plugins require manual configuration in your Tauri files:
| Plugin | What you need to do |
|---|---|
| http | Define the allowed URL scopes in your capability file. |
| sql | Enable a driver feature (sqlite, mysql, or postgres) for tauri-plugin-sql in Cargo.toml. |
| updater | Configure plugins.updater (public key, endpoints) and bundle.createUpdaterArtifacts in tauri.conf.json. |
| cli | Define arguments under plugins.cli in tauri.conf.json. |
| deep-link | Register schemes and hosts under plugins.deep-link in tauri.conf.json. |
| nfc | Enable the NFC capability in Xcode for iOS, and add the Android NFC permission yourself. |
| notification, geolocation, haptics, biometric | Add 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.
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.#[cfg(...)] and target-conditional Cargo dependencies, so Android and iOS builds compile cleanly without the desktop-only crates.Because wiring is a dev-only step, a pipeline that only runs tauri build will build whatever is committed. You have two options:
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.tauri dev in CI first, stop it once wiring finishes, and then run tauri build. Slower, but keeps generated files out of version control.Automatic Tauri native wiring for Bini.js. Stop hand-editing src-tauri/ for common plugins.
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.
src-tauri/src/ (like src/main.tsx)>= 8.0.0 (peer dependency)bini-router >= 2 (peer dependency)cargo on your PATHRegister it in your Bini.js config. biniNative() takes no options.
Run tauri dev. Wiring is written directly to src-tauri/ and stays on disk for later builds.
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.A plugin is wired only if your source uses its web API or directly imports its corresponding npm package.
| Plugin | Detected by | Platform |
|---|---|---|
| opener | openUrl(...), window.open(...), <a target="_blank"> | All |
| dialog | showOpenFilePicker, showSaveFilePicker | All |
| fs | readTextFile, writeTextFile, readFile, exists, etc. | All |
| clipboard-manager | navigator.clipboard.writeText / readText | All |
| notification | new Notification(...), Notification.requestPermission | All |
| os | platform, version, arch, type, family, etc. | All |
| geolocation | navigator.geolocation | All |
| http | fetch('http(s)://…') with a literal URL | All |
| store | window.biniStore | All |
| shell | Command.create, Command.sidecar | All |
| process | exit, relaunch | All |
| sql | Database.load | All |
| global-shortcut | registerGlobalShortcut | Desktop |
| autostart | setAutoStart, isAutoStartEnabled | Desktop |
| cli | getMatches | Desktop |
| haptics | navigator.vibrate | Mobile |
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').
Standard web APIs are automatically routed to the native plugin inside Tauri. You can write normal browser code:
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.bini-native handles package installs and Rust registration, but some plugins require manual configuration in your Tauri files:
| Plugin | What you need to do |
|---|---|
| http | Define the allowed URL scopes in your capability file. |
| sql | Enable a driver feature (sqlite, mysql, or postgres) for tauri-plugin-sql in Cargo.toml. |
| updater | Configure plugins.updater (public key, endpoints) and bundle.createUpdaterArtifacts in tauri.conf.json. |
| cli | Define arguments under plugins.cli in tauri.conf.json. |
| deep-link | Register schemes and hosts under plugins.deep-link in tauri.conf.json. |
| nfc | Enable the NFC capability in Xcode for iOS, and add the Android NFC permission yourself. |
| notification, geolocation, haptics, biometric | Add 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.
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.#[cfg(...)] and target-conditional Cargo dependencies, so Android and iOS builds compile cleanly without the desktop-only crates.Because wiring is a dev-only step, a pipeline that only runs tauri build will build whatever is committed. You have two options:
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.tauri dev in CI first, stop it once wiring finishes, and then run tauri build. Slower, but keeps generated files out of version control.