Index of every page on this site: llms.txt

Setup Module

@nuxtjs/seo includes this module. If your app uses @nuxtjs/seo, skip this step.

Auto-installed with SEO modules. Manual install only for custom modules.

npx nuxt module add nuxt-site-config

Use Nuxt 4.6 or Nuxt 5. Use Node 22.22.3+, Node 24.15.0+, or Node 26+.

Using an AI agent? Get the nuxt-site-config Skill on skilld.dev/gh/harlan-zw/nuxt-site-config.

Verifying Installation

After installing the module, visit /__site-config__/debug.json to see the current site config, or check the Site Config tab in Nuxt DevTools.

The Site Config tab needs the nuxtseo-devtools-host package. Install it as a dev dependency with pnpm add -D nuxtseo-devtools-host, then restart the dev server. You do not add it to modules.

Module Kit Usage

Add nuxt-site-config to your package dependencies, then declare it in moduleDependencies. Nuxt loads the module dependency automatically. Kit functions initialize the config stack when first called. Resolve the module from your package so nested dependencies work with pnpm's global virtual store.

modules.ts
import { fileURLToPath } from 'node:url'
import { defineNuxtModule } from '@nuxt/kit'
import { updateSiteConfig } from 'nuxt-site-config/kit'

export default defineNuxtModule({
  // ...
  moduleDependencies: {
    [fileURLToPath(import.meta.resolve('nuxt-site-config'))]: { version: '>=5.0.0' },
  },
  setup(options) {
    // Optional: set some site config from your modules options
    // This is not recommended, only to keep supporting your modules options.
    // The user's `site` key and `NUXT_SITE_*` env vars override it.
    updateSiteConfig({
      _context: 'my-module',
      url: options.siteUrl,
    })
  }
})

That's it. Explore the documentation to learn more.

Next Steps

You've successfully installed Nuxt Site Config. Here's the recommended reading path:

  1. Recommended Config - Set your site url, env, and name
  2. How it works - Understand config resolution order
  3. Runtime Site Config - Set config dynamically per-request
Was this page helpful?