docs/framework/svelte/devtools.md
For Chrome, Firefox, and Edge users: Third-party browser extensions are available for debugging TanStack Query directly in browser DevTools. These provide the same functionality as the framework-specific devtools packages:
The devtools are a separate package that you need to install:
npm i @tanstack/svelte-query-devtools
or
pnpm add @tanstack/svelte-query-devtools
or
yarn add @tanstack/svelte-query-devtools
or
bun add @tanstack/svelte-query-devtools
You can import the devtools like this:
import { SvelteQueryDevtools } from '@tanstack/svelte-query-devtools'
Floating Mode will mount the devtools as a fixed, floating element in your app and provide a toggle in the corner of the screen to show and hide the devtools. This toggle state will be stored and remembered in localStorage across reloads.
Place the following code as high in your Svelte app as you can. The closer it is to the root of the page, the better it will work!
<script>
import { QueryClientProvider } from '@tanstack/svelte-query'
import { SvelteQueryDevtools } from '@tanstack/svelte-query-devtools'
</script>
<QueryClientProvider client={queryClient}>
<SvelteQueryDevtools />
</QueryClientProvider>
initialIsOpen: boolean
true if you want the dev tools to default to being openbuttonPosition?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | "relative"
bottom-rightrelative, the button is placed in the location that you render the devtools.position?: "top" | "bottom" | "left" | "right"
bottomclient?: QueryClient,
errorTypes?: { name: string; initializer: (query: Query) => TError}
styleNonce?: string
shadowDOMTarget?: ShadowRoot