nuxt-api-party
| Install | |
|---|---|
npm install nuxt-api-party |
|
| Latest Version: | 4.0.1 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Sep 9, 2026 |
| Links: | GitHub · npm |
Nuxt API Party
Auto-generated composables for any API in Nuxt, typed from OpenAPI and never exposing your credentials.
Features
- 🪅 Auto-generated composables for each API endpoint
- 🔒 Protected API credentials with a Nuxt proxy route
- 🌐 No CORS issues
- 🍱 Familiar developer experience to
useFetchand$fetch - 🧇 Connect all your APIs
- 🦾 Fully typed API clients from OpenAPI specifications
- 🗃 Cached responses and hydration
Setup
npx nuxt module add api-party
Basic Usage
Add Nuxt API Party to your Nuxt configuration and describe your first API under the apiParty module option:
// `nuxt.config.ts`
export default defineNuxtConfig({
modules: ['nuxt-api-party'],
apiParty: {
endpoints: {
jsonPlaceholder: {
url: process.env.JSON_PLACEHOLDER_API_BASE_URL!,
// Global headers sent with each request
headers: {
Authorization: `Bearer ${process.env.JSON_PLACEHOLDER_API_TOKEN}`
}
}
}
}
})
If you were to call your API jsonPlaceholder, the generated composables are:
$jsonPlaceholder– Returns the response data, similar to$fetchuseJsonPlaceholderData– Returns multiple values similar touseFetch
Use these composables in your templates or components:
<script setup lang="ts">
const { data, refresh, error, status, clear } = await useJsonPlaceholderData('posts/1')
</script>
<template>
<h1>{{ data?.title }}</h1>
<pre>{{ JSON.stringify(data, undefined, 2) }}</pre>
</template>
[!TIP] You can connect as many APIs as you want, just add them to the
endpointsobject.
The documentation covers the OpenAPI integration, caching and every module option.
💻 Development
- Clone this repository
- Enable Corepack using
corepack enable - Install dependencies using
pnpm install - Run
pnpm run dev:prepare - Start development server using
pnpm run dev
Credits
- Dennis Baum for sponsoring the initial version of this package.
- Konkon for his logo pixel art.
License
MIT License © 2022-PRESENT Johann Schopplich and © 2025-PRESENT Matthew Messinger
Related Packages
Nuxt module for generating an OpenAPI SDK, composables, server routes, and headl...
Version History
| Version | Released | License |
|---|---|---|
| 4.0.1 | MIT | |
| 4.0.0 | MIT | |
| 3.4.3 | MIT | |
| 3.4.2 | MIT | |
| 3.4.1 | MIT | |
| 3.4.0 | MIT | |
| 3.3.0 | MIT | |
| 3.2.0 | MIT | |
| 3.1.2 | MIT | |
| 3.1.1 | MIT | |
| 3.1.0 | MIT | |
| 3.0.2 | MIT | |
| 3.0.1 | MIT | |
| 2.2.9 | MIT | |
| 2.2.8 | MIT | |
| 2.2.7 | MIT | |
| 2.2.6 | MIT | |
| 2.2.5 | MIT | |
| 2.2.4 | MIT | |
| 2.2.3 | MIT | |
| 2.2.2 | MIT | |
| 2.2.1 | MIT | |
| 2.1.2 | MIT | |
| 2.1.1 | MIT | |
| 2.1.0 | MIT | |
| 2.0.11 | MIT | |
| 2.0.10 | MIT | |
| 2.0.9 | MIT | |
| 2.0.8 | MIT | |
| 2.0.7 | MIT |
Showing the latest 30 of 121. See every release on npm
