MCPcopy Index your code
hub / github.com/Norbiros/nuxt-open-fetch

github.com/Norbiros/nuxt-open-fetch @v0.13.9

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.13.9 ↗ · + Follow
29 symbols 85 edges 25 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Nuxt Open Fetch

Nuxt Open Fetch

npm version License Nuxt

Generate zero-overhead, 100% typed OpenAPI clients for Nuxt.

In other words - $fetch and useFetch on steroids. Uses awesome openapi-typescript generator under the hood.

[!WARNING] APIs are subject to change before v1.0.0. All ideas/suggestions are welcome!

[!IMPORTANT] Special thanks to @enkot for creating the original module - this project wouldn't be possible without your work 🎉

Features

  • 🍹  No manual typing of your API
  • 🍋  Supports OpenAPI 3.0 and 3.1 (including advanced features like discriminators)
  • 🌲  Uses runtime-free types that outperform old-school codegen
  • 📡  Load schemas from YAML or JSON, locally or remotely
  • 🥞  Works with Nuxt Layers

Quick Setup

  1. Add nuxt-open-fetch dependency to your project
# Using pnpm
pnpm add -D nuxt-open-fetch

# Using yarn
yarn add --dev nuxt-open-fetch

# Using bun
bun add -D nuxt-open-fetch

# Using npm
npm install --save-dev nuxt-open-fetch
  1. Add nuxt-open-fetch to the modules section of nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    'nuxt-open-fetch'
  ]
})

That's it! You can now use nuxt-open-fetch in your Nuxt app ✨

Development

# Install dependencies
pnpm install

# Generate type stubs
pnpm dev:prepare

# Develop with the playground
pnpm dev

# Build the playground
pnpm dev:build

# Run ESLint
pnpm lint

# Run Vitest
pnpm test
pnpm test:watch
pnpm test --project nuxt
pnpm test --project types

# Release new version
pnpm release

License

Made with 💚

Published under the MIT License.

Extension points exported contracts — how you extend this code

OpenFetchOptions (Interface)
(no doc)
src/module.ts
RuntimeNuxtHooks (Interface)
(no doc)
src/build-open-fetch.d.ts
OpenFetchNuxtApp (Interface)
(no doc)
src/runtime/provide.ts
ReturnData (Interface)
(no doc)
playground/tests/types.spec-d.ts
OpenFetchClientOptions (Interface)
(no doc)
src/module.ts
AcceptMediaTypeOption (Interface)
(no doc)
src/runtime/fetch.ts
ReturnDataV2 (Interface)
(no doc)
playground/tests/types.spec-d.ts
ModuleOptions (Interface)
(no doc)
src/module.ts

Core symbols most depended-on inside this repo

createOpenFetch
called by 3
src/runtime/fetch.ts
getClientName
called by 2
src/module.ts
defineMockableProperty
called by 2
src/runtime/provide.ts
fillPath
called by 2
src/runtime/fetch.ts
setup
called by 2
playground/plugins/openFetch.ts
isValidUrl
called by 1
src/module.ts
addCachedSchemaTemplate
called by 1
src/module.ts
createUseOpenFetch
called by 1
src/runtime/useFetch.ts

Shape

Function 18
Interface 11

Languages

TypeScript100%

Modules by API surface

src/module.ts10 symbols
src/runtime/fetch.ts8 symbols
src/runtime/provide.ts3 symbols
src/runtime/useFetch.ts2 symbols
playground/tests/types.spec-d.ts2 symbols
src/runtime/nuxt-plugin.ts1 symbols
src/build-open-fetch.d.ts1 symbols
playground/tests/runtime/body-serializer.spec.ts1 symbols
playground/plugins/openFetch.ts1 symbols

For agents

$ claude mcp add nuxt-open-fetch \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page