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
- What is Nuxt OpenAPI Hyperfetch? - Understand what this tool does and why you should use it
- Getting Started - Install and create your first composables
- Core Concepts - Learn the fundamental concepts
Usage
- Generating Composables - Learn how to generate composables from your OpenAPI spec
- Choosing a Generator - Understand when to use useFetch vs useAsyncData
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/composablesKey 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:
- Start with What is Nuxt OpenAPI Hyperfetch? to understand the basics
- Follow the Getting Started guide to install and generate your first composables
- Read Core Concepts to understand how it works
- Learn about Generating Composables in detail
- Explore the Composables section for detailed API documentation
- Check out the Composables section for all API details
Need Help?
- Troubleshooting - Common issues and solutions
- Contributing - How to contribute
Next Steps
Ready to get started?
