Loading...
Loading...
Guides developers through Tauri v2 configuration including tauri.conf.json structure, Cargo.toml settings, environment-specific configs, and common configuration options for desktop and mobile applications.
npx skill4agent add dchuk/claude-code-tauri-skills configuring-tauri-apps| File | Purpose | Format |
|---|---|---|
| Tauri-specific settings | JSON, JSON5, or TOML |
| Rust dependencies and metadata | TOML |
| Frontend dependencies and scripts | JSON |
src-tauri/tauri.conf.jsontauri.conf.json5config-json5Tauri.tomlconfig-toml{
"$schema": "https://schema.tauri.app/config/2",
"productName": "MyApp",
"version": "1.0.0",
"identifier": "com.company.myapp",
"mainBinaryName": "my-app",
"build": {
"devUrl": "http://localhost:3000",
"frontendDist": "../dist",
"beforeDevCommand": "npm run dev",
"beforeBuildCommand": "npm run build",
"features": ["custom-feature"],
"removeUnusedCommands": true
},
"app": {
"withGlobalTauri": false,
"macOSPrivateApi": false,
"windows": [
{
"title": "My Application",
"width": 1200,
"height": 800,
"minWidth": 800,
"minHeight": 600,
"resizable": true,
"fullscreen": false,
"center": true,
"visible": true,
"decorations": true,
"transparent": false,
"alwaysOnTop": false,
"focus": true,
"url": "index.html"
}
],
"security": {
"capabilities": [],
"assetProtocol": {
"enable": true,
"scope": ["$APPDATA/**"]
},
"pattern": { "use": "brownfield" },
"freezePrototype": false
},
"trayIcon": {
"id": "main-tray",
"iconPath": "icons/tray.png",
"iconAsTemplate": true
}
},
"bundle": {
"active": true,
"targets": "all",
"icon": ["icons/32x32.png", "icons/128x128.png", "icons/icon.icns", "icons/icon.ico"],
"resources": ["assets/**/*"],
"copyright": "Copyright 2024",
"category": "Utility",
"shortDescription": "A short app description",
"longDescription": "A longer description",
"licenseFile": "../LICENSE",
"windows": {
"certificateThumbprint": null,
"timestampUrl": "http://timestamp.digicert.com",
"nsis": { "license": "../LICENSE", "installerIcon": "icons/icon.ico", "installMode": "currentUser" }
},
"macOS": {
"minimumSystemVersion": "10.13",
"signingIdentity": null,
"dmg": { "appPosition": { "x": 180, "y": 170 }, "applicationFolderPosition": { "x": 480, "y": 170 } }
},
"linux": {
"appimage": { "bundleMediaFramework": false },
"deb": { "depends": ["libwebkit2gtk-4.1-0"] },
"rpm": { "depends": ["webkit2gtk4.1"] }
},
"android": { "minSdkVersion": 24 },
"iOS": { "minimumSystemVersion": "13.0" }
},
"plugins": {
"updater": {
"pubkey": "YOUR_PUBLIC_KEY",
"endpoints": ["https://releases.example.com/{{target}}/{{arch}}/{{current_version}}"]
}
}
}| Field | Type | Required | Description |
|---|---|---|---|
| string | No | Application display name |
| string | No | Semver version or path to package.json |
| string | Yes | Reverse domain identifier (e.g., |
| string | No | Override the main binary filename |
| Field | Type | Description |
|---|---|---|
| string | Development server URL for hot-reload |
| string | Path to built frontend assets or remote URL |
| string | Script to run before |
| string | Script to run before |
| string[] | Cargo features to enable during build |
| boolean | Strip unused plugin commands from binary |
| Field | Type | Default | Description |
|---|---|---|---|
| string | | Window title |
| number | | Window dimensions in pixels |
| number | - | Minimum dimensions |
| number | - | Maximum dimensions |
| number | - | Window position |
| boolean | | Allow window resizing |
| boolean | | Start in fullscreen |
| boolean | | Center window on screen |
| boolean | | Window visibility on start |
| boolean | | Show window decorations |
| boolean | | Enable window transparency |
| boolean | | Keep window above others |
| string | | Initial URL to load |
| Field | Type | Description |
|---|---|---|
| string[] | Permission capabilities for the application |
| boolean | Enable custom asset protocol |
| string[] | Allowed paths for asset protocol |
| string | Security pattern ( |
| boolean | Prevent prototype mutation |
| Platform | Targets |
|---|---|
| Windows | |
| macOS | |
| Linux | |
| Android | |
| iOS | |
| Platform | Filename |
|---|---|
| Linux | |
| Windows | |
| macOS | |
| Android | |
| iOS | |
src-tauri/tauri.windows.conf.json{
"app": {
"windows": [{ "title": "My App - Windows Edition" }]
},
"bundle": {
"windows": { "nsis": { "installMode": "perMachine" } }
}
}src-tauri/tauri.macos.conf.json{
"app": { "macOSPrivateApi": true },
"bundle": {
"macOS": { "minimumSystemVersion": "11.0", "entitlements": "entitlements.plist" }
}
}# Development with custom config
tauri dev --config src-tauri/tauri.dev.conf.json
# Build with beta configuration
tauri build --config src-tauri/tauri.beta.conf.json
# Inline configuration override
tauri build --config '{"bundle":{"identifier":"com.company.myapp.beta"}}'src-tauri/Cargo.toml[package]
name = "my-app"
version = "1.0.0"
edition = "2021"
[build-dependencies]
tauri-build = { version = "2.0", features = [] }
[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tauri = { version = "2.0", features = [] }
tauri-plugin-shell = "2.0"
tauri-plugin-opener = "2.0"
[features]
default = ["custom-protocol"]
custom-protocol = ["tauri/custom-protocol"][dependencies]
tauri = { version = "2.0", features = [
"config-json5", # Enable JSON5 config format
"config-toml", # Enable TOML config format
"devtools", # Enable WebView devtools
"macos-private-api", # Enable macOS private APIs
"tray-icon", # Enable system tray support
"image-png", # PNG image support
"image-ico", # ICO image support
"protocol-asset" # Custom asset protocol
] }tauri = { version = "2.0" } # Semver-compatible (recommended)
tauri = { version = "=2.0.0" } # Exact version
tauri = { version = "~2.0.0" } # Patch updates only{
"name": "my-tauri-app",
"version": "1.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"tauri": "tauri"
},
"dependencies": { "@tauri-apps/api": "^2.0.0" },
"devDependencies": { "@tauri-apps/cli": "^2.0.0" }
}src-tauri/tauri.dev.conf.json{
"build": { "devUrl": "http://localhost:5173" },
"app": {
"withGlobalTauri": true,
"windows": [{ "title": "My App [DEV]" }]
}
}src-tauri/tauri.prod.conf.json{
"build": { "frontendDist": "../dist", "removeUnusedCommands": true },
"bundle": { "active": true, "targets": "all" }
}src-tauri/tauri.beta.conf.json{
"identifier": "com.company.myapp.beta",
"productName": "MyApp Beta",
"plugins": {
"updater": {
"endpoints": ["https://beta-releases.example.com/{{target}}/{{arch}}/{{current_version}}"]
}
}
}Tauri.toml[build]
dev-url = "http://localhost:3000"
before-dev-command = "npm run dev"
before-build-command = "npm run build"
[app]
with-global-tauri = false
[[app.windows]]
title = "My Application"
width = 1200
height = 800
resizable = true
center = true
[app.security]
freeze-prototype = false
[app.security.asset-protocol]
enable = true
scope = ["$APPDATA/**"]
[bundle]
active = true
targets = "all"
icon = ["icons/32x32.png", "icons/128x128.png", "icons/icon.icns", "icons/icon.ico"]
[plugins.updater]
pubkey = "YOUR_PUBLIC_KEY"
endpoints = ["https://releases.example.com/{{target}}/{{arch}}/{{current_version}}"]{
"app": {
"windows": [
{ "label": "main", "title": "Main Window", "width": 1200, "height": 800, "url": "index.html" },
{ "label": "settings", "title": "Settings", "width": 600, "height": 400, "url": "settings.html", "visible": false }
]
}
}{
"app": {
"trayIcon": { "id": "main-tray", "iconPath": "icons/tray.png", "iconAsTemplate": true },
"windows": [{ "visible": false }]
}
}{
"plugins": {
"updater": {
"pubkey": "YOUR_PUBLIC_KEY",
"endpoints": ["https://releases.example.com/{{target}}/{{arch}}/{{current_version}}"],
"windows": { "installMode": "passive" }
},
"shell": {
"open": true,
"scope": [{ "name": "open-url", "cmd": "open", "args": [{ "validator": "\\S+" }] }]
},
"deep-link": {
"mobile": ["myapp"],
"desktop": { "schemes": ["myapp"] }
}
}
}| File | Purpose |
|---|---|
| Locks Rust dependency versions |
| Locks npm dependency versions |
| Locks Yarn dependency versions |
| Locks pnpm dependency versions |
{ "$schema": "https://schema.tauri.app/config/2" }tauri info