Skip to main content

Configuration

The tauri.conf.json is a file generated by the tauri init command (see here) that lives in your Tauri application source directory (src-tauri).

Once generated, you may modify it at will to customize your Tauri application.

Platform-specific configuration

In addition to the JSON defined on the tauri.conf.json file, Tauri reads a platform-specific configuration on tauri.linux.conf.json, tauri.windows.conf.json and tauri.macos.conf.json and merges it with the main tauri.conf.json configuration.

Configuration structure

tauri.conf.json is composed of the following properties:

build

beforeBuildCommand?: string | null
A shell command to run before `tauri build` kicks in. The TAURI_PLATFORM, TAURI_ARCH, TAURI_FAMILY, TAURI_PLATFORM_VERSION, TAURI_PLATFORM_TYPE and TAURI_DEBUG environment variables are set if you perform conditional compilation.
beforeDevCommand?: string | null
A shell command to run before `tauri dev` kicks in. The TAURI_PLATFORM, TAURI_ARCH, TAURI_FAMILY, TAURI_PLATFORM_VERSION, TAURI_PLATFORM_TYPE and TAURI_DEBUG environment variables are set if you perform conditional compilation.
devPath?: AppUrl
The path or URL to use on development.
distDir?: AppUrl
The path to the app's dist dir. This path must contain your index.html file.
features?: string[]
Features passed to `cargo` commands.
runner?: string | null
The binary used to build and run the application.
withGlobalTauri?: boolean
Whether we should inject the Tauri API on `window.__TAURI__` or not.

package

productName?: string | null
App name.
version?: string | null
App version. It is a semver version number or a path to a `package.json` file contaning the `version` field.

plugins

tauri

allowlist?: AllowlistConfig
bundle?: BundleConfig
cli?: CliConfig
macOSPrivateApi?: boolean
MacOS private API configuration. Enables the transparent background API and sets the `fullScreenEnabled` preference to `true`.
pattern?: PatternKind
The pattern to use.
security?: SecurityConfig
systemTray?: SystemTrayConfig
updater?: UpdaterConfig
windows?: WindowConfig[]
Bootstrapper Script

Instead of launching the app directly, we configure the bundled app to run a script that tries to expose the environment variables to the app; without that you'll have trouble using system CLI apps like Node.js.

Example
"tauri": {
"cli": {
"description": "Tauri communication example",
"longDescription": null,
"beforeHelp": null,
"afterHelp": null,
"args": [{
"short": "c",
"name": "config",
"takesValue": true,
"description": "Config path"
}, {
"short": "t",
"name": "theme",
"takesValue": true,
"description": "App theme",
"possibleValues": ["light", "dark", "system"]
}, {
"short": "v",
"name": "verbose",
"multipleOccurrences": true,
"description": "Verbosity level"
}],
"subcommands": {
"update": {
"description": "Updates the app",
"longDescription": null,
"beforeHelp": null,
"afterHelp": null,
"args": [{
"short": "b",
"name": "background",
"description": "Update in background"
}],
"subcommands": null
}
}
},
"bundle": {
"active": true,
"targets": ["deb"],
"identifier": "com.tauri.dev",
"icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico"],
"resources": [],
"externalBin": [],
"copyright": "",
"category": "DeveloperTool",
"shortDescription": "",
"longDescription": "",
"deb": {
"depends": []
},
"macOS": {
"frameworks": [],
"minimumSystemVersion": "",
"exceptionDomain": ""
}
},
"allowlist": {
"all": true
},
"windows": [{
"title": "Tauri App",
"width": 800,
"height": 600,
"resizable": true,
"fullscreen": false
}],
"security": {
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
}
}