sync-ephemeral

Installation
SKILL.md

Sync Ephemeral

TTL-scoped typed key/value store where all entries must have a time-to-live. Server version uses Redis, browser version runs entirely in-memory. Ideal for presence, sessions, and temporary state.

Typical Pattern: Snapshot + Stream

snapshot() → hydrate local state → reader({ after: cursor }).stream() → apply incremental events

On overflow event (cursor fell behind retention window), re-snapshot and restart the stream.

Decision Guide

  • Create/update entry: upsert({ key, value }) — resets TTL.
  • Extend TTL without changing value: touch({ key }) — returns { ok: false } if key missing.
  • Explicit removal: remove({ key, reason? }) — emits delete event.
  • Multi-tenant: pass tenantId on factory or per-operation override.
Related skills

More from valentinkolb/sync

Installs
9
First Seen
Mar 4, 2026