Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Nuxt module that generates type-safe composables for secure API access via a server proxy, with OpenAPI support.
Nuxt API Party is a Nuxt module that auto-generates type-safe composables for every API endpoint you configure, proxying all requests through the Nuxt server to keep API credentials private and avoid CORS issues.
Nuxt API Party is an open-source Nuxt module, licensed under MIT and created by Johann Schopplich with ongoing maintenance by Matthew Messinger. It takes an endpoints object defined in your Nuxt configuration — each entry containing a url and optional headers — and generates two composables per endpoint: a $endpoint function that returns response data like $fetch, and a useEndpointData composable that returns data, refresh, error, status, and clear, similar to useFetch. The module runs inside Nuxt 3 projects and uses a Nitro server proxy route as the request bridge between the browser and the external API.
apiParty.endpoints, Nuxt API Party creates a $endpoint function and a useEndpointData composable, matching the return shape of Nuxt's useFetch and $fetch.nuxt.config.ts; the browser sends its requests to your Nuxt server, which forwards them, so tokens never appear in client-side code.useFetch.endpoints object; each one gets its own set of composables.useFetch and $fetch can use the generated composables without learning a new pattern.npx nuxt module add api-party, and the only setup is an apiParty block in nuxt.config.ts.useContentApiData and useBookingApiData in the relevant pages.useFetch-style caching and hydration.Installing with npx nuxt module add api-party adds the module to your project. In nuxt.config.ts, you declare an apiParty section with an endpoints object; each endpoint has a url (typically read from an environment variable) and optional headers. When you call the generated composable, the request goes to a Nitro server route that forwards it to the external API and returns the data, preserving credentials and avoiding cross-origin blocks.
Yes. It is released under the MIT License and available on GitHub (currently 305 stars). There is no paid tier or SaaS version; you install and run it inside your own Nuxt application.
Yes. The module has a dedicated guide for OpenAPI integration and can generate fully typed API clients from an OpenAPI specification, so you get typed composables without defining interfaces by hand.
The composables you call in components are front-end friendly, but the actual request is handled by a server proxy route defined by the module. Only the server knows the real headers you set in nuxt.config.ts; the browser never receives those tokens.
For an endpoint named jsonPlaceholder, Nuxt API Party generates $jsonPlaceholder, which returns the response data, and useJsonPlaceholderData, which returns data, refresh, error, status, and clear — the same shape as Nuxt's useFetch.
Yes. The endpoints object accepts any number of entries. Each one results in its own pair of composables, so you can work with many APIs in the same Nuxt app without conflicts.
