Overview
Kweri ships a built-in DevTools panel — a floating DOM overlay that shows:- Live cache entries with their status, data, and timestamps
- Observer counts per query key
- In-flight (pending) requests
- A structured event log
NODE_ENV, BUN_ENV, VITE_MODE, and VERCEL_ENV — if any indicates production, the panel is a no-op.
Enabling DevTools
SetenableDevTools: true in KweriOptions:
document.body when the Kweri instance is created.
MountKweriDevToolsOptions
Manual mounting
You can also mount DevTools manually usingmountKweriDevTools, which returns an unmount function:
DevTools features
Queries tab
Shows all cache entries. For each entry:- Key — the serialized query key (
METHOD:path:params) - Status —
idle,loading,success, orerrorwith color coding - Data — prettified JSON of the cached value
- Age — how long since
updatedAt - Observers — number of active subscribers
- Actions — invalidate or remove individual entries
Logs tab
A chronological event log showing:- Fetch start / complete / error events
- Cache hits and invalidations
- Mutation lifecycle events
localStorage.
DevTools snapshot
If you’re building custom tooling (browser extension, CI reporter, etc.),getDevToolsSnapshot() returns a point-in-time view of the cache:
Production build
DevTools are compiled into the bundle but guarded by runtime environment checks. They add minimal overhead in production (a singleif that short-circuits immediately).
If bundle size is critical, you can tree-shake DevTools by not calling enableDevTools or mountKweriDevTools in your production entry point.