Skip to content

Guide

Welcome to the Nuxt OpenAPI Hyperfetch guide! This comprehensive guide will help you get started with generating type-safe Nuxt composables from OpenAPI specifications.

What You'll Learn

This guide covers everything you need to know about using nuxt-openapi-hyperfetch:

Getting Started

Usage

Quick Start

bash
# Install
npm install -D nuxt-openapi-hyperfetch

# Generate client composables
npx nxh generate -i swagger.yaml -o ./composables

# Generate server composables
echo nuxtServer | npx nxh generate -i swagger.yaml -o ./server/composables

Key Features

  • Type-Safe - Full TypeScript support from OpenAPI schemas
  • Dual Mode - Generate client composables (useFetch/useAsyncData) or server composables
  • SSR Support - Works seamlessly with Nuxt's Server-Side Rendering
  • Callbacks - Per-request and global callbacks for auth, logging, etc.
  • BFF Pattern - Server composables for Backend-for-Frontend architecture

Learning Path

We recommend following this path:

  1. Start with What is Nuxt OpenAPI Hyperfetch? to understand the basics
  2. Follow the Getting Started guide to install and generate your first composables
  3. Read Core Concepts to understand how it works
  4. Learn about Generating Composables in detail
  5. Explore the Composables section for detailed API documentation
  6. Check out the Composables section for all API details

Need Help?

Next Steps

Ready to get started?

Released under the Apache-2.0 License.