Configuration
此内容尚不支持你的语言。
The Tauri configuration object. It is read from a file where you can define your frontend assets, configure the bundler and define a tray icon.
The configuration file is generated by the
tauri init
command that lives in
your Tauri application source directory (src-tauri).
Once generated, you may modify it at will to customize your Tauri application.
By default, the configuration is defined as a JSON file named tauri.conf.json
.
Tauri also supports JSON5 and TOML files via the config-json5
and config-toml
Cargo features, respectively.
The JSON5 file name must be either tauri.conf.json
or tauri.conf.json5
.
The TOML file name is Tauri.toml
.
In addition to the default configuration file, Tauri can
read a platform-specific configuration from tauri.linux.conf.json
,
tauri.windows.conf.json
, tauri.macos.conf.json
, tauri.android.conf.json
and tauri.ios.conf.json
(or Tauri.linux.toml
, Tauri.windows.toml
, Tauri.macos.toml
, Tauri.android.toml
and Tauri.ios.toml
if the Tauri.toml
format is used),
which gets merged with the main configuration object.
The configuration is composed of the following objects:
app
: The Tauri configurationbuild
: The build configurationbundle
: The bundle configurationsplugins
: The plugins configuration
Example tauri.config.json file:
{ "productName": "tauri-app", "version": "0.1.0", "build": { "beforeBuildCommand": "", "beforeDevCommand": "", "devUrl": "http://localhost:3000", "frontendDist": "../dist" }, "app": { "security": { "csp": null }, "windows": [ { "fullscreen": false, "height": 600, "resizable": true, "title": "Tauri App", "width": 800 } ] }, "bundle": {}, "plugins": {}}
Object Properties:
- app
- build
- bundle
- identifier (required)
- mainBinaryName
- plugins
- productName
- version
The App configuration.
{ "enableGTKAppId": false, "macOSPrivateApi": false, "security": { "assetProtocol": { "enable": false, "scope": [] }, "capabilities": [], "dangerousDisableAssetCspModification": false, "freezePrototype": false, "pattern": { "use": "brownfield" } }, "windows": [], "withGlobalTauri": false}
The build configuration.
{ "removeUnusedCommands": false}
The bundler configuration.
{ "active": false, "android": { "minSdkVersion": 24 }, "createUpdaterArtifacts": false, "iOS": { "minimumSystemVersion": "13.0" }, "icon": [], "linux": { "appimage": { "bundleMediaFramework": false, "files": {} }, "deb": { "files": {} }, "rpm": { "epoch": 0, "files": {}, "release": "1" } }, "macOS": { "dmg": { "appPosition": { "x": 180, "y": 170 }, "applicationFolderPosition": { "x": 480, "y": 170 }, "windowSize": { "height": 400, "width": 660 } }, "files": {}, "hardenedRuntime": true, "minimumSystemVersion": "10.13" }, "targets": "all", "useLocalToolsDir": false, "windows": { "allowDowngrades": true, "certificateThumbprint": null, "digestAlgorithm": null, "nsis": null, "signCommand": null, "timestampUrl": null, "tsp": false, "webviewInstallMode": { "silent": true, "type": "downloadBootstrapper" }, "wix": null }}
string
The application identifier in reverse domain name notation (e.g. com.tauri.example
).
This string must be unique across applications since it is used in system configurations like
the bundle ID and path to the webview data directory.
This string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-),
and periods (.).
string
| null
Overrides app’s main binary filename.
By default, Tauri uses the output binary from cargo
, by setting this, we will rename that binary in tauri-cli
’s
tauri build
command, and target tauri bundle
to it
If possible, change the package name
or set the name field
instead,
and if that’s not enough and you’re using nightly, consider using the different-binary-name
feature instead
Note: this config should not include the binary extension (e.g. .exe
), we’ll add that for you
The plugins config.
Default: {}
string
| null
pattern of ^[^/\:*?"<>|]+$
App name.
string
| null
App version. It is a semver version number or a path to a package.json
file containing the version
field.
If removed the version number from Cargo.toml
is used.
It’s recommended to manage the app versioning in the Tauri config.
- macOS: Translates to the bundle’s CFBundleShortVersionString property and is used as the default CFBundleVersion.
You can set an specific bundle version using
bundle > macOS > bundleVersion
. - iOS: Translates to the bundle’s CFBundleShortVersionString property and is used as the default CFBundleVersion.
You can set an specific bundle version using
bundle > iOS > bundleVersion
. Thetauri ios build
CLI command has a--build-number <number>
option that lets you append a build number to the app version. - Android: By default version 1.0 is used. You can set a version code using
bundle > android > versionCode
.
By default version 1.0 is used on Android.
General configuration for the Android target.
Object Properties:
- minSdkVersion
- versionCode
integer
formatted as uint32
The minimum API level required for the application to run. The Android system will prevent the user from installing the application if the system’s API level is lower than the value specified.
Default: 24
integer
| null
maximum of 2100000000
, minimum of 1
, formatted as uint32
The version code of the application. It is limited to 2,100,000,000 as per Google Play Store requirements.
By default we use your configured version and perform the following math: versionCode = version.major * 1000000 + version.minor * 1000 + version.patch
The App configuration object.
See more: <https://v2.tauri.app/reference/config/#appconfig>
Object Properties:
- enableGTKAppId
- macOSPrivateApi
- security
- trayIcon
- windows
- withGlobalTauri
boolean
If set to true “identifier” will be set as GTK app ID (on systems that use GTK).
boolean
MacOS private API configuration. Enables the transparent background API and sets the fullScreenEnabled
preference to true
.
Security configuration.
{ "assetProtocol": { "enable": false, "scope": [] }, "capabilities": [], "dangerousDisableAssetCspModification": false, "freezePrototype": false, "pattern": { "use": "brownfield" }}
TrayIconConfig
| null
Configuration for app tray icon.
The app windows configuration.
Default: []
boolean
Whether we should inject the Tauri API on window.__TAURI__
or not.
Configuration for AppImage bundles.
See more: <https://v2.tauri.app/reference/config/#appimageconfig>
Object Properties:
- bundleMediaFramework
- files
boolean
Include additional gstreamer dependencies needed for audio and video playback. This increases the bundle size by ~15-35MB depending on your build system.
The files to include in the Appimage Binary.
Allows additional properties: string
Default: {}
Config for the asset custom protocol.
See more: <https://v2.tauri.app/reference/config/#assetprotocolconfig>
Object Properties:
- enable
- scope
boolean
Enables the asset protocol.
The access scope for the asset protocol.
Default: []
string
An extension for a [FileAssociation
].
A leading .
is automatically stripped.
One of the following:
"disabled"
A policy where background throttling is disabled"suspend"
A policy where a web view that’s not in a window fully suspends tasks. This is usually the default behavior in case no policy is set."throttle"
A policy where a web view that’s not in a window limits processing, but does not fully suspend tasks.
Background throttling policy.
Any of the following:
string
Run the given script with the default options.- Run the given script with custom options. Object Properties: - cwd - script (required) - wait ##### cwd
string
|null
The current working directory. ##### scriptstring
The script to execute. ##### waitboolean
Whethertauri dev
should wait for the command to finish or not. Defaults tofalse
.
Describes the shell command to run before tauri dev
.
The Build configuration object.
See more: <https://v2.tauri.app/reference/config/#buildconfig>
Object Properties:
- beforeBuildCommand
- beforeBundleCommand
- beforeDevCommand
- devUrl
- features
- frontendDist
- removeUnusedCommands
- runner
HookCommand
| null
A shell command to run before tauri build
kicks in.
The TAURI_ENV_PLATFORM, TAURI_ENV_ARCH, TAURI_ENV_FAMILY, TAURI_ENV_PLATFORM_VERSION, TAURI_ENV_PLATFORM_TYPE and TAURI_ENV_DEBUG environment variables are set if you perform conditional compilation.
HookCommand
| null
A shell command to run before the bundling phase in tauri build
kicks in.
The TAURI_ENV_PLATFORM, TAURI_ENV_ARCH, TAURI_ENV_FAMILY, TAURI_ENV_PLATFORM_VERSION, TAURI_ENV_PLATFORM_TYPE and TAURI_ENV_DEBUG environment variables are set if you perform conditional compilation.
BeforeDevCommand
| null
A shell command to run before tauri dev
kicks in.
The TAURI_ENV_PLATFORM, TAURI_ENV_ARCH, TAURI_ENV_FAMILY, TAURI_ENV_PLATFORM_VERSION, TAURI_ENV_PLATFORM_TYPE and TAURI_ENV_DEBUG environment variables are set if you perform conditional compilation.
string
| null
formatted as uri
The URL to load in development.
This is usually an URL to a dev server, which serves your application assets with hot-reload and HMR. Most modern JavaScript bundlers like Vite provides a way to start a dev server by default.
If you don’t have a dev server or don’t want to use one, ignore this option and use frontendDist
and point to a web assets directory, and Tauri CLI will run its built-in dev server and provide a simple hot-reload experience.
string
[] | null
Features passed to cargo
commands.
FrontendDist
| null
The path to the application assets (usually the dist
folder of your javascript bundler)
or a URL that could be either a custom protocol registered in the tauri app (for example: myprotocol://
)
or a remote URL (for example: https://site.com/app
).
When a path relative to the configuration file is provided,
it is read recursively and all files are embedded in the application binary.
Tauri then looks for an index.html
and serves it as the default entry point for your application.
You can also provide a list of paths to be embedded, which allows granular control over what files are added to the binary. In this case, all files are added to the root and you must reference it that way in your HTML files.
When a URL is provided, the application won’t have bundled assets and the application will load that URL by default.
boolean
Try to remove unused commands registered from plugins base on the ACL list during tauri build
,
the way it works is that tauri-cli will read this and set the environment variables for the build script and macros,
and they’ll try to get all the allowed commands and remove the rest
Note:
- This won’t be accounting for dynamically added ACLs when you use features from the
dynamic-acl
(currently enabled by default) feature flag, so make sure to check it when using this - This feature requires tauri-plugin 2.1 and tauri 2.4
string
| null
The binary used to build and run the application.
Configuration for tauri-bundler.
See more: <https://v2.tauri.app/reference/config/#bundleconfig>
Object Properties:
- active
- android
- category
- copyright
- createUpdaterArtifacts
- externalBin
- fileAssociations
- homepage
- icon
- iOS
- license
- licenseFile
- linux
- longDescription
- macOS
- publisher
- resources
- shortDescription
- targets
- useLocalToolsDir
- windows
boolean
Whether Tauri should bundle your application or just output the executable.
Android configuration.
{ "minSdkVersion": 24}
string
| null
The application kind.
Should be one of the following: Business, DeveloperTool, Education, Entertainment, Finance, Game, ActionGame, AdventureGame, ArcadeGame, BoardGame, CardGame, CasinoGame, DiceGame, EducationalGame, FamilyGame, KidsGame, MusicGame, PuzzleGame, RacingGame, RolePlayingGame, SimulationGame, SportsGame, StrategyGame, TriviaGame, WordGame, GraphicsAndDesign, HealthcareAndFitness, Lifestyle, Medical, Music, News, Photography, Productivity, Reference, SocialNetworking, Sports, Travel, Utility, Video, Weather.
string
| null
A copyright string associated with your application.
Produce updaters and their signatures or not
string
[] | null
A list of—either absolute or relative—paths to binaries to embed with your application.
Note that Tauri will look for system-specific binaries following the pattern “binary-name{-target-triple}{.system-extension}”.
E.g. for the external binary “my-binary”, Tauri looks for:
- “my-binary-x86_64-pc-windows-msvc.exe” for Windows
- “my-binary-x86_64-apple-darwin” for macOS
- “my-binary-x86_64-unknown-linux-gnu” for Linux
so don’t forget to provide binaries for all targeted platforms.
FileAssociation
[] | null
File associations to application.
string
| null
A url to the home page of your application. If unset, will
fallback to homepage
defined in Cargo.toml
.
Supported bundle targets: deb
, rpm
, nsis
and msi
.
string
[]
The app’s icons
Default: []
iOS configuration.
{ "minimumSystemVersion": "13.0"}
string
| null
The package’s license identifier to be included in the appropriate bundles. If not set, defaults to the license from the Cargo.toml file.
string
| null
The path to the license file to be included in the appropriate bundles.
Configuration for the Linux bundles.
{ "appimage": { "bundleMediaFramework": false, "files": {} }, "deb": { "files": {} }, "rpm": { "epoch": 0, "files": {}, "release": "1" }}
string
| null
A longer, multi-line description of the application.
Configuration for the macOS bundles.
{ "dmg": { "appPosition": { "x": 180, "y": 170 }, "applicationFolderPosition": { "x": 480, "y": 170 }, "windowSize": { "height": 400, "width": 660 } }, "files": {}, "hardenedRuntime": true, "minimumSystemVersion": "10.13"}
string
| null
The application’s publisher. Defaults to the second element in the identifier string.
Currently maps to the Manufacturer property of the Windows Installer and the Maintainer field of debian packages if the Cargo.toml does not have the authors field.
BundleResources
| null
App resources to bundle. Each resource is a path to a file or directory. Glob patterns are supported.
string
| null
A short description of your application.
The bundle targets, currently supports [“deb”, “rpm”, “appimage”, “nsis”, “msi”, “app”, “dmg”] or “all”.
Default: "all"
boolean
Whether to use the project’s target
directory, for caching build tools (e.g., Wix and NSIS) when building this application. Defaults to false
.
If true, tools will be cached in target/.tauri/
.
If false, tools will be cached in the current user’s platform-specific cache directory.
An example where it can be appropriate to set this to true
is when building this application as a Windows System user (e.g., AWS EC2 workloads),
because the Window system’s app data directory is restricted.
Configuration for the Windows bundles.
{ "allowDowngrades": true, "certificateThumbprint": null, "digestAlgorithm": null, "nsis": null, "signCommand": null, "timestampUrl": null, "tsp": false, "webviewInstallMode": { "silent": true, "type": "downloadBootstrapper" }, "wix": null}
Any of the following:
string
[] A list of paths to include.- A map of source to target paths. Allows additional properties:
string
Definition for bundle resources. Can be either a list of paths to include or a map of source to target paths.
Any of the following:
"all"
Bundle all targets.BundleType
[] A list of bundle targets.BundleType
A single bundle target.
Targets to bundle. Each value is case insensitive.
One of the following:
"deb"
The debian bundle (.deb)."rpm"
The RPM bundle (.rpm)."appimage"
The AppImage bundle (.appimage)."msi"
The Microsoft Installer bundle (.msi)."nsis"
The NSIS bundle (.exe)."app"
The macOS application bundle (.app)."dmg"
The Apple Disk Image bundle (.dmg).
A bundle referenced by tauri-bundler.
One of the following:
"Editor"
CFBundleTypeRole.Editor. Files can be read and edited."Viewer"
CFBundleTypeRole.Viewer. Files can be read."Shell"
CFBundleTypeRole.Shell"QLGenerator"
CFBundleTypeRole.QLGenerator"None"
CFBundleTypeRole.None
macOS-only. Corresponds to CFBundleTypeRole
A grouping and boundary mechanism developers can use to isolate access to the IPC layer.
It controls application windows’ and webviews’ fine grained access to the Tauri core, application, or plugin commands. If a webview or its window is not matching any capability then it has no access to the IPC layer at all.
This can be done to create groups of windows, based on their required system access, which can reduce
impact of frontend vulnerabilities in less privileged windows.
Windows can be added to a capability by exact name (e.g. main-window
) or glob patterns like *
or admin-*
.
A Window can have none, one, or multiple associated capabilities.
{ "identifier": "main-user-files-write", "description": "This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programmatic access to files selected by the user.", "windows": [ "main" ], "permissions": [ "core:default", "dialog:open", { "identifier": "fs:allow-write-text-file", "allow": [{ "path": "$HOME/test.txt" }] }, ], "platforms": ["macOS","windows"]}
Object Properties:
- description
- identifier (required)
- local
- permissions (required)
- platforms
- remote
- webviews
- windows
string
Description of what the capability is intended to allow on associated windows.
It should contain a description of what the grouped permissions should allow.
This capability allows the main
window access to filesystem
write related
commands and dialog
commands to enable programmatic access to files selected by the user.
string
Identifier of the capability.
main-user-files-write
boolean
Whether this capability is enabled for local app URLs or not. Defaults to true
.
Default: true
PermissionEntry
[] each item must be unique
List of permissions attached to this capability.
Must include the plugin name as prefix in the form of ${plugin-name}:${permission-name}
.
For commands directly implemented in the application itself only ${permission-name}
is required.
[ "core:default", "shell:allow-open", "dialog:open", { "identifier": "fs:allow-write-text-file", "allow": [{ "path": "$HOME/test.txt" }] }]
Target
[] | null
Limit which target platforms this capability applies to.
By default all platforms are targeted.
["macOS","windows"]
CapabilityRemote
| null
Configure remote URLs that can use the capability permissions.
This setting is optional and defaults to not being set, as our default use case is that the content is served from our local application.
{ "urls": ["https://*.mydomain.dev"]}
string
[]
List of webviews that are affected by this capability. Can be a glob pattern.
The capability will be enabled on all the webviews
whose label matches any of the patterns in this list,
regardless of whether the webview’s window label matches a pattern in [Self::windows
].
["sub-webview-one", "sub-webview-two"]
string
[]
List of windows that are affected by this capability. Can be a glob pattern.
If a window label matches any of the patterns in this list,
the capability will be enabled on all the webviews of that window,
regardless of the value of [Self::webviews
].
On multiwebview windows, prefer specifying [Self::webviews
] and omitting [Self::windows
]
for a fine grained access control.
["main"]
Any of the following:
Capability
An inlined capability.string
Reference to a capability identifier.
A capability entry which can be either an inlined capability or a reference to a capability defined on its own file.
Configuration for remote URLs that are associated with the capability.
Object Properties:
- urls (required)
string
[]
Remote domains this capability refers to using the URLPattern standard.
- “https://*.mydomain.dev”: allows subdomains of mydomain.dev
- “https://mydomain.dev/api/*”: allows any subpath of mydomain.dev/api
Any of the following:
string
pattern of^#?([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$
Color hex string, for example: #fff, #ffffff, or #ffffffff.integer
formatted asuint8
|integer
formatted asuint8
|integer
formatted asuint8
[] maximum of3
items, minimum of3
items Array of RGB colors. Each value has minimum of 0 and maximum of 255.integer
formatted asuint8
|integer
formatted asuint8
|integer
formatted asuint8
|integer
formatted asuint8
[] maximum of4
items, minimum of4
items Array of RGBA colors. Each value has minimum of 0 and maximum of 255.- Object of red, green, blue, alpha color values. Each value has minimum of 0 and maximum of 255. Object Properties: - alpha - blue (required) - green (required) - red (required) ##### alpha
integer
formatted asuint8
Default:255
##### blueinteger
formatted asuint8
##### greeninteger
formatted asuint8
##### redinteger
formatted asuint8
Any of the following:
string
The entire CSP policy in a single text string.- An object mapping a directive with its sources values as a list of strings. Allows additional properties:
CspDirectiveSources
A Content-Security-Policy definition. See <https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP>.
Any of the following:
string
An inline list of CSP sources. Same as [Self::List
], but concatenated with a space separator.string
[] A list of CSP sources. The collection will be concatenated with a space separator for the CSP string.
A Content-Security-Policy directive source list. See <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/Sources#sources>.
Any of the following:
string
A string notation of the script to execute. “%1” will be replaced with the path to the binary to be signed. This is a simpler notation for the command. Tauri will split the string with' '
and use the first element as the command name and the rest as arguments. If you need to use whitespace in the command or arguments, use the object notation [Self::ScriptWithOptions
].- An object notation of the command. This is more complex notation for the command but this allows you to use whitespace in the command and arguments. Object Properties: - args (required) - cmd (required) ##### args
string
[] The arguments to pass to the command. “%1” will be replaced with the path to the binary to be signed. ##### cmdstring
The command to run to sign the binary.
Custom Signing Command configuration.
Configuration for Debian (.deb) bundles.
See more: <https://v2.tauri.app/reference/config/#debconfig>
Object Properties:
- changelog
- conflicts
- depends
- desktopTemplate
- files
- postInstallScript
- postRemoveScript
- preInstallScript
- preRemoveScript
- priority
- provides
- recommends
- replaces
- section
string
| null
Path of the uncompressed Changelog file, to be stored at /usr/share/doc/package-name/changelog.gz. See <https://www.debian.org/doc/debian-policy/ch-docs.html#changelog-files-and-release-notes>
string
[] | null
The list of package conflicts.
string
[] | null
The list of deb dependencies your application relies on.
string
| null
Path to a custom desktop file Handlebars template.
Available variables: categories
, comment
(optional), exec
, icon
and name
.
The files to include on the package.
Allows additional properties: string
Default: {}
string
| null
Path to script that will be executed after the package is unpacked. See <https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html>
string
| null
Path to script that will be executed after the package is removed. See <https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html>
string
| null
Path to script that will be executed before the package is unpacked. See <https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html>
string
| null
Path to script that will be executed before the package is removed. See <https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html>
string
| null
Change the priority of the Debian Package. By default, it is set to optional
.
Recognized Priorities as of now are : required
, important
, standard
, optional
, extra
string
[] | null
The list of dependencies the package provides.
string
[] | null
The list of deb dependencies your application recommends.
string
[] | null
The list of package replaces.
string
| null
Define the section in Debian Control file. See : https://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections
Any of the following:
boolean
Iftrue
, disables all CSP modification.false
is the default value and it configures Tauri to control the CSP.string
[] Disables the given list of CSP directives modifications.
The possible values for the dangerous_disable_asset_csp_modification
config option.
Configuration for Apple Disk Image (.dmg) bundles.
See more: <https://v2.tauri.app/reference/config/#dmgconfig>
Object Properties:
- applicationFolderPosition
- appPosition
- background
- windowPosition
- windowSize
Position of application folder on window.
{ "x": 480, "y": 170}
Position of app file on window.
{ "x": 180, "y": 170}
string
| null
Image to use as the background in dmg file. Accepted formats: png
/jpg
/gif
.
Position
| null
Position of volume window on screen.
Size of volume window.
{ "height": 400, "width": 660}
File association
Object Properties:
- description
- ext (required)
- mimeType
- name
- rank
- role
string
| null
The association description. Windows-only. It is displayed on the Type
column on Windows Explorer.
File extensions to associate with this app. e.g. ‘png’
string
| null
The mime-type e.g. ‘image/png’ or ‘text/plain’. Linux-only.
string
| null
The name. Maps to CFBundleTypeName
on macOS. Default to ext[0]
The ranking of this app among apps that declare themselves as editors or viewers of the given file type. Maps to LSHandlerRank
on macOS.
Default: "Default"
The app’s role with respect to the type. Maps to CFBundleTypeRole
on macOS.
Default: "Editor"
Any of the following:
string
formatted asuri
An external URL that should be used as the default application URL.string
Path to a directory containing the frontend dist assets.string
[] An array of files to embed on the app.
Defines the URL or assets to embed in the application.
Any of the following:
string
[] A list of paths that are allowed by this scope.- A complete scope configuration. Object Properties: - allow - deny - requireLiteralLeadingDot ##### allow
string
[] A list of paths that are allowed by this scope. Default:[]
##### denystring
[] A list of paths that are not allowed by this scope. This gets precedence over the [Self::Scope::allow
] list. Default:[]
##### requireLiteralLeadingDotboolean
|null
Whether or not paths that contain components that start with a.
will require that.
appears literally in the pattern;*
,?
,**
, or[...]
will not match. This is useful because such files are conventionally considered hidden on Unix systems and it might be desirable to skip them when listing files. Defaults totrue
on Unix systems andfalse
on Windows
Protocol scope definition. It is a list of glob patterns that restrict the API access from the webview.
Each pattern can start with a variable that resolves to a system base directory.
The variables are: $AUDIO
, $CACHE
, $CONFIG
, $DATA
, $LOCALDATA
, $DESKTOP
,
$DOCUMENT
, $DOWNLOAD
, $EXE
, $FONT
, $HOME
, $PICTURE
, $PUBLIC
, $RUNTIME
,
$TEMPLATE
, $VIDEO
, $RESOURCE
, $APP
, $LOG
, $TEMP
, $APPCONFIG
, $APPDATA
,
$APPLOCALDATA
, $APPCACHE
, $APPLOG
.
One of the following:
"Default"
LSHandlerRank.Default. This app is an opener of files of this type; this value is also used if no rank is specified."Owner"
LSHandlerRank.Owner. This app is the primary creator of files of this type."Alternate"
LSHandlerRank.Alternate. This app is a secondary viewer of files of this type."None"
LSHandlerRank.None. This app is never selected to open files of this type, but it accepts drops of files of this type.
Corresponds to LSHandlerRank
A struct, where the keys are some specific http header names.
If the values to those keys are defined, then they will be send as part of a response message. This does not include error messages and ipc messages
{ //.. app:{ //.. security: { headers: { "Cross-Origin-Opener-Policy": "same-origin", "Cross-Origin-Embedder-Policy": "require-corp", "Timing-Allow-Origin": [ "https://developer.mozilla.org", "https://example.com", ], "Access-Control-Expose-Headers": "Tauri-Custom-Header", "Tauri-Custom-Header": { "key1": "'value1' 'value2'", "key2": "'value3'" } }, csp: "default-src 'self'; connect-src ipc: http://ipc.localhost", } //.. } //..}
In this example Cross-Origin-Opener-Policy
and Cross-Origin-Embedder-Policy
are set to allow for the use of SharedArrayBuffer
.
The result is, that those headers are then set on every response sent via the get_response
function in crates/tauri/src/protocol/tauri.rs.
The Content-Security-Policy header is defined separately, because it is also handled separately.
For the helloworld example, this config translates into those response headers:
access-control-allow-origin: http://tauri.localhostaccess-control-expose-headers: Tauri-Custom-Headercontent-security-policy: default-src 'self'; connect-src ipc: http://ipc.localhost; script-src 'self' 'sha256-Wjjrs6qinmnr+tOry8x8PPwI77eGpUFR3EEGZktjJNs='content-type: text/htmlcross-origin-embedder-policy: require-corpcross-origin-opener-policy: same-origintauri-custom-header: key1 'value1' 'value2'; key2 'value3'timing-allow-origin: https://developer.mozilla.org, https://example.com
Since the resulting header values are always ‘string-like’. So depending on the what data type the HeaderSource is, they need to be converted.
String
(JS/Rust): stay the same for the resulting header valueArray
(JS)/Vec\<String\>
(Rust): Item are joined by ”, ” for the resulting header valueObject
(JS)/Hashmap\<String,String\>
(Rust): Items are composed from: key + space + value. Item are then joined by ”; ” for the resulting header value
Object Properties:
- Access-Control-Allow-Credentials
- Access-Control-Allow-Headers
- Access-Control-Allow-Methods
- Access-Control-Expose-Headers
- Access-Control-Max-Age
- Cross-Origin-Embedder-Policy
- Cross-Origin-Opener-Policy
- Cross-Origin-Resource-Policy
- Permissions-Policy
- Service-Worker-Allowed
- Tauri-Custom-Header
- Timing-Allow-Origin
- X-Content-Type-Options
HeaderSource
| null
The Access-Control-Allow-Credentials response header tells browsers whether the server allows cross-origin HTTP requests to include credentials.
See <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials>
HeaderSource
| null
The Access-Control-Allow-Headers response header is used in response to a preflight request which includes the Access-Control-Request-Headers to indicate which HTTP headers can be used during the actual request.
This header is required if the request has an Access-Control-Request-Headers header.
See <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers>
HeaderSource
| null
The Access-Control-Allow-Methods response header specifies one or more methods allowed when accessing a resource in response to a preflight request.
See <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods>
HeaderSource
| null
The Access-Control-Expose-Headers response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request.
See <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers>
HeaderSource
| null
The Access-Control-Max-Age response header indicates how long the results of a preflight request (that is the information contained in the Access-Control-Allow-Methods and Access-Control-Allow-Headers headers) can be cached.
See <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age>
HeaderSource
| null
The HTTP Cross-Origin-Embedder-Policy (COEP) response header configures embedding cross-origin resources into the document.
See <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy>
HeaderSource
| null
The HTTP Cross-Origin-Opener-Policy (COOP) response header allows you to ensure a top-level document does not share a browsing context group with cross-origin documents. COOP will process-isolate your document and potential attackers can’t access your global object if they were to open it in a popup, preventing a set of cross-origin attacks dubbed XS-Leaks.
See <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy>
HeaderSource
| null
The HTTP Cross-Origin-Resource-Policy response header conveys a desire that the browser blocks no-cors cross-origin/cross-site requests to the given resource.
See <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Resource-Policy>
HeaderSource
| null
The HTTP Permissions-Policy header provides a mechanism to allow and deny the use of browser features in a document or within any <iframe> elements in the document.
See <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permissions-Policy>
HeaderSource
| null
The HTTP Service-Worker-Allowed response header is used to broaden the path restriction for a service worker’s default scope.
By default, the scope for a service worker registration is the directory where the service
worker script is located. For example, if the script sw.js
is located in /js/sw.js
,
it can only control URLs under /js/
by default. Servers can use the Service-Worker-Allowed
header to allow a service worker to control URLs outside of its own directory.
See <https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Service-Worker-Allowed>
HeaderSource
| null
A custom header field Tauri-Custom-Header, don’t use it. Remember to set Access-Control-Expose-Headers accordingly
NOT INTENDED FOR PRODUCTION USE
HeaderSource
| null
The Timing-Allow-Origin response header specifies origins that are allowed to see values of attributes retrieved via features of the Resource Timing API, which would otherwise be reported as zero due to cross-origin restrictions.
See <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Timing-Allow-Origin>
HeaderSource
| null
The X-Content-Type-Options response HTTP header is a marker used by the server to indicate that the MIME types advertised in the Content-Type headers should be followed and not be changed. The header allows you to avoid MIME type sniffing by saying that the MIME types are deliberately configured.
See <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options>
Any of the following:
string
string version of the header Valuestring
[] list version of the header value. Item are joined by ”,” for the real header value- (Rust struct | Json | JavaScript Object) equivalent of the header value. Items are composed from: key + space + value. Item are then joined by ”;” for the real header value Allows additional properties:
string
definition of a header source
The header value to a header name
Any of the following:
string
Run the given script with the default options.- Run the given script with custom options. Object Properties: - cwd - script (required) ##### cwd
string
|null
The current working directory. ##### scriptstring
The script to execute.
Describes a shell command to be executed when a CLI hook is triggered.
string
General configuration for the iOS target.
Object Properties:
- bundleVersion
- developmentTeam
- frameworks
- minimumSystemVersion
- template
string
| null
The version of the build that identifies an iteration of the bundle.
Translates to the bundle’s CFBundleVersion property.
string
| null
The development team. This value is required for iOS development because code signing is enforced.
The APPLE_DEVELOPMENT_TEAM
environment variable can be set to overwrite it.
string
[] | null
A list of strings indicating any iOS frameworks that need to be bundled with the application.
Note that you need to recreate the iOS project for the changes to be applied.
string
A version string indicating the minimum iOS version that the bundled application supports. Defaults to 13.0
.
Maps to the IPHONEOS_DEPLOYMENT_TARGET value.
Default: "13.0"
string
| null
A custom XcodeGen project.yml template to use.
Configuration for Linux bundles.
See more: <https://v2.tauri.app/reference/config/#linuxconfig>
Object Properties:
- appimage
- deb
- rpm
Configuration for the AppImage bundle.
{ "bundleMediaFramework": false, "files": {}}
Configuration for the Debian bundle.
{ "files": {}}
Configuration for the RPM bundle.
{ "epoch": 0, "files": {}, "release": "1"}
Position coordinates struct.
Object Properties:
- x (required)
- y (required)
number
formatted as double
X coordinate.
number
formatted as double
Y coordinate.
Configuration for the macOS bundles.
See more: <https://v2.tauri.app/reference/config/#macconfig>
Object Properties:
- bundleName
- bundleVersion
- dmg
- entitlements
- exceptionDomain
- files
- frameworks
- hardenedRuntime
- minimumSystemVersion
- providerShortName
- signingIdentity
string
| null
The name of the builder that built the bundle.
Translates to the bundle’s CFBundleName property.
If not set, defaults to the package’s product name.
string
| null
The version of the build that identifies an iteration of the bundle.
Translates to the bundle’s CFBundleVersion property.
DMG-specific settings.
{ "appPosition": { "x": 180, "y": 170 }, "applicationFolderPosition": { "x": 480, "y": 170 }, "windowSize": { "height": 400, "width": 660 }}
string
| null
Path to the entitlements file.
string
| null
Allows your application to communicate with the outside world. It should be a lowercase, without port and protocol domain name.
The files to include in the application relative to the Contents directory.
Allows additional properties: string
Default: {}
string
[] | null
A list of strings indicating any macOS X frameworks that need to be bundled with the application.
If a name is used, “.framework” must be omitted and it will look for standard install locations. You may also use a path to a specific framework.
boolean
Whether the codesign should enable hardened runtime (for executables) or not.
Default: true
string
| null
A version string indicating the minimum macOS X version that the bundled application supports. Defaults to 10.13
.
Setting it to null
completely removes the LSMinimumSystemVersion
field on the bundle’s Info.plist
and the MACOSX_DEPLOYMENT_TARGET
environment variable.
An empty string is considered an invalid value so the default value is used.
Default: "10.13"
string
| null
Provider short name for notarization.
string
| null
Identity to use for code signing.
One of the following:
"zlib"
ZLIB uses the deflate algorithm, it is a quick and simple method. With the default compression level it uses about 300 KB of memory."bzip2"
BZIP2 usually gives better compression ratios than ZLIB, but it is a bit slower and uses more memory. With the default compression level it uses about 4 MB of memory."lzma"
LZMA (default) is a new compression method that gives very good compression ratios. The decompression speed is high (10-20 MB/s on a 2 GHz CPU), the compression speed is lower. The memory size that will be used for decompression is the dictionary size plus a few KBs, the default is 8 MB."none"
Disable compression
Compression algorithms used in the NSIS installer.
See <https://nsis.sourceforge.io/Reference/SetCompressor>
Configuration for the Installer bundle using NSIS.
Object Properties:
- compression
- customLanguageFiles
- displayLanguageSelector
- headerImage
- installerHooks
- installerIcon
- installMode
- languages
- minimumWebview2Version
- sidebarImage
- startMenuFolder
- template
Set the compression algorithm used to compress files in the installer.
See <https://nsis.sourceforge.io/Reference/SetCompressor>
Default: "lzma"
| null
A key-value pair where the key is the language and the
value is the path to a custom .nsh
file that holds the translated text for tauri’s custom messages.
See <https://github.com/tauri-apps/tauri/blob/dev/crates/tauri-bundler/src/bundle/windows/nsis/languages/English.nsh> for an example .nsh
file.
Note: the key must be a valid NSIS language and it must be added to [NsisConfig
] languages array,
Allows additional properties: string
boolean
Whether to display a language selector dialog before the installer and uninstaller windows are rendered or not.
By default the OS language is selected, with a fallback to the first language in the languages
array.
string
| null
The path to a bitmap file to display on the header of installers pages.
The recommended dimensions are 150px x 57px.
string
| null
A path to a .nsh
file that contains special NSIS macros to be hooked into the
main installer.nsi script.
Supported hooks are:
NSIS_HOOK_PREINSTALL
: This hook runs before copying files, setting registry key values and creating shortcuts.NSIS_HOOK_POSTINSTALL
: This hook runs after the installer has finished copying all files, setting the registry keys and created shortcuts.NSIS_HOOK_PREUNINSTALL
: This hook runs before removing any files, registry keys and shortcuts.NSIS_HOOK_POSTUNINSTALL
: This hook runs after files, registry keys and shortcuts have been removed.
!macro NSIS_HOOK_PREINSTALL MessageBox MB_OK "PreInstall"!macroend
!macro NSIS_HOOK_POSTINSTALL MessageBox MB_OK "PostInstall"!macroend
!macro NSIS_HOOK_PREUNINSTALL MessageBox MB_OK "PreUnInstall"!macroend
!macro NSIS_HOOK_POSTUNINSTALL MessageBox MB_OK "PostUninstall"!macroend
string
| null
The path to an icon file used as the installer icon.
Whether the installation will be for all users or just the current user.
Default: "currentUser"
string
[] | null
A list of installer languages.
By default the OS language is used. If the OS language is not in the list of languages, the first language will be used.
To allow the user to select the language, set display_language_selector
to true
.
See <https://github.com/kichik/nsis/tree/9465c08046f00ccb6eda985abbdbf52c275c6c4d/Contrib/Language%20files> for the complete list of languages.
string
| null
Try to ensure that the WebView2 version is equal to or newer than this version, if the user’s WebView2 is older than this version, the installer will try to trigger a WebView2 update.
string
| null
The path to a bitmap file for the Welcome page and the Finish page.
The recommended dimensions are 164px x 314px.
string
| null
Set the folder name for the start menu shortcut.
Use this option if you have multiple apps and wish to group their shortcuts under one folder or if you generally prefer to set your shortcut inside a folder.
Examples:
AwesomePublisher
, shortcut will be placed in%AppData%\Microsoft\Windows\Start Menu\Programs\AwesomePublisher\<your-app>.lnk
- If unset, shortcut will be placed in
%AppData%\Microsoft\Windows\Start Menu\Programs\<your-app>.lnk
string
| null
A custom .nsi template to use.
One of the following:
"currentUser"
Default mode for the installer. Install the app by default in a directory that doesn’t require Administrator access. Installer metadata will be saved under theHKCU
registry path."perMachine"
Install the app by default in theProgram Files
folder directory requires Administrator access for the installation. Installer metadata will be saved under theHKLM
registry path."both"
Combines both modes and allows the user to choose at install time whether to install for the current user or per machine. Note that this mode will require Administrator access even if the user wants to install it for the current user only. Installer metadata will be saved under theHKLM
orHKCU
registry path based on the user’s choice.
Install Modes for the NSIS installer.
Any of the following:
integer
formatted asint64
Represents an [i64
].number
formatted asdouble
Represents a [f64
].
A valid ACL number.
One of the following:
- Brownfield pattern. Object Properties: - use (required) ##### use
"brownfield"
- Isolation pattern. Recommended for security purposes. Object Properties: - options (required) - use (required) ##### options Object Properties: - dir (required) ###### dir
string
The dir containing the index.html file that contains the secure isolation application. ##### use"isolation"
The application pattern.
Any of the following:
Identifier
Reference a permission or permission set by identifier.- Reference a permission or permission set by identifier and extends its scope. Object Properties: - allow - deny - identifier (required) ##### allow
Value
[] |null
Data that defines what is allowed by the scope. ##### denyValue
[] |null
Data that defines what is denied by the scope. This should be prioritized by validation logic. ##### identifierIdentifier
Identifier of the permission or permission set.
An entry for a permission value in a [Capability
] can be either a raw permission [Identifier
]
or an object that references a permission and extends its scope.
The plugin configs holds a HashMap mapping a plugin name to its configuration object.
See more: <https://v2.tauri.app/reference/config/#pluginconfig>
Allows additional properties: true
Position coordinates struct.
Object Properties:
- x (required)
- y (required)
integer
formatted as uint32
X coordinate.
integer
formatted as uint32
Y coordinate.
Any of the following:
boolean
Enable prevent overflow or notPreventOverflowMargin
Enable prevent overflow with a margin so that the window’s size + this margin won’t overflow the workarea
Prevent overflow with a margin
Enable prevent overflow with a margin so that the window’s size + this margin won’t overflow the workarea
Object Properties:
- height (required)
- width (required)
integer
formatted as uint32
Vertical margin in physical unit
integer
formatted as uint32
Horizontal margin in physical unit
One of the following:
- Gzip compression Object Properties: - level (required) - type (required) ##### level
integer
formatted asuint32
Gzip compression level ##### type"gzip"
- Zstd compression Object Properties: - level (required) - type (required) ##### level
integer
formatted asint32
Zstd compression level ##### type"zstd"
- Xz compression Object Properties: - level (required) - type (required) ##### level
integer
formatted asuint32
Xz compression level ##### type"xz"
- Bzip2 compression Object Properties: - level (required) - type (required) ##### level
integer
formatted asuint32
Bzip2 compression level ##### type"bzip2"
- Disable compression Object Properties: - type (required) ##### type
"none"
Compression algorithms used when bundling RPM packages.
Configuration for RPM bundles.
Object Properties:
- compression
- conflicts
- depends
- desktopTemplate
- epoch
- files
- obsoletes
- postInstallScript
- postRemoveScript
- preInstallScript
- preRemoveScript
- provides
- recommends
- release
RpmCompression
| null
Compression algorithm and level. Defaults to Gzip
with level 6.
string
[] | null
The list of RPM dependencies your application conflicts with. They must not be present in order for the package to be installed.
string
[] | null
The list of RPM dependencies your application relies on.
string
| null
Path to a custom desktop file Handlebars template.
Available variables: categories
, comment
(optional), exec
, icon
and name
.
integer
formatted as uint32
The RPM epoch.
The files to include on the package.
Allows additional properties: string
Default: {}
string
[] | null
The list of RPM dependencies your application supersedes - if this package is installed, packages listed as “obsoletes” will be automatically removed (if they are present).
string
| null
Path to script that will be executed after the package is unpacked. See <http://ftp.rpm.org/max-rpm/s1-rpm-inside-scripts.html>
string
| null
Path to script that will be executed after the package is removed. See <http://ftp.rpm.org/max-rpm/s1-rpm-inside-scripts.html>
string
| null
Path to script that will be executed before the package is unpacked. See <http://ftp.rpm.org/max-rpm/s1-rpm-inside-scripts.html>
string
| null
Path to script that will be executed before the package is removed. See <http://ftp.rpm.org/max-rpm/s1-rpm-inside-scripts.html>
string
[] | null
The list of RPM dependencies your application provides.
string
[] | null
The list of RPM dependencies your application recommends.
string
The RPM release tag.
Default: "1"
Security configuration.
See more: <https://v2.tauri.app/reference/config/#securityconfig>
Object Properties:
- assetProtocol
- capabilities
- csp
- dangerousDisableAssetCspModification
- devCsp
- freezePrototype
- headers
- pattern
Custom protocol config.
{ "enable": false, "scope": []}
List of capabilities that are enabled on the application.
If the list is empty, all capabilities are included.
Default: []
Csp
| null
The Content Security Policy that will be injected on all HTML files on the built application.
If dev_csp
is not specified, this value is also injected on dev.
This is a really important part of the configuration since it helps you ensure your WebView is secured. See <https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP>.
Disables the Tauri-injected CSP sources.
At compile time, Tauri parses all the frontend assets and changes the Content-Security-Policy to only allow loading of your own scripts and styles by injecting nonce and hash sources. This stricts your CSP, which may introduce issues when using along with other flexing sources.
This configuration option allows both a boolean and a list of strings as value. A boolean instructs Tauri to disable the injection for all CSP injections, and a list of strings indicates the CSP directives that Tauri cannot inject.
WARNING: Only disable this if you know what you are doing and have properly configured the CSP. Your application might be vulnerable to XSS attacks without this Tauri protection.
Csp
| null
The Content Security Policy that will be injected on all HTML files on development.
This is a really important part of the configuration since it helps you ensure your WebView is secured. See <https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP>.
boolean
Freeze the Object.prototype
when using the custom protocol.
HeaderConfig
| null
The headers, which are added to every http response from tauri to the web view This doesn’t include IPC Messages and error responses
The pattern to use.
{ "use": "brownfield"}
Size of the window.
Object Properties:
- height (required)
- width (required)
integer
formatted as uint32
Height of the window.
integer
formatted as uint32
Width of the window.
One of the following:
"macOS"
MacOS."windows"
Windows."linux"
Linux."android"
Android."iOS"
iOS.
Platform target.
One of the following:
"Light"
Light theme."Dark"
Dark theme.
System theme.
One of the following:
"Visible"
A normal title bar."Transparent"
Makes the title bar transparent, so the window background color is shown instead. Useful if you don’t need to have actual HTML under the title bar. This lets you avoid the caveats of usingTitleBarStyle::Overlay
. Will be more useful when Tauri lets you set a custom window background color."Overlay"
Shows the title bar as a transparent overlay over the window’s content. Keep in mind: - The height of the title bar is different on different OS versions, which can lead to window the controls and title not being where you don’t expect. - You need to define a custom drag region to make your window draggable, however due to a limitation you can’t drag the window when it’s not in focus <https://github.com/tauri-apps/tauri/issues/4316>. - The color of the window title depends on the system theme.
How the window title bar should be displayed on macOS.
Configuration for application tray icon.
See more: <https://v2.tauri.app/reference/config/#trayiconconfig>
Object Properties:
- iconAsTemplate
- iconPath (required)
- id
- menuOnLeftClick
- showMenuOnLeftClick
- title
- tooltip
boolean
A Boolean value that determines whether the image represents a template image on macOS.
string
Path to the default icon to use for the tray icon.
Note: this stores the image in raw pixels to the final binary, so keep the icon size (width and height) small or else it’s going to bloat your final executable
string
| null
Set an id for this tray icon so you can reference it later, defaults to main
.
boolean
A Boolean value that determines whether the menu should appear when the tray icon receives a left click.
- Linux: Unsupported.
Default: true
boolean
A Boolean value that determines whether the menu should appear when the tray icon receives a left click.
- Linux: Unsupported.
Default: true
string
| null
Title for MacOS tray
string
| null
Tray icon tooltip on Windows and macOS
Any of the following:
V1Compatible
Generates legacy zipped v1 compatible updatersboolean
Produce updaters and their signatures or not
Updater type
"v1Compatible"
,Generates legacy zipped v1 compatible updaters
Generates legacy zipped v1 compatible updaters
Any of the following:
null
Represents a null JSON value.boolean
Represents a [bool
].Number
Represents a valid ACL [Number
].string
Represents a [String
].Value
[] Represents a list of other [Value
]s.- Represents a map of [
String
] keys to [Value
]s. Allows additional properties:Value
All supported ACL values.
One of the following:
- Do not install the Webview2 as part of the Windows Installer. Object Properties: - type (required) ##### type
"skip"
- Download the bootstrapper and run it. Requires an internet connection. Results in a smaller installer size, but is not recommended on Windows 7. Object Properties: - silent - type (required) ##### silent
boolean
Instructs the installer to run the bootstrapper in silent mode. Defaults totrue
. Default:true
##### type"downloadBootstrapper"
- Embed the bootstrapper and run it. Requires an internet connection. Increases the installer size by around 1.8MB, but offers better support on Windows 7. Object Properties: - silent - type (required) ##### silent
boolean
Instructs the installer to run the bootstrapper in silent mode. Defaults totrue
. Default:true
##### type"embedBootstrapper"
- Embed the offline installer and run it. Does not require an internet connection. Increases the installer size by around 127MB. Object Properties: - silent - type (required) ##### silent
boolean
Instructs the installer to run the installer in silent mode. Defaults totrue
. Default:true
##### type"offlineInstaller"
- Embed a fixed webview2 version and use it at runtime. Increases the installer size by around 180MB. Object Properties: - path (required) - type (required) ##### path
string
The path to the fixed runtime to use. The fixed version can be downloaded on the official website. The.cab
file must be extracted to a folder and this folder path must be defined on this field. ##### type"fixedRuntime"
Install modes for the Webview2 runtime.
Note that for the updater bundle [Self::DownloadBootstrapper
] is used.
For more information see <https://v2.tauri.app/distribute/windows-installer/#webview2-installation-options>.
Any of the following:
string
formatted asuri
An external URL. Must use either thehttp
orhttps
schemes.string
The path portion of an app URL. For instance, to loadtauri://localhost/users/john
, you can simply provideusers/john
in this configuration.string
formatted asuri
A custom protocol url, for example,doom://index.html
An URL to open on a Tauri webview window.
The window configuration object.
See more: <https://v2.tauri.app/reference/config/#windowconfig>
Object Properties:
- acceptFirstMouse
- additionalBrowserArgs
- allowLinkPreview
- alwaysOnBottom
- alwaysOnTop
- backgroundColor
- backgroundThrottling
- browserExtensionsEnabled
- center
- closable
- contentProtected
- create
- decorations
- devtools
- disableInputAccessoryView
- dragDropEnabled
- focus
- fullscreen
- height
- hiddenTitle
- incognito
- javascriptDisabled
- label
- maxHeight
- maximizable
- maximized
- maxWidth
- minHeight
- minimizable
- minWidth
- parent
- preventOverflow
- proxyUrl
- resizable
- shadow
- skipTaskbar
- tabbingIdentifier
- theme
- title
- titleBarStyle
- trafficLightPosition
- transparent
- url
- useHttpsScheme
- userAgent
- visible
- visibleOnAllWorkspaces
- width
- windowClassname
- windowEffects
- x
- y
- zoomHotkeysEnabled
boolean
Whether clicking an inactive window also clicks through to the webview on macOS.
string
| null
Defines additional browser arguments on Windows. By default wry passes --disable-features=msWebOOUI,msPdfOOUI,msSmartScreenProtection
so if you use this method, you also need to disable these components by yourself if you want.
boolean
on macOS and iOS there is a link preview on long pressing links, this is enabled by default. see https://docs.rs/objc2-web-kit/latest/objc2_web_kit/struct.WKWebView.html#method.allowsLinkPreview
Default: true
boolean
Whether the window should always be below other windows.
boolean
Whether the window should always be on top of other windows.
Color
| null
Set the window and webview background color.
- Windows: alpha channel is ignored for the window layer.
- Windows: On Windows 7, alpha channel is ignored for the webview layer.
- Windows: On Windows 8 and newer, if alpha channel is not
0
, it will be ignored for the webview layer.
BackgroundThrottlingPolicy
| null
Change the default background throttling behaviour.
By default, browsers use a suspend policy that will throttle timers and even unload the whole tab (view) to free resources after roughly 5 minutes when a view became minimized or hidden. This will pause all tasks until the documents visibility state changes back from hidden to visible by bringing the view back to the foreground.
- Linux / Windows / Android: Unsupported. Workarounds like a pending WebLock transaction might suffice.
- iOS: Supported since version 17.0+.
- macOS: Supported since version 14.0+.
see https://github.com/tauri-apps/tauri/issues/5250#issuecomment-2569380578
boolean
Whether browser extensions can be installed for the webview process
- Windows: Enables the WebView2 environment’s
AreBrowserExtensionsEnabled
- MacOS / Linux / iOS / Android - Unsupported.
boolean
Whether or not the window starts centered or not.
boolean
Whether the window’s native close button is enabled or not.
- Linux: “GTK+ will do its best to convince the window manager not to show a close button. Depending on the system, this function may not have any effect when called on a window that is already visible”
- iOS / Android: Unsupported.
Default: true
boolean
Prevents the window contents from being captured by other apps.
boolean
Whether Tauri should create this window at app startup or not.
When this is set to false
you must manually grab the config object via app.config().app.windows
and create it with WebviewWindowBuilder::from_config
.
Default: true
boolean
Whether the window should have borders and bars.
Default: true
boolean
| null
Enable web inspector which is usually called browser devtools. Enabled by default.
This API works in debug builds, but requires devtools
feature flag to enable it in release builds.
- macOS: This will call private functions on macOS.
- Android: Open
chrome://inspect/#devices
in Chrome to get the devtools window. Wry’sWebView
devtools API isn’t supported on Android. - iOS: Open Safari > Develop > [Your Device Name] > [Your WebView] to get the devtools window.
boolean
Allows disabling the input accessory view on iOS.
The accessory view is the view that appears above the keyboard when a text input element is focused. It usually displays a view with “Done”, “Next” buttons.
boolean
Whether the drag and drop is enabled or not on the webview. By default it is enabled.
Disabling it is required to use HTML5 drag and drop on the frontend on Windows.
Default: true
boolean
Whether the window will be initially focused or not.
Default: true
boolean
Whether the window starts as fullscreen or not.
number
formatted as double
The window height.
Default: 600
boolean
If true
, sets the window title to be hidden on macOS.
boolean
Whether or not the webview should be launched in incognito mode.
- Android: Unsupported.
boolean
Whether we should disable JavaScript code execution on the webview or not.
string
The window identifier. It must be alphanumeric.
Default: "main"
number
| null
formatted as double
The max window height.
boolean
Whether the window’s native maximize button is enabled or not. If resizable is set to false, this setting is ignored.
- macOS: Disables the “zoom” button in the window titlebar, which is also used to enter fullscreen mode.
- Linux / iOS / Android: Unsupported.
Default: true
boolean
Whether the window is maximized or not.
number
| null
formatted as double
The max window width.
number
| null
formatted as double
The min window height.
boolean
Whether the window’s native minimize button is enabled or not.
- Linux / iOS / Android: Unsupported.
Default: true
number
| null
formatted as double
The min window width.
string
| null
Sets the window associated with this label to be the parent of the window to be created.
- Windows: This sets the passed parent as an owner window to the window to be created.
From MSDN owned windows docs:
- An owned window is always above its owner in the z-order.
- The system automatically destroys an owned window when its owner is destroyed.
- An owned window is hidden when its owner is minimized.
- Linux: This makes the new window transient for parent, see <https://docs.gtk.org/gtk3/method.Window.set_transient_for.html>
- macOS: This adds the window as a child of parent, see <https://developer.apple.com/documentation/appkit/nswindow/1419152-addchildwindow?language=objc>
PreventOverflowConfig
| null
Whether or not to prevent the window from overflowing the workarea
- iOS / Android: Unsupported.
string
| null
formatted as uri
The proxy URL for the WebView for all network requests.
Must be either a http://
or a socks5://
URL.
- macOS: Requires the
macos-proxy
feature flag and only compiles for macOS 14+.
boolean
Whether the window is resizable or not. When resizable is set to false, native window’s maximize button is automatically disabled.
Default: true
boolean
Whether or not the window has shadow.
- Windows:
false
has no effect on decorated window, shadow are always ON.true
will make undecorated window have a 1px white border, and on Windows 11, it will have a rounded corners.
- Linux: Unsupported.
Default: true
boolean
If true
, hides the window icon from the taskbar on Windows and Linux.
string
| null
Defines the window tabbing identifier for macOS.
Windows with matching tabbing identifiers will be grouped together. If the tabbing identifier is not set, automatic tabbing will be disabled.
Theme
| null
The initial window theme. Defaults to the system theme. Only implemented on Windows and macOS 10.14+.
string
The window title.
Default: "Tauri App"
The style of the macOS title bar.
Default: "Visible"
LogicalPosition
| null
The position of the window controls on macOS.
Requires titleBarStyle: Overlay and decorations: true.
boolean
Whether the window is transparent or not.
Note that on macOS
this requires the macos-private-api
feature flag, enabled under tauri > macOSPrivateApi
.
WARNING: Using private APIs on macOS
prevents your application from being accepted to the App Store
.
The window webview URL.
Default: "index.html"
boolean
Sets whether the custom protocols should use https://<scheme>.localhost
instead of the default http://<scheme>.localhost
on Windows and Android. Defaults to false
.
Using a https
scheme will NOT allow mixed content when trying to fetch http
endpoints and therefore will not match the behavior of the <scheme>://localhost
protocols used on macOS and Linux.
Changing this value between releases will change the IndexedDB, cookies and localstorage location and your app will not be able to access the old data.
string
| null
The user agent for the webview
boolean
Whether the window is visible or not.
Default: true
boolean
Whether the window should be visible on all workspaces or virtual desktops.
- Windows / iOS / Android: Unsupported.
number
formatted as double
The window width.
Default: 800
string
| null
The name of the window class created on Windows to create the window. Windows only.
WindowEffectsConfig
| null
Window effects.
Requires the window to be transparent.
- Windows: If using decorations or shadows, you may want to try this workaround <https://github.com/tauri-apps/tao/issues/72#issuecomment-975607891>
- Linux: Unsupported
number
| null
formatted as double
The horizontal position of the window’s top left corner
number
| null
formatted as double
The vertical position of the window’s top left corner
boolean
Whether page zooming by hotkeys is enabled
-
Windows: Controls WebView2’s
IsZoomControlEnabled
setting. -
MacOS / Linux: Injects a polyfill that zooms in and out with
ctrl/command
+-/=
, 20% in each step, ranging from 20% to 1000%. Requireswebview:allow-set-webview-zoom
permission -
Android / iOS: Unsupported.
One of the following:
"appearanceBased"
A default material appropriate for the view’s effectiveAppearance. macOS 10.14-"light"
macOS 10.14-"dark"
macOS 10.14-"mediumLight"
macOS 10.14-"ultraDark"
macOS 10.14-"titlebar"
macOS 10.10+"selection"
macOS 10.10+"menu"
macOS 10.11+"popover"
macOS 10.11+"sidebar"
macOS 10.11+"headerView"
macOS 10.14+"sheet"
macOS 10.14+"windowBackground"
macOS 10.14+"hudWindow"
macOS 10.14+"fullScreenUI"
macOS 10.14+"tooltip"
macOS 10.14+"contentBackground"
macOS 10.14+"underWindowBackground"
macOS 10.14+"underPageBackground"
macOS 10.14+"mica"
Mica effect that matches the system dark perefence Windows 11 Only"micaDark"
Mica effect with dark mode but only if dark mode is enabled on the system Windows 11 Only"micaLight"
Mica effect with light mode Windows 11 Only"tabbed"
Tabbed effect that matches the system dark perefence Windows 11 Only"tabbedDark"
Tabbed effect with dark mode but only if dark mode is enabled on the system Windows 11 Only"tabbedLight"
Tabbed effect with light mode Windows 11 Only"blur"
Windows 7/10/11(22H1) Only ##### Notes This effect has bad performance when resizing/dragging the window on Windows 11 build 22621."acrylic"
Windows 10/11 Only ##### Notes This effect has bad performance when resizing/dragging the window on Windows 10 v1903+ and Windows 11 build 22000.
Platform-specific window effects
The window effects configuration object
Object Properties:
- color
- effects (required)
- radius
- state
Color
| null
Window effect color. Affects [WindowEffect::Blur
] and [WindowEffect::Acrylic
] only
on Windows 10 v1903+. Doesn’t have any effect on Windows 7 or Windows 11.
List of Window effects to apply to the Window. Conflicting effects will apply the first one and ignore the rest.
number
| null
formatted as double
Window effect corner radius macOS Only
WindowEffectState
| null
Window effect state macOS Only
One of the following:
"followsWindowActiveState"
Make window effect state follow the window’s active state"active"
Make window effect state always active"inactive"
Make window effect state always inactive
Window effect state macOS only
<https://developer.apple.com/documentation/appkit/nsvisualeffectview/state>
Windows bundler configuration.
See more: <https://v2.tauri.app/reference/config/#windowsconfig>
Object Properties:
- allowDowngrades
- certificateThumbprint
- digestAlgorithm
- nsis
- signCommand
- timestampUrl
- tsp
- webviewInstallMode
- wix
boolean
Validates a second app installation, blocking the user from installing an older version if set to false
.
For instance, if 1.2.1
is installed, the user won’t be able to install app version 1.2.0
or 1.1.5
.
The default value of this flag is true
.
Default: true
string
| null
Specifies the SHA1 hash of the signing certificate.
string
| null
Specifies the file digest algorithm to use for creating file signatures. Required for code signing. SHA-256 is recommended.
NsisConfig
| null
Configuration for the installer generated with NSIS.
CustomSignCommandConfig
| null
Specify a custom command to sign the binaries.
This command needs to have a %1
in args which is just a placeholder for the binary path,
which we will detect and replace before calling the command.
By Default we use signtool.exe
which can be found only on Windows so
if you are on another platform and want to cross-compile and sign you will
need to use another tool like osslsigncode
.
string
| null
Server to use during timestamping.
boolean
Whether to use Time-Stamp Protocol (TSP, a.k.a. RFC 3161) for the timestamp server. Your code signing provider may use a TSP timestamp server, like e.g. SSL.com does. If so, enable TSP by setting to true.
The installation mode for the Webview2 runtime.
{ "silent": true, "type": "downloadBootstrapper"}
WixConfig
| null
Configuration for the MSI generated with WiX.
Configuration for the MSI bundle using WiX.
See more: <https://v2.tauri.app/reference/config/#wixconfig>
Object Properties:
- bannerPath
- componentGroupRefs
- componentRefs
- dialogImagePath
- enableElevatedUpdateTask
- featureGroupRefs
- featureRefs
- fragmentPaths
- language
- mergeRefs
- template
- upgradeCode
- version
string
| null
Path to a bitmap file to use as the installation user interface banner. This bitmap will appear at the top of all but the first page of the installer.
The required dimensions are 493px × 58px.
string
[]
The ComponentGroup element ids you want to reference from the fragments.
Default: []
string
[]
The Component element ids you want to reference from the fragments.
Default: []
string
| null
Path to a bitmap file to use on the installation user interface dialogs. It is used on the welcome and completion dialogs.
The required dimensions are 493px × 312px.
boolean
Create an elevated update task within Windows Task Scheduler.
string
[]
The FeatureGroup element ids you want to reference from the fragments.
Default: []
string
[]
The Feature element ids you want to reference from the fragments.
Default: []
string
[]
A list of paths to .wxs files with WiX fragments to use.
Default: []
The installer languages to build. See <https://docs.microsoft.com/en-us/windows/win32/msi/localizing-the-error-and-actiontext-tables>.
Default: "en-US"
string
[]
The Merge element ids you want to reference from the fragments.
Default: []
string
| null
A custom .wxs template to use.
string
| null
formatted as uuid
A GUID upgrade code for MSI installer. This code must stay the same across all of your updates, otherwise, Windows will treat your update as a different app and your users will have duplicate versions of your app.
By default, tauri generates this code by generating a Uuid v5 using the string <productName>.exe.app.x64
in the DNS namespace.
You can use Tauri’s CLI to generate and print this code for you, run tauri inspect wix-upgrade-code
.
It is recommended that you set this value in your tauri config file to avoid accidental changes in your upgrade code whenever you want to change your product name.
string
| null
MSI installer version in the format major.minor.patch.build
(build is optional).
Because a valid version is required for MSI installer, it will be derived from [Config::version
] if this field is not set.
The first field is the major version and has a maximum value of 255. The second field is the minor version and has a maximum value of 255. The third and foruth fields have a maximum value of 65,535.
See <https://learn.microsoft.com/en-us/windows/win32/msi/productversion> for more info.
Any of the following:
string
A single language to build, without configuration.string
[] A list of languages to build, without configuration.- A map of languages and its configuration. Allows additional properties:
WixLanguageConfig
The languages to build using WiX.
Configuration for a target language for the WiX build.
See more: <https://v2.tauri.app/reference/config/#wixlanguageconfig>
Object Properties:
- localePath
string
| null
The path to a locale (.wxl
) file. See <https://wixtoolset.org/documentation/manual/v3/howtos/ui_and_localization/build_a_localized_version.html>.
© 2025 Tauri Contributors. CC-BY / MIT