> ## Documentation Index
> Fetch the complete documentation index at: https://configurate.crystaworld.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Install tauri-plugin-configurate in Your Tauri App

> Add the Rust crate and npm package to your Tauri v2 project, register the plugin, and configure Tauri permissions to start managing configuration.

Getting `tauri-plugin-configurate` into your project takes four steps: add the Rust crate, add the JavaScript package, register the plugin in your Tauri builder, and grant the required IPC permissions. The optional fifth step covers advanced plugin configuration through the builder API.

<Steps>
  ### Check Prerequisites

  Before you install, make sure your environment meets the minimum requirements:

  * **Rust ≥ 1.85.0** — the plugin uses language features that require this minimum toolchain version. Run `rustup update stable` if you need to upgrade.
  * **An existing Tauri v2 project** — the plugin targets Tauri v2 only and is not compatible with Tauri v1.

  ### Add the Rust Crate

  Open `src-tauri/Cargo.toml` and add `tauri-plugin-configurate` under `[dependencies]`:

  ```toml theme={null}
  # src-tauri/Cargo.toml
  [dependencies]
  tauri-plugin-configurate = "0.5.0"
  ```

  If you prefer to track the latest unreleased commits directly from the repository, use the Git source instead:

  ```toml theme={null}
  # src-tauri/Cargo.toml
  [dependencies]
  tauri-plugin-configurate = { git = "https://github.com/Crysta1221/tauri-plugin-configurate" }
  ```

  ### Install the JavaScript Package

  Install the guest bindings with your preferred package manager:

  <CodeGroup>
    ```bash pnpm theme={null}
    pnpm add tauri-plugin-configurate-api
    ```

    ```bash npm theme={null}
    npm add tauri-plugin-configurate-api
    ```

    ```bash yarn theme={null}
    yarn add tauri-plugin-configurate-api
    ```

    ```bash bun theme={null}
    bun add tauri-plugin-configurate-api
    ```
  </CodeGroup>

  <Tip>
    You can skip the two separate install commands above by running `tauri add configurate` from your project root. The Tauri CLI installs both the Rust crate and the npm package for you in one step.
  </Tip>

  ### Register the Plugin

  In `src-tauri/src/lib.rs`, call `tauri_plugin_configurate::init()` inside your Tauri builder chain:

  ```rust theme={null}
  // src-tauri/src/lib.rs
  fn main() {
      tauri::Builder::default()
          .plugin(tauri_plugin_configurate::init())
          .run(tauri::generate_context!())
          .expect("error while running tauri application");
  }
  ```

  ### Grant Permissions

  Tauri's capability system gates every IPC call. Open (or create) `src-tauri/capabilities/default.json` and add the plugin's default permission set:

  ```json theme={null}
  {
    "permissions": ["configurate:default"]
  }
  ```

  <Warning>
    The `configurate:allow-unlock` permission is **not** included in `configurate:default`. If you use `.unlock()` or `loadAll().unlock()` to retrieve secrets from the OS keyring, you must grant it explicitly:

    ```json theme={null}
    {
      "permissions": [
        "configurate:default",
        "configurate:allow-unlock"
      ]
    }
    ```

    Omitting this permission causes keyring unlock calls to fail at runtime with an IPC authorization error.
  </Warning>

  ### (Optional) Advanced Builder Configuration

  The default plugin limits config file reads and import content to **16 MiB**. You can raise or lower this limit using either the Rust builder or `tauri.conf.json`. When both are set, `tauri.conf.json` takes precedence.

  **Rust** (`src-tauri/src/lib.rs`):

  ```rust theme={null}
  // src-tauri/src/lib.rs
  fn main() {
      tauri::Builder::default()
          .plugin(
              tauri_plugin_configurate::Builder::default()
                  .max_read_bytes(32 * 1024 * 1024) // 32 MiB
                  .build(),
          )
          .run(tauri::generate_context!())
          .expect("error while running tauri application");
  }
  ```

  **`tauri.conf.json`:**

  ```json theme={null}
  {
    "plugins": {
      "configurate": {
        "maxReadBytes": 33554432
      }
    }
  }
  ```
</Steps>

## What's Next

With the plugin installed and permissions granted, you're ready to define your first config schema and start reading and writing settings.

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Define a schema, create a config file, and load it back in a few lines of TypeScript.
  </Card>

  <Card title="Providers" icon="database" href="/concepts/providers">
    Learn the differences between JSON, YAML, TOML, and encrypted Binary providers and when to use each.
  </Card>
</CardGroup>
