A KV-backed RateLimitStore — the production durable counter @suluk/hono's enforceRateLimit needs (its
MemoryRateLimitStore is DEV-only; it doesn't coordinate across Workers isolates). Fixed-window counter in a
Workers KV namespace, fail-OPEN to a fallback store on any KV blip so a KV outage never hard-blocks traffic.
Structurally typed (no @suluk/hono dependency — the consume contract is tiny + stable), so the returned store
plugs straight into enforceRateLimit({ store }). The KV binding is resolved LAZILY (a getter) because on Workers
the binding isn't available at module-init — capture it on first request.
A KV-backed RateLimitStore — the production durable counter @suluk/hono's
enforceRateLimitneeds (its MemoryRateLimitStore is DEV-only; it doesn't coordinate across Workers isolates). Fixed-window counter in a Workers KV namespace, fail-OPEN to a fallback store on any KV blip so a KV outage never hard-blocks traffic.Structurally typed (no @suluk/hono dependency — the consume contract is tiny + stable), so the returned store plugs straight into enforceRateLimit({ store }). The KV binding is resolved LAZILY (a getter) because on Workers the binding isn't available at module-init — capture it on first request.