Skip to content

Guide

This guide documents the current Nuxt-only workflow for nuxt-openapi-hyperfetch.

The module reads a local OpenAPI document during Nuxt builds, generates an SDK into openapi/, and optionally adds useFetch, useAsyncData, nuxtServer, and connector layers on top of that SDK.

Start Here

Quick Start

ts
// nuxt.config.ts
export default defineNuxtConfig({
	modules: ['nuxt-openapi-hyperfetch'],
	openapi: {
		input: './swagger.yaml',
		output: './openapi',
		generators: ['useFetch', 'useAsyncData'],
	},
})

Run npx nuxt dev or npm run dev and the module will generate the selected outputs before the build starts.

What You Get

  • Type-safe SDK files generated from your OpenAPI schema
  • Nuxt-friendly composables built on top of the SDK
  • Optional server route generation for BFF-style flows
  • Optional headless connectors for useAsyncData
  • Auto-import support for generated composables

Suggested Reading Order

  1. Read What is Nuxt OpenAPI Hyperfetch?
  2. Follow Getting Started
  3. Keep Use as Nuxt Module open while configuring the module
  4. Read Core Concepts before customizing generated behavior
  5. Use Choosing a Generator to trim your output to what you actually need

Need Help?

Released under the Apache-2.0 License.