···1+---
2+'@hey-api/openapi-ts': minor
3+---
4+5+feat: added `client.baseUrl` option
6+7+### Added `client.baseUrl` option
8+9+You can use this option to configure the default base URL for the generated client. By default, we will attempt to resolve the first defined server or infer the base URL from the input path. If you'd like to preserve the previous behavior, set `baseUrl` to `false`.
10+11+```js
12+export default {
13+ input: 'path/to/openapi.json',
14+ output: 'src/client',
15+ plugins: [{
16+ baseUrl: false, // [!code ++]
17+ name: '@hey-api/client-fetch',
18+ }],
19+};
20+```
+14-4
.changeset/unlucky-moles-dance.md
···1---
2-'@hey-api/client-axios': patch
3-'@hey-api/client-fetch': patch
4-'@hey-api/client-next': patch
5-'@hey-api/client-nuxt': patch
06---
78fix: make createConfig, CreateClientConfig, and Config accept ClientOptions generic
000000000
···1---
2+'@hey-api/client-axios': minor
3+'@hey-api/client-fetch': minor
4+'@hey-api/client-next': minor
5+'@hey-api/client-nuxt': minor
6+'@hey-api/openapi-ts': minor
7---
89fix: make createConfig, CreateClientConfig, and Config accept ClientOptions generic
10+11+### Added `ClientOptions` interface
12+13+The `Config` interface now accepts an optional generic extending `ClientOptions` instead of `boolean` type `ThrowOnError`.
14+15+```ts
16+type Foo = Config<false> // [!code --]
17+type Foo = Config<{ throwOnError: false }> // [!code ++]
18+```
···2728This config option is deprecated and will be removed.
29000000000000000000000000000030## v0.63.0
3132### Client plugins
···2728This config option is deprecated and will be removed.
2930+## v0.64.0
31+32+### Added `ClientOptions` interface
33+34+The `Config` interface now accepts an optional generic extending `ClientOptions` instead of `boolean` type `ThrowOnError`.
35+36+```ts
37+type Foo = Config<false>; // [!code --]
38+type Foo = Config<{ throwOnError: false }>; // [!code ++]
39+```
40+41+### Added `client.baseUrl` option
42+43+You can use this option to configure the default base URL for the generated client. By default, we will attempt to resolve the first defined server or infer the base URL from the input path. If you'd like to preserve the previous behavior, set `baseUrl` to `false`.
44+45+```js
46+export default {
47+ input: 'path/to/openapi.json',
48+ output: 'src/client',
49+ plugins: [
50+ {
51+ baseUrl: false, // [!code ++]
52+ name: '@hey-api/client-fetch',
53+ },
54+ ],
55+};
56+```
57+58## v0.63.0
5960### Client plugins
+23-2
examples/openapi-ts-next/src/client/client.gen.ts
···1// This file is auto-generated by @hey-api/openapi-ts
23-import { createClient, createConfig } from '@hey-api/client-next';
0000045import { createClientConfig } from '../hey-api';
067-export const client = createClient(createClientConfig(createConfig()));
000000000000000
···1// This file is auto-generated by @hey-api/openapi-ts
23+import {
4+ type ClientOptions as DefaultClientOptions,
5+ type Config,
6+ createClient,
7+ createConfig,
8+} from '@hey-api/client-next';
910import { createClientConfig } from '../hey-api';
11+import type { ClientOptions } from './types.gen';
1213+/**
14+ * The `createClientConfig()` function will be called on client initialization
15+ * and the returned object will become the client's initial configuration.
16+ *
17+ * You may want to initialize your client this way instead of calling
18+ * `setConfig()`. This is useful for example if you're using Next.js
19+ * to ensure your client always has the correct values.
20+ */
21+export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> =
22+ (
23+ override?: Config<DefaultClientOptions & T>,
24+ ) => Config<Required<DefaultClientOptions> & T>;
25+26+export const client = createClient(
27+ createClientConfig(createConfig<ClientOptions>()),
28+);