Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

devtoolsoptions.md

143 lines3.3 KB

1---
2id: DevtoolsOptions
3title: DevtoolsOptions
4---
5​
6# Interface: DevtoolsOptions
7​
8Options for configuring the TanStack Query devtools.
9​
10## Properties
11​
12### buttonPosition?
13​
14```ts
15optional buttonPosition: DevtoolsButtonPosition;
16```
17​
18The position of the TanStack logo to open and close the devtools panel.
19`top-left` | `top-right` | `bottom-left` | `bottom-right` | `relative`
20Defaults to `bottom-right`.
21​
22#### Defined in
23​
24[providers.ts:192](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L192)
25​
26---
27​
28### client?
29​
30```ts
31optional client: QueryClient;
32```
33​
34Custom instance of QueryClient
35​
36#### Defined in
37​
38[providers.ts:202](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L202)
39​
40---
41​
42### errorTypes?
43​
44```ts
45optional errorTypes: DevtoolsErrorType[];
46```
47​
48Use this so you can define custom errors that can be shown in the devtools.
49​
50#### Defined in
51​
52[providers.ts:206](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L206)
53​
54---
55​
56### initialIsOpen?
57​
58```ts
59optional initialIsOpen: boolean;
60```
61​
62Set this true if you want the devtools to default to being open
63​
64#### Defined in
65​
66[providers.ts:186](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L186)
67​
68---
69​
70### loadDevtools?
71​
72```ts
73optional loadDevtools: boolean | "auto";
74```
75​
76Whether the developer tools should load.
77​
78- `auto`- (Default) Lazily loads devtools when in development mode. Skips loading in production mode.
79- `true`- Always load the devtools, regardless of the environment.
80- `false`- Never load the devtools, regardless of the environment.
81​
82You can use `true` and `false` to override loading developer tools from an environment file.
83For example, a test environment might run in production mode but you may want to load developer tools.
84​
85Additionally, you can use a signal in the callback to dynamically load the devtools based on a condition. For example,
86a signal created from a RxJS observable that listens for a keyboard shortcut.
87​
88**Example**
89​
90```ts
91withDevtools(() => ({
92 initialIsOpen: true,
93 loadDevtools: inject(ExampleService).loadDevtools(),
94}))
95```
96​
97#### Defined in
98​
99[providers.ts:236](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L236)
100​
101---
102​
103### position?
104​
105```ts
106optional position: DevtoolsPosition;
107```
108​
109The position of the TanStack Query devtools panel.
110`top` | `bottom` | `left` | `right`
111Defaults to `bottom`.
112​
113#### Defined in
114​
115[providers.ts:198](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L198)
116​
117---
118​
119### shadowDOMTarget?
120​
121```ts
122optional shadowDOMTarget: ShadowRoot;
123```
124​
125Use this so you can attach the devtool's styles to a specific element in the DOM.
126​
127#### Defined in
128​
129[providers.ts:214](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L214)
130​
131---
132​
133### styleNonce?
134​
135```ts
136optional styleNonce: string;
137```
138​
139Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.
140​
141#### Defined in
142​
143[providers.ts:210](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L210)