Tauri permissions generator

Tauri http permission: http:default

The http plugin (tauri-plugin-http) lets the frontend fetch hosts outside the webview's own origin from the Rust side, bypassing the browser's CORS and the app's content security policy. Its npm binding is a drop-in fetch replacement, which is why it tends to get added early and scoped never.

http:default enables the fetch commands, and the URLs it may reach are declared on the same permission entry as an allow list of URL patterns. Ship the allow list: an app that talks to one API should say so in the capability file, and the workspace scaffolding writes the permission the same way this tool does.

HTTP client at a glance

Permission
http:default
Cargo crate
tauri-plugin-http
npm bindings
@tauri-apps/plugin-http
Builder call
.plugin(tauri_plugin_http::init())
What it enables
Fetch requests to hosts outside the webview's own origin.
What it widens
Makes requests to hosts outside the app's own origin, bypassing the webview's CSP. Restrict the URLs in the plugin config.

The four files that must agree

Capability file

src-tauri/capabilities/default.json
{
  "$schema": "../gen/schemas/desktop-schema.json",
  "identifier": "default",
  "description": "Capabilities granted to the main window.",
  "windows": [
    "main"
  ],
  "permissions": [
    "core:default",
    "http:default"
  ]
}

core:default is the baseline every window has; the plugin permission is the one line this page adds.

Cargo dependency

src-tauri/Cargo.toml
[dependencies]
tauri = { version = "2", features = [] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tauri-plugin-http = "2"

Plugin registration

src-tauri/src/lib.rs
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
    tauri::Builder::default()
        .plugin(tauri_plugin_http::init())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

A crate that is declared but never registered is dead weight; one registered without its permission is a runtime denial.

Frontend bindings

terminal
npm install @tauri-apps/plugin-http

http:default, answered

The longer version is in the guide Tauri 2 permissions: capabilities without the runtime denials.

What does http:default grant in Tauri 2?
http:default is the default permission set of tauri-plugin-http. It fetch requests to hosts outside the webview's own origin. Tauri 2 denies every command that is not listed in a capability file, so without this line the plugin's commands fail at runtime even though the crate compiles and is registered.
Why does my http client call fail with a permission error?
Three files have to agree: tauri-plugin-http in Cargo.toml, .plugin(tauri_plugin_http::init()) in src/lib.rs, and http:default in the capability file under src-tauri/capabilities/. The ACL is checked when a command is invoked, not when the app is built, so a missing permission string compiles cleanly and denies at runtime. The frontend also needs @tauri-apps/plugin-http installed to call it.
Is http:default safe to ship?
Makes requests to hosts outside the app's own origin, bypassing the webview's CSP. Restrict the URLs in the plugin config. Permissions are additive on top of core:default, so the least-privilege shape is to grant only the plugins the app calls, and to prefer the plugin's granular allow-* permissions over the default set wherever a command or path can be named.

Combine it with the rest of your capability file

The Tauri permissions generator builds the whole file from the same catalogue — tick every plugin the app calls, add a custom title bar's window permissions, and copy the capability JSON, Cargo dependencies, builder chain and npm install line together. In the Nodlume workspace the same selection is what the Desktop export writes into src-tauri.

Open the generator

Other Tauri 2 plugin permissions

We'd like to use Google cookies to understand how Nodlume is used and to measure our advertising. Nothing loads until you choose, and declining does not affect anything in the app.