Lightweight SDK for connecting Vue Query to custom DevTools extensions.
npm install console-vue-query-devtools-sdkA lightweight dev-only SDK for visualizing Vue Query cache in Vue 2.7 projects where official Vue Query Devtools are not available.
> π« The official @tanstack/vue-query-devtools only supports Vue 3.x and Vite-based projects.
> β
This SDK enables cache inspection in Vue 2.7 environments by bridging your app with a custom Chrome DevTools panel.
---
- π Automatically detects and registers the active QueryClient
- π» No UI β the SDK exposes a component that runs in the background
- π§ͺ Dev-only β safe to include in production builds (no effect outside NODE_ENV=development)
- π Optional client prop β manually test a custom QueryClient if needed
---
``bash`
npm install console-vue-query-devtools-sdk --save-devor
pnpm add -D console-vue-query-devtools-sdk
---
`vue
`
> π‘ Thatβs it! The component automatically registers the active QueryClient using useQueryClient().
2. [Optional] Manually provide a QueryClient:
`vue
``
> π§ͺ Useful for testing multiple clients or using isolated instances.
---
The SDK registers the provided (or detected) QueryClient to window.__VUE_QUERY_DEVTOOLS__, enabling Chrome extensions to read:
- query keys
- observer counts
- cache state
- garbage collection time
A postMessage() loop in the injected script transfers the data to your DevTools extension.
---
---
This SDK is automatically excluded in production environments.
- process.env.NODE_ENV or import.meta.env.MODE are used for environment checks
- No runtime logic will run in non-dev builds
---
---
MIT