---
title: "Nuxt Hooks"
description: "Hook into the Nuxt OG Image build-time and runtime behaviour."
canonical_url: "https://nuxtseo.com/docs/og-image/api/nuxt-hooks"
last_updated: "2026-05-24T16:40:58.704Z"
---

## Build-time Hooks

### `nuxt-og-image:runtime-config`

**Type:** `(config: OgImageRuntimeConfig) => HookResult`

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

```ts [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.

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

## Runtime Hooks

Nitro hooks for runtime OG image generation are documented in the [Nitro API](/docs/og-image/nitro-api/nitro-hooks) section.
