What is Kweri?
Kweri is a lightweight, framework-agnostic API client built around a stale-while-revalidate caching strategy. It gives you the ergonomics of TanStack Query without locking you into any specific framework — the sameKweri instance works in React, Vue, plain JavaScript, Node.js, and edge runtimes.
At its core, Kweri manages three things:
- Fetching — deduplicating concurrent requests for the same query
- Caching — storing responses with configurable freshness and lifetime
- Subscriptions — notifying any number of observers when cached data changes
Key features
Type-safe endpoints
Define endpoints once with TypeBox schemas. Parameter and response types are inferred automatically — no codegen needed for custom endpoints.
Smart caching
Stale-while-revalidate with per-instance
staleTime and cacheTime. Fresh data is served instantly; stale data is background-refetched.Request deduplication
Concurrent requests for the same query share a single in-flight promise. No duplicate network calls, ever.
Framework agnostic
Works with React (
useSyncExternalStore), Vue (reactivity primitives), or raw subscriptions. One instance, any UI layer.OpenAPI codegen
Run
kweri-gen against any OpenAPI spec and get fully-typed client code and an EndpointByMethod map ready for path-based hooks.Built-in DevTools
A floating DOM overlay shows the live cache, observer counts, in-flight requests, and a structured event log. Auto-disabled in production.
How it compares
Kweri is intentionally narrow in scope. It handles server state — fetching, caching, and synchronising remote data — not local UI state.| Feature | Kweri | TanStack Query | SWR |
|---|---|---|---|
| Framework agnostic core | ✅ | ✅ | ✅ |
| TypeBox schema validation | ✅ | ❌ | ❌ |
| OpenAPI codegen | ✅ | ❌ | ❌ |
| Stale-while-revalidate | ✅ | ✅ | ✅ |
| Built-in devtools | ✅ | ✅ | ❌ |
| Bundle size | Small | Medium | Small |