Builder struct lets you configure tauri-plugin-configurate before it is registered with Tauri. Use it to set a custom file-size cap, restrict which BaseDirectory values IPC payloads may reference, or open that restriction entirely. If you do not need any customization, the init() shorthand registers the plugin with all defaults.
Initializing the plugin
You have two ways to register the plugin withtauri::Builder.
Simple initialization — uses every default setting and is the most common choice:
.build() to override specific defaults:
init() is exactly equivalent to Builder::default().build(). Prefer init() when you have nothing to customize — it is shorter and signals intent clearly.Builder methods
Builder::default() / Builder::new()
Creates a new builder pre-loaded with the following defaults:
| Setting | Default value |
|---|---|
max_read_bytes | 16_777_216 (16 MiB) |
allowed_base_dirs | App-scoped directories only (see Default allowed directories) |
Builder::new() delegates to Builder::default().
.max_read_bytes(bytes: usize) -> Self
Maximum number of bytes the plugin will read from a single config file or import content string. Must be greater than zero.
16_777_216 bytes). Raise this if your app legitimately works with large configs; lower it for tighter memory constraints.
tauri.conf.json takes precedence. When plugins.configurate.maxReadBytes is set in your Tauri config file, that value overrides whatever you pass to .max_read_bytes() at runtime. See tauri.conf.json configuration below.
.allowed_base_directories(dirs) -> Self
An iterable of
tauri::path::BaseDirectory variants that IPC payloads are permitted to use. Replaces the default allowlist entirely.BaseDirectory allowlist with your own set. Any IPC request that references a directory not in this list is rejected by the plugin before touching the filesystem.
Use this method when your application genuinely needs access to a directory outside the app-scoped defaults — for example, Document for user-facing export paths — but you still want to keep the allowlist explicit rather than unrestricted.
.allow_any_base_directory() -> Self
Disables BaseDirectory validation entirely. After calling this method, IPC payloads may reference any BaseDirectory variant without restriction.
.build() -> TauriPlugin
Consumes the builder and returns the configured TauriPlugin instance ready to pass to .plugin(). Call this as the final step of every builder chain.
Default allowed directories
When you useBuilder::default(), Builder::new(), or init(), the plugin restricts IPC baseDir values to the following app-scoped and system temporary directories:
BaseDirectory variant | Typical resolved path |
|---|---|
AppConfig | Platform app config folder |
AppData | Platform app data folder |
AppLocalData | Platform app local-data folder |
AppCache | Platform app cache folder |
AppLog | Platform app log folder |
Resource | Tauri resource directory (bundled assets) |
Temp | System temporary directory |
Home, Desktop, or Download — is rejected with an error describing which directories are permitted. Use .allowed_base_directories() or .allow_any_base_directory() on the builder to expand access.
tauri.conf.json configuration
You can set maxReadBytes in your Tauri project’s tauri.conf.json file under the plugins.configurate key:
.max_read_bytes() in the Rust builder. This makes it straightforward to tune the limit for different build profiles (for example, a CI environment config that keeps the limit low) without changing source code.
The BaseDirectory allowlist is not configurable through tauri.conf.json — use the builder methods for that.