---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/storage/opfs/interfaces/OpfsSpoolStoreOptions.md
description: 'Constructor options for [`OpfsSpoolStore`](https://adk.nht.io/api/@nhtio/adk/batteries/storage/opfs/classes/OpfsSpoolStore).'
---

# Interface: OpfsSpoolStoreOptions

Defined in: [batteries/storage/opfs/index.ts:370](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/batteries/storage/opfs/index.ts#L370)

Constructor options for [OpfsSpoolStore](../classes/OpfsSpoolStore.md).

## Properties

| Property                                                           | Type                                                               | Default value               | Description                                                                                                                                                                                                                                                                                                                                                                                                                           | Defined in                                                                                                                      |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|  `directory?`                       | () => `Promise`<[`OpfsDirectoryHandle`](OpfsDirectoryHandle.md)> | `undefined`                 | Optional thunk that resolves the [OpfsDirectoryHandle](OpfsDirectoryHandle.md) used as the store root. **Remarks** When omitted, the store resolves the root via `navigator.storage.getDirectory()` on its first filesystem call. Override for tests (to point at a per-suite subdirectory) or to scope the store to a nested directory inside OPFS. The thunk is invoked at most once per store; the returned handle is memoised.    | [batteries/storage/opfs/index.ts:381](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/batteries/storage/opfs/index.ts#L381) |
|  `keyPrefix?`                       | `string`                                                           | `""`                        | Optional filename prefix prepended to every `callId`. **Remarks** Prefix is a **filename prefix**, not a subdirectory — `keyPrefix: 'agent-runs/'` produces a file literally named `agent-runs/<callId>` at the root, not a nested directory. (OPFS filenames may not contain `/`, so use a non-`/` separator like `-` if you want a flat namespace.) This mirrors the `keyPrefix` semantics in the flydrive and in-memory batteries. | [batteries/storage/opfs/index.ts:394](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/batteries/storage/opfs/index.ts#L394) |
|  `streamThresholdBytes?` | `number`                                                           | `10 * 1024 * 1024` (10 MiB) | Default `streamThresholdBytes` for readers produced by `write()` and `read()`. Individual calls may override via their own `opts` argument.                                                                                                                                                                                                                                                                                           | [batteries/storage/opfs/index.ts:402](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/batteries/storage/opfs/index.ts#L402) |
