Targ Apps Docs
Chroma-Fs

Configuration

chroma-fs.json schema — backend selection, IndexedDB names, and filesystem base paths.

Chroma-Fs reads chroma-fs.json at the app root. chroma fs init creates it with defaults for the app mode, and the templates include it.

The Chroma linter and VS Code extension validate this file against chroma-fs.schema.json.

Schema

{
  "storage": {
    "backend": "indexeddb",
    "basePath": "./data",
    "indexedDb": {
      "dbName": "chroma-fs",
      "storeName": "files"
    }
  }
}

storage.backend

ValueWhen to use
indexeddbBrowser-only apps, static template default
filesystemChroma Desktop, dynamic template default on desktop

If omitted, Chroma-Fs picks automatically:

  • Browser (top-level window, no Tauri) → indexeddb
  • Desktop (Tauri globals, or the app runs inside a Chroma Desktop <iframe>) → filesystem

When backend is filesystem and the app runs in an iframe, Chroma-Fs uses the postMessage bridge to the Chroma Desktop shell (no __TAURI__ required in the iframe). Top-level Tauri hosts use @tauri-apps/plugin-fs directly.

storage.basePath

Filesystem backend only. Relative path under the per-app data directory on desktop (<app-data>/apps/<id>/data/). Default: ./data.

storage.indexedDb

FieldDefaultDescription
dbNamechroma-fsIndexedDB database name
storeNamefilesObject store name

Template defaults

Static mode (chroma fs init):

{
  "storage": {
    "backend": "indexeddb",
    "indexedDb": {
      "dbName": "chroma-fs",
      "storeName": "files"
    }
  }
}

Dynamic mode (chroma fs init):

{
  "storage": {
    "backend": "filesystem",
    "basePath": "./data"
  }
}

Build output

chroma build copies chroma-fs.json into dist/ when present so packaged apps load config at runtime.

CLI

chroma fs init    # create chroma-fs.json with defaults for the app mode

See CLI for the other chroma fs subcommands.

On this page