Install Nuxt Site Config
Get started with Nuxt Site Config by installing the dependency to your project.
Module Setup
Nuxt Site Config is a already installed when using any of the other Nuxt SEO modules. It's not recommended to use this module directly in your Nuxt app.
bash
npx nuxi module add site-config
Install Module
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?