custom-storage-adapter

Installation
SKILL.md

Write a custom storage adapter

The core ships three backends: memory (default), file, and sqlite (via @eleven-labs/nest-profiler/sqlite). Reach for a custom adapter when profiles must live elsewhere — Redis, Postgres/Mongo, S3 — typically to share profiles across instances, or to persist where the local disk does not (ephemeral/serverless filesystems, or across a redeploy that wipes the volume). Note: file and sqlite already survive a plain process restart on a box with a persistent disk — a custom adapter is only warranted when there is no such disk or the store must be shared/remote. Confirm the core is set up first (setup-nest-profiler).

The contract — IProfilerStorageAdapter

Required methods: save(profile), findAll(), findOne(token), clear().

Important optionals:

  • crossProcess (boolean) — set true for shared stores (Redis, DB, file). The commander/CLI profiler uses it to warn when command profiles land in a process-local store where the web UI can't see them. Omitted means "assume shared".
  • query(query) — run the dashboard's structured list query (section + filters + sort + pagination) natively so a list render never loads every profile. Implement this for any store that can filter/paginate efficiently. When omitted, the service falls back to findAll + in-memory filtering (correct, not scalable).
  • distinct(field, typeIn?) — distinct summary values for dynamic filter select options; falls back to deriving from findAll.
  • setIndexAttributesProvider(provider) — called once at startup before the first save; needed if you persist a ProfileSummary for native query/distinct (to populate kind-specific summary.attributes).
  • close() — release handles on shutdown (DB connection, file locks). Implement it for any native handle.

Wire it via the storage option

storage takes precedence over storageType. Build the adapter (usually async, from ConfigService) and pass the instance:

Installs
4
GitHub Stars
15
First Seen
Jul 16, 2026
custom-storage-adapter — eleven-labs/nest-profiler