---
title: Data and secrets
description: Where Polyflo stores settings, clipboard history, and the Sarvam API key — and what never goes to disk.
url: https://pr-1-2b0a782aae90.thally.app/data-and-secrets
---

# Data and secrets

Where Polyflo stores settings, clipboard history, and the Sarvam API key — and what never goes to disk.

Polyflo has no account and no remote database. Three local stores matter.

## App data directory

Tauri `path().app_data_dir()` for identifier `com.polyflo.app`:

| OS | Typical path |
| --- | --- |
| Windows | `%APPDATA%\com.polyflo.app\` |
| macOS | `~/Library/Application Support/com.polyflo.app/` |

Files:

| File | Contents |
| --- | --- |
| `settings.json` | `{ "hotkey": "Ctrl+Shift+Space", "dictationMode": "native" }` |
| `history.json` | Array of `{ id, text, timestamp, mode }`, max **50**, newest first |

Invalid JSON loads as defaults (empty history / default settings) rather than crashing.

`id` is currently `now_millis()` as a string — collisions are possible if two entries land in the same millisecond.

## Settings defaults

[`config.rs`](https://github.com/Crisiswastaken/PolyFlo/blob/main/src-tauri/src/config.rs):

- Hotkey: `Cmd+Shift+Space` on macOS, `Ctrl+Shift+Space` otherwise
- Mode: `native` (Transcribe)

`DictationMode` serializes `snake_case`: `native` | `english`. The struct uses `camelCase` for `hotkey` / `dictationMode`.

## API key

[`secrets.rs`](https://github.com/Crisiswastaken/PolyFlo/blob/main/src-tauri/src/secrets.rs) lookup order:

1. Environment `SARVAM_API_KEY` (non-empty)
2. OS keyring service **`polyflo`**, user **`sarvam`**, target `com.polyflo.app/sarvam-api-key`
3. Legacy service **`voice-dictation`** — copied to `polyflo` then deleted

`keyring` features: `windows-native`, `apple-native` (Windows Credential Manager / macOS Keychain). v1.0.2 fixed Windows persistence by enabling that backend.

`set_api_key` writes then **reads back** the same entry. If the round-trip mismatches, Settings shows a save error.

`clear_api_key` deletes the credential; `NoEntry` is success.

> **Note:**
  `.env` is gitignored. `.env.example` has a placeholder only. Release installers should not rely on env vars — users enter the key in Settings.

The key is sent to `api.sarvam.ai` as `api-subscription-key`. It is not sent anywhere else.

## What is not stored

- Microphone audio (RAM only for the session)
- Sarvam responses beyond the transcript string in history
- Window geometry
- Analytics / crash dumps (none shipped)

## Debugging stores

Close Polyflo first, then inspect `settings.json` / `history.json`. Deleting them resets UI prefs and clipboard history; it does **not** remove the keyring secret.

To reset the key on Windows: Credential Manager → Windows Credentials → look for `polyflo` / `com.polyflo.app`. On macOS: Keychain Access → search `polyflo` or `sarvam`.