···13131414[Nuxt](https://nuxt.com) is an open source framework that makes web development intuitive and powerful.
15151616-::: tip
1717-You might be interested in the [Nuxt module](https://www.npmjs.com/package/@hey-api/nuxt) instead. It offers all the features mentioned in this guide in a more familiar way.
1818-:::
1919-2016<!-- <button class="buttonLink" @click="(event) => embedProject('hey-api-client-fetch-example')(event)">
2117Launch demo
2218</button> -->
···33293430## Installation
35313636-Start by adding `@hey-api/client-nuxt` to your dependencies.
3232+Start by adding `@hey-api/nuxt` to your dependencies.
37333834::: code-group
39354036```sh [npm]
4141-npm install @hey-api/client-nuxt
3737+npm install @hey-api/nuxt
4238```
43394440```sh [pnpm]
4545-pnpm add @hey-api/client-nuxt
4141+pnpm add @hey-api/nuxt
4642```
47434844```sh [yarn]
4949-yarn add @hey-api/client-nuxt
4545+yarn add @hey-api/nuxt
5046```
51475248```sh [bun]
5353-bun add @hey-api/client-nuxt
4949+bun add @hey-api/nuxt
5450```
55515652:::
···7369 -o src/client \
7470 -c @hey-api/client-nuxt # [!code ++]
7571```
7272+7373+:::
7474+7575+::: tip
7676+7777+If you add `@hey-api/nuxt` to your Nuxt modules, this step is not needed.
76787779:::
7880···135137You can also create your own client instance. You can use it to manually send requests or point it to a different domain.
136138137139```js
138138-import { createClient } from '@hey-api/client-nuxt';
140140+import { createClient } from './client/client';
139141140142const myClient = createClient({
141143 baseURL: 'https://example.com',
···228230 url: '/foo/{fooId}',
229231});
230232console.log(url); // prints '/foo/1?bar=baz'
231231-```
232232-233233-## Bundling
234234-235235-Sometimes, you may not want to declare client packages as a dependency. This scenario is common if you're using Hey API to generate output that is repackaged and published for other consumers under your own brand. For such cases, our clients support bundling through the `client.bundle` configuration option.
236236-237237-```js
238238-export default {
239239- input: 'https://get.heyapi.dev/hey-api/backend',
240240- output: 'src/client',
241241- plugins: [
242242- {
243243- bundle: true, // [!code ++]
244244- name: '@hey-api/client-nuxt',
245245- },
246246- ],
247247-};
248233```
249234250235<!--@include: ../../examples.md-->
···11-# @hey-api/client-nuxt
22-33-## 0.4.2
44-55-### Patch Changes
66-77-- [#2066](https://github.com/hey-api/openapi-ts/pull/2066) [`96cd12c`](https://github.com/hey-api/openapi-ts/commit/96cd12c87ca11a396e0df47771ceb1f9f20860d7) Thanks [@alexanderhorner](https://github.com/alexanderhorner)! - fix(client-nuxt): fixed an issue where key was stripped from options
88-99-## 0.4.1
1010-1111-### Patch Changes
1212-1313-- [#2039](https://github.com/hey-api/openapi-ts/pull/2039) [`565e0b8`](https://github.com/hey-api/openapi-ts/commit/565e0b89fbab4556ecdc63dfe08250942681140e) Thanks [@Le0Developer](https://github.com/Le0Developer)! - fix(clients): fix query string encoding with empty lists/objects
1414-1515-## 0.4.0
1616-1717-### Minor Changes
1818-1919-- [#1889](https://github.com/hey-api/openapi-ts/pull/1889) [`67c385b`](https://github.com/hey-api/openapi-ts/commit/67c385bf6289a79726b0cdd85fd81ca501cf2248) Thanks [@mrlubos](https://github.com/mrlubos)! - fix: add @hey-api/openapi-ts to peer dependencies
2020-2121-## 0.3.1
2222-2323-### Patch Changes
2424-2525-- [#1850](https://github.com/hey-api/openapi-ts/pull/1850) [`fe43b88`](https://github.com/hey-api/openapi-ts/commit/fe43b889c20a2001f56e259f93f64851a1caa1d1) Thanks [@kelnos](https://github.com/kelnos)! - feat: add support for cookies auth
2626-2727-## 0.3.0
2828-2929-### Minor Changes
3030-3131-- [#1800](https://github.com/hey-api/openapi-ts/pull/1800) [`d80f835`](https://github.com/hey-api/openapi-ts/commit/d80f835b46775a01451f02f832ceb288c2b561d2) Thanks [@mrlubos](https://github.com/mrlubos)! - feat: drop cjs support
3232-3333-## 0.2.4
3434-3535-### Patch Changes
3636-3737-- [#1774](https://github.com/hey-api/openapi-ts/pull/1774) [`c0b36b9`](https://github.com/hey-api/openapi-ts/commit/c0b36b95645d484034c3af145c5554867568979b) Thanks [@mrlubos](https://github.com/mrlubos)! - docs: announce Hey API platform
3838-3939-## 0.2.3
4040-4141-### Patch Changes
4242-4343-- [#1753](https://github.com/hey-api/openapi-ts/pull/1753) [`b8cc9f8`](https://github.com/hey-api/openapi-ts/commit/b8cc9f8a5eaf4f4ff345abc49c14c6b96744c2ea) Thanks [@LinuCC](https://github.com/LinuCC)! - fix: dropping Content-Type header with falsey but valid json body
4444-4545-## 0.2.2
4646-4747-### Patch Changes
4848-4949-- [#1701](https://github.com/hey-api/openapi-ts/pull/1701) [`e86629b`](https://github.com/hey-api/openapi-ts/commit/e86629bfa9ae2a47131d3a9a240a6aa2a4f67911) Thanks [@mrlubos](https://github.com/mrlubos)! - fix: correctly type default value for Nuxt client
5050-5151-## 0.2.1
5252-5353-### Patch Changes
5454-5555-- [#1674](https://github.com/hey-api/openapi-ts/pull/1674) [`7f0f4a7`](https://github.com/hey-api/openapi-ts/commit/7f0f4a76b06c8fafb33581b522faf8efc6fd85ac) Thanks [@ale18V](https://github.com/ale18V)! - Return a string from urlSearchParamsBodySerializer instead of a URLSearchParams object.
5656- This is due to some runtimes not being able to handle the URLSearchParams object as fetch body.
5757-5858-## 0.2.0
5959-6060-### Minor Changes
6161-6262-- [#1661](https://github.com/hey-api/openapi-ts/pull/1661) [`bb6d46a`](https://github.com/hey-api/openapi-ts/commit/bb6d46ae119ce4e7e3a2ab3fded74ac4fb4cdff2) Thanks [@mrlubos](https://github.com/mrlubos)! - fix: make createConfig, CreateClientConfig, and Config accept ClientOptions generic
6363-6464- ### Added `ClientOptions` interface
6565-6666- The `Config` interface now accepts an optional generic extending `ClientOptions` instead of `boolean` type `ThrowOnError`.
6767-6868- ```ts
6969- type Foo = Config<false>; // [!code --]
7070- type Foo = Config<{ throwOnError: false }>; // [!code ++]
7171- ```
7272-7373-## 0.1.3
7474-7575-### Patch Changes
7676-7777-- [#1637](https://github.com/hey-api/openapi-ts/pull/1637) [`2dc380e`](https://github.com/hey-api/openapi-ts/commit/2dc380eabc17c723654beb04ecd7bce6d33d3b49) Thanks [@mrlubos](https://github.com/mrlubos)! - fix: update keywords in package.json
7878-7979-- [#1649](https://github.com/hey-api/openapi-ts/pull/1649) [`603541e`](https://github.com/hey-api/openapi-ts/commit/603541e307dc2953da7dddd300176865629b50bb) Thanks [@mrlubos](https://github.com/mrlubos)! - fix: do not run validator and transformer when response is not ok
8080-8181-- [#1649](https://github.com/hey-api/openapi-ts/pull/1649) [`603541e`](https://github.com/hey-api/openapi-ts/commit/603541e307dc2953da7dddd300176865629b50bb) Thanks [@mrlubos](https://github.com/mrlubos)! - fix: handle BigInt in JSON body serializer
8282-8383-- [#1646](https://github.com/hey-api/openapi-ts/pull/1646) [`2cbffeb`](https://github.com/hey-api/openapi-ts/commit/2cbffeb2cdd6c6143cd68cac68369584879dda31) Thanks [@mrlubos](https://github.com/mrlubos)! - fix: remove client from Options interface
8484-8585-- [#1646](https://github.com/hey-api/openapi-ts/pull/1646) [`2cbffeb`](https://github.com/hey-api/openapi-ts/commit/2cbffeb2cdd6c6143cd68cac68369584879dda31) Thanks [@mrlubos](https://github.com/mrlubos)! - fix: export TDataShape interface
8686-8787-- [#1649](https://github.com/hey-api/openapi-ts/pull/1649) [`603541e`](https://github.com/hey-api/openapi-ts/commit/603541e307dc2953da7dddd300176865629b50bb) Thanks [@mrlubos](https://github.com/mrlubos)! - fix: handle reactive refs in Nuxt client body
8888-8989-## 0.1.2
9090-9191-### Patch Changes
9292-9393-- [#1626](https://github.com/hey-api/openapi-ts/pull/1626) [`8eba19d`](https://github.com/hey-api/openapi-ts/commit/8eba19d4092fc0903572ab9fdadf0b4c26928ba2) Thanks [@mrlubos](https://github.com/mrlubos)! - fix: export CreateClientConfig type
9494-9595-## 0.1.1
9696-9797-### Patch Changes
9898-9999-- [#1600](https://github.com/hey-api/openapi-ts/pull/1600) [`0432418`](https://github.com/hey-api/openapi-ts/commit/0432418d72c94ef94865f8216ed2f723ad5191f9) Thanks [@mrlubos](https://github.com/mrlubos)! - fix: bundle clients from compiled index file
100100-101101-- [#1596](https://github.com/hey-api/openapi-ts/pull/1596) [`4784727`](https://github.com/hey-api/openapi-ts/commit/47847276e8bc854045044dd414382080270dd779) Thanks [@mrlubos](https://github.com/mrlubos)! - fix: add null to valid bodySerializer types
102102-103103-## 0.1.0
104104-105105-### Minor Changes
106106-107107-- [#1519](https://github.com/hey-api/openapi-ts/pull/1519) [`14d3c4c`](https://github.com/hey-api/openapi-ts/commit/14d3c4ce0393d543e2d3aaebbfcf8f0cf32483b0) Thanks [@mrlubos](https://github.com/mrlubos)! - feat: initial release
-21
packages/client-nuxt/LICENSE.md
···11-MIT License
22-33-Copyright (c) Hey API
44-55-Permission is hereby granted, free of charge, to any person obtaining a copy
66-of this software and associated documentation files (the "Software"), to deal
77-in the Software without restriction, including without limitation the rights
88-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99-copies of the Software, and to permit persons to whom the Software is
1010-furnished to do so, subject to the following conditions:
1111-1212-The above copyright notice and this permission notice shall be included in all
1313-copies or substantial portions of the Software.
1414-1515-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121-SOFTWARE.
-102
packages/client-nuxt/README.md
···11-<div align="center">
22- <img alt="Hey API logo" height="150" src="https://heyapi.dev/images/logo-300w.png" width="150">
33- <h1 align="center"><b>Nuxt Client</b></h1>
44- <p align="center">🚀 Nuxt client for `@hey-api/openapi-ts` codegen.</p>
55-</div>
66-77-<!-- TODO: add working example once StackBlitz updates their Node version -->
88-<!-- [Live demo](https://stackblitz.com/edit/hey-api-client-nuxt-example?file=openapi-ts.config.ts,src%2Fclient%2Fschemas.gen.ts,src%2Fclient%2Fsdk.gen.ts,src%2Fclient%2Ftypes.gen.ts,src%2Fcomponents%home.vue) -->
99-1010-## Features
1111-1212-- seamless integration with `@hey-api/openapi-ts` ecosystem
1313-- type-safe response data and errors
1414-- response data validation and transformation
1515-- access to the original request and response
1616-- granular request and response customization options
1717-- minimal learning curve thanks to extending the underlying technology
1818-- support bundling inside the generated output
1919-- [platform](https://heyapi.dev/openapi-ts/integrations) for automating codegen builds
2020-2121-## Dashboard
2222-2323-Hey API is an ecosystem of products helping you build better APIs. Superpower your codegen and APIs with our platform.
2424-2525-[Sign In](https://app.heyapi.dev) to Hey API platform.
2626-2727-## Documentation
2828-2929-Please visit our [website](https://heyapi.dev) for documentation, guides, migrating, and more.
3030-3131-## Sponsors
3232-3333-Love Hey API? Become our [sponsor](https://github.com/sponsors/hey-api).
3434-3535-<h3 align="center">Gold</h3>
3636-3737-<table align="center" style="justify-content: center;align-items: center;display: flex;">
3838- <tbody>
3939- <tr>
4040- <td align="center">
4141- <p></p>
4242- <p>
4343- <a href="https://kutt.it/pkEZyc" target="_blank">
4444- <picture height="50px">
4545- <source media="(prefers-color-scheme: dark)" srcset="https://heyapi.dev/images/stainless-logo-wordmark-480w.jpeg">
4646- <img alt="Stainless logo" height="50px" src="https://heyapi.dev/images/stainless-logo-wordmark-480w.jpeg">
4747- </picture>
4848- </a>
4949- <br/>
5050- Generate best-in-class SDKs.
5151- <br/>
5252- <a href="https://kutt.it/pkEZyc" style="text-decoration:none;" target="_blank">
5353- stainless.com
5454- </a>
5555- </p>
5656- <p></p>
5757- </td>
5858- </tr>
5959- </tbody>
6060-</table>
6161-6262-<h3 align="center">Silver</h3>
6363-6464-<table align="center" style="justify-content: center;align-items: center;display: flex;">
6565- <tbody>
6666- <tr>
6767- <td align="center">
6868- <a href="https://kutt.it/skQUVd" target="_blank">
6969- <picture height="40px">
7070- <source media="(prefers-color-scheme: dark)" srcset="https://heyapi.dev/images/scalar-logo-wordmark-480w.jpeg">
7171- <img alt="Scalar logo" height="40px" src="https://heyapi.dev/images/scalar-logo-wordmark-480w.jpeg">
7272- </picture>
7373- </a>
7474- <br/>
7575- <a href="https://kutt.it/skQUVd" style="text-decoration:none;" target="_blank">
7676- scalar.com
7777- </a>
7878- </td>
7979- </tr>
8080- </tbody>
8181-</table>
8282-8383-<h3 align="center">Bronze</h3>
8484-8585-<table align="center" style="justify-content: center;align-items: center;display: flex;">
8686- <tbody>
8787- <tr>
8888- <td align="center">
8989- <a href="https://kutt.it/YpaKsX" target="_blank">
9090- <picture height="34px">
9191- <source media="(prefers-color-scheme: dark)" srcset="https://heyapi.dev/images/kinde-logo-wordmark-dark-480w.webp">
9292- <img alt="Kinde logo" height="34px" src="https://heyapi.dev/images/kinde-logo-wordmark-480w.jpeg">
9393- </picture>
9494- </a>
9595- </td>
9696- </tr>
9797- </tbody>
9898-</table>
9999-100100-## Migration Guides
101101-102102-[OpenAPI Typescript Codegen](https://heyapi.dev/openapi-ts/migrating#openapi-typescript-codegen)
···11-import type {
22- Auth,
33- Client as CoreClient,
44- Config as CoreConfig,
55- QuerySerializerOptions,
66-} from '@hey-api/client-core';
71import type {
82 AsyncDataOptions,
93 useAsyncData,
···137 useLazyFetch,
148} from 'nuxt/app';
159import type { Ref } from 'vue';
1010+1111+import type { Auth } from '../../client-core/bundle/auth';
1212+import type { QuerySerializerOptions } from '../../client-core/bundle/bodySerializer';
1313+import type {
1414+ Client as CoreClient,
1515+ Config as CoreConfig,
1616+} from '../../client-core/bundle/types';
16171718export type ArraySeparatorStyle = ArrayStyle | MatrixStyle;
1819type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';