tauri-apps/tauri
Configuration
Every Tauri app is configured by a tauri.conf.json (or Tauri.toml, or tauri.conf.json5 if the matching Cargo features are enabled). The schema is the single point of truth for what the runtime will do.
Source of truth
The Rust types are in crates/tauri-utils/src/config.rs (4,738 lines). They are serde::Deserialize plus schemars::JsonSchema (under the schema feature) which lets tauri-schema-generator produce the JSON Schema files in:
crates/tauri-cli/config.schema.jsoncrates/tauri-schema-generator/schemas/config.schema.json
The schema is also served at https://schema.tauri.app/config/2 by the tauri-schema-worker. Use that as your $schema in editors.
Top-level shape
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "MyApp",
"version": "1.0.0",
"identifier": "dev.example.myapp",
"build": {
/* frontend dev/build commands and dist path */
},
"app": {
"windows": [
/* default windows */
],
"security": {
/* CSP, pattern, dangerous flags */
},
"trayIcon": {
/* tray config */
},
"withGlobalTauri": false,
},
"bundle": {
/* bundler settings: targets, icons, etc. */
},
"plugins": {
/* per-plugin config */
},
}The full set of fields is enormous. Browse crates/tauri-utils/src/config.rs or the generated schema for an authoritative view. A few cross-references:
| Field | Behaviour gated |
|---|---|
app.security.pattern.use |
Selects "brownfield" vs "isolation". See systems/security-and-protocols. |
app.security.csp |
CSP injected during HTML rewrite by crates/tauri-utils/src/html.rs. |
app.security.assetProtocol |
asset:// scope (paths the webview can read). |
app.windows |
Default windows the runtime opens at startup. |
app.trayIcon |
Auto-enables the tray-icon Cargo feature in tauri-build. |
bundle.targets |
Which bundle types tauri build produces. |
bundle.macOS.signingIdentity |
Codesigning configuration consumed by crates/tauri-macos-sign. |
bundle.windows.nsis.* |
NSIS installer customisation. |
plugins.<name> |
Per-plugin runtime config; plugin reads it via app.config(). |
Where it is parsed
| Stage | Code |
|---|---|
tauri-cli reads via --config |
crates/tauri-cli/src/lib.rs#ConfigValue::FromStr (handles JSON5/TOML/JSON). |
| Build script parsing | crates/tauri-build/src/lib.rs, crates/tauri-build/src/manifest.rs |
| Codegen embedding | crates/tauri-codegen/src/context.rs |
| Runtime use | crates/tauri/src/manager/mod.rs and downstream |
Extensions
- JSON5 support: enable the
config-json5feature on the relevant crate (CLI auto-enables it). - TOML support: enable
config-toml; users can then shipTauri.toml. - Schema preservation: the
[patch.crates-io]block in the workspaceCargo.tomlredirectsschemars_deriveto a Tauri fork that preserves docstring newlines, so the generated schema'sdescriptionfields stay readable in editors.
Migration
The v1 → v2 schema migration is encoded in crates/tauri-cli/src/migrate/. The v1 type definitions are kept in crates/tauri-utils/src/config_v1/ so the CLI can deserialise v1 configs and emit v2-shaped output.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.