Index of every page on this site: llms.txt

Nuxt Hooks

Build-time Hooks

nuxt-og-image:runtime-config

Type: (config: OgImageRuntimeConfig) => HookResult

Modify the Nuxt OG Image runtime config at build-time.

nuxt.config.ts
export default defineNuxtConfig({
  hooks: {
    'nuxt-og-image:runtime-config': (config) => {
      config.colorPreference = 'dark'
    }
  }
})

nuxt-og-image:components

Type: (ctx: { components: OgImageComponent[], detectedRenderers: Set<RendererType> }) => HookResult

Programmatically modify the components used by the module.

nuxt.config.ts
export default defineNuxtConfig({
  hooks: {
    'nuxt-og-image:components': (ctx) => {
      ctx.components = ctx.components.filter(c => c.category !== 'community')
    }
  }
})

Nitro hooks for runtime OG image generation are documented in the Nitro API section.

Was this page helpful?