Setup Module

bash
npx nuxt module add site-config

Configuration

For Nuxt apps, see the Site Config Guide for usage.

Module Kit Usage

Use the install function in your module:

modules.ts
import { installNuxtSiteConfig, updateSiteConfig } from 'nuxt-site-config/kit'

export default defineNuxtModule({
  // ...
  async setup(options) {
    await installNuxtSiteConfig()

    // Optional: set some site config from your modules options
    // This is not recommended, only to keep supporting your modules options
    updateSiteConfig({
      _context: 'my-module',
      url: options.siteUrl,
    })
  }
})

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

Did this page help you?