You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/openapi-ts/clients/axios.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ When we installed the client above, it created a [`client.gen.ts`](/openapi-ts/o
64
64
65
65
### `setConfig()`
66
66
67
-
This is the simpler approach. You can call the `setConfig()` method at the beginning of your application or anytime you need to update the client configuration. You can pass any Axios configuration option to `setConfig()` (except for `auth`), and even your own Axios implementation.
67
+
This is the simpler approach. You can call the `setConfig()` method at the beginning of your application or anytime you need to update the client configuration. You can pass any Axios configuration option to `setConfig()` (except for `auth`), and even your own [Axios](#custom-axios) implementation.
You can implement your own `axios` instance. This is useful if you need to extend the default `axios` instance with extra functionality, or replace it altogether.
212
+
213
+
```js
214
+
import { client } from'client/client.gen';
215
+
216
+
client.setConfig({
217
+
axios: () => {
218
+
/* custom `axios` instance */
219
+
},
220
+
});
221
+
```
222
+
223
+
You can use any of the approaches mentioned in [Configuration](#configuration), depending on how granular you want your custom instance to be.
Copy file name to clipboardExpand all lines: docs/openapi-ts/clients/fetch.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,7 @@ When we installed the client above, it created a [`client.gen.ts`](/openapi-ts/o
70
70
71
71
### `setConfig()`
72
72
73
-
This is the simpler approach. You can call the `setConfig()` method at the beginning of your application or anytime you need to update the client configuration. You can pass any Fetch API configuration option to `setConfig()`, and even your own Fetch implementation.
73
+
This is the simpler approach. You can call the `setConfig()` method at the beginning of your application or anytime you need to update the client configuration. You can pass any Fetch API configuration option to `setConfig()`, and even your own [Fetch](#custom-fetch) implementation.
You can implement your own `fetch` method. This is useful if you need to extend the default `fetch` method with extra functionality, or replace it altogether.
289
+
290
+
```js
291
+
import { client } from'client/client.gen';
292
+
293
+
client.setConfig({
294
+
fetch: () => {
295
+
/* custom `fetch` method */
296
+
},
297
+
});
298
+
```
299
+
300
+
You can use any of the approaches mentioned in [Configuration](#configuration), depending on how granular you want your custom method to be.
Copy file name to clipboardExpand all lines: docs/openapi-ts/clients/next-js.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,7 @@ With this approach, `client.gen.ts` will call `createClientConfig()` before init
92
92
93
93
### `setConfig()`
94
94
95
-
This is the simpler approach. You can call the `setConfig()` method at the beginning of your application or anytime you need to update the client configuration. You can pass any Fetch API configuration option to `setConfig()`, and even your own Fetch implementation.
95
+
This is the simpler approach. You can call the `setConfig()` method at the beginning of your application or anytime you need to update the client configuration. You can pass any Fetch API configuration option to `setConfig()`, and even your own [Fetch](#custom-fetch) implementation.
You can implement your own `fetch` method. This is useful if you need to extend the default `fetch` method with extra functionality, or replace it altogether.
276
+
277
+
```js
278
+
import { client } from'client/client.gen';
279
+
280
+
client.setConfig({
281
+
fetch: () => {
282
+
/* custom `fetch` method */
283
+
},
284
+
});
285
+
```
286
+
287
+
You can use any of the approaches mentioned in [Configuration](#configuration), depending on how granular you want your custom method to be.
Copy file name to clipboardExpand all lines: docs/openapi-ts/clients/nuxt.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ When we installed the client above, it created a [`client.gen.ts`](/openapi-ts/o
86
86
87
87
### `setConfig()`
88
88
89
-
This is the simpler approach. You can call the `setConfig()` method at the beginning of your application or anytime you need to update the client configuration. You can pass any Nuxt configuration option to `setConfig()`, and even your own `$fetch` implementation.
89
+
This is the simpler approach. You can call the `setConfig()` method at the beginning of your application or anytime you need to update the client configuration. You can pass any Nuxt configuration option to `setConfig()`, and even your own [`$fetch`](#custom-fetch) implementation.
You can implement your own `$fetch` method. This is useful if you need to extend the default `$fetch` method with extra functionality, or replace it altogether.
238
+
239
+
```js
240
+
import { client } from'client/client.gen';
241
+
242
+
client.setConfig({
243
+
$fetch: () => {
244
+
/* custom `$fetch` method */
245
+
},
246
+
});
247
+
```
248
+
249
+
You can use any of the approaches mentioned in [Configuration](#configuration), depending on how granular you want your custom method to be.
0 commit comments