Invoke Tauri commands from external browsers - identical behavior to WebView.
tauri-plugin-dev-invoke routes HTTP requests through Tauri's real invoke system, so all extractors work (State, AppHandle, Window, etc.).
[dependencies]
tauri-plugin-dev-invoke = "0.2"bun add tauri-plugin-dev-invoke-apiJust add the plugin - no extra configuration needed!
#[tauri::command]
fn greet(name: String) -> String {
format!("Hello, {}!", name)
}
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_dev_invoke::init())
.invoke_handler(tauri::generate_handler![greet])
.run(tauri::generate_context!())
.expect("error");
}import { setupDevInvoke } from "tauri-plugin-dev-invoke-api";
setupDevInvoke(); // Call once at startup
// Then use invoke normally
import { invoke } from "@tauri-apps/api/core";
const response = await invoke("greet", { name: "World" });- HTTP server only runs in debug mode (
#[cfg(debug_assertions)]) - Not included in release builds
- Binds to
127.0.0.1:3030only (localhost)
packages/tauri-plugin-dev-invoke: Rust plugin cratepackages/tauri-plugin-dev-invoke-api: Frontend utilityexample/: Example application
MIT or Apache-2.0