---
title: "Nitro Hooks · Nuxt OG Image · Nuxt SEO"
canonical_url: "https://nuxtseo.com/docs/og-image/v5/nitro-api/nitro-hooks"
last_updated: "2026-08-16T10:00:32.463Z"
meta:
  description: "Hook into the Nuxt OG Image runtime."
  "og:description": "Hook into the Nuxt OG Image runtime."
  "og:title": "Nitro Hooks · Nuxt OG Image · Nuxt SEO"
---

Nuxt SEO on GitHub

You're viewing **OG Image v5** documentation. For the latest, [~~switch to v6~~](https://nuxtseo.com/docs/og-image/getting-started/introduction).

](https://nuxtseo.com/docs/og-image/v5/getting-started/introduction)

](https://nuxtseo.com/docs/og-image/v5/api/define-og-image)

](https://nuxtseo.com/docs/og-image/v5/releases/v5)

Switch to OG Image](https://nuxtseo.com/docs/og-image/getting-started/introduction)Switch to Nuxt SEO](https://nuxtseo.com/docs/nuxt-seo/getting-started/introduction)Switch to Robots](https://nuxtseo.com/docs/robots/getting-started/introduction)Switch to Sitemap](https://nuxtseo.com/docs/sitemap/getting-started/introduction)Switch to Schema.org](https://nuxtseo.com/docs/schema-org/getting-started/introduction)Switch to Link Checker](https://nuxtseo.com/docs/link-checker/getting-started/introduction)Switch to SEO Utils](https://nuxtseo.com/docs/seo-utils/getting-started/introduction)Switch to Site Config](https://nuxtseo.com/docs/site-config/getting-started/introduction)Switch to Skew Protection](https://nuxtseo.com/docs/skew-protection/getting-started/introduction)Switch to AI Ready](https://nuxtseo.com/docs/ai-ready/getting-started/introduction)

**Nitro API**

# **Nitro Hooks**

Runtime hooks for Nuxt OG Image.

## `**nuxt-og-image:context**`

**Type:** `**async (ctx: OgImageRenderEventContext) => void | Promise<void>**`

Called when the render context is generated. Within this object you can the entire behaviour of the render.

server/plugins/ogImage.ts

```ts
import { defineNitroPlugin } from 'nitropack/runtime/plugin'

export default defineNitroPlugin((nitroApp) => {
  nitroApp.hooks.hook('nuxt-og-image:context', async (ctx) => {
    // e is the H3Event
    if (!ctx.e.path.startsWith('/fancy-og-images/'))
      return

    // modify props (usually better suited in route rules)
    ctx.options.props.isFancy = true
    // make all images use the same cache key
    ctx.key = 'fancy-og-images'
  })
})
```

## `**nuxt-og-image:satori:vnodes**`

**Type:** `**async (vnodes: VNode[]) => void | Promise<void>**`

Called when the Satori vnodes are generated. Using this hook you can modify the final content that is passed to Satori.

server/plugins/ogImage.ts

```ts
import { defineNitroPlugin } from 'nitropack/runtime/plugin'

export default defineNitroPlugin((nitroApp) => {
  nitroApp.hooks.hook('nuxt-og-image:satori:vnodes', async (vnodes) => {
    for (const child of vnodes.children) {
      // remove icon class from Nuxt Icon
      if (child.prop.class)
        child.prop.class = child.props.class.replace('icon', '')
    }
  })
})
```

**Was this page helpful?**

[**Nuxt Hooks** Hook into the Nuxt OG Image build-time behaviour.](https://nuxtseo.com/docs/og-image/v5/api/nuxt-hooks) [**v2 to v3** Migrate Nuxt OG Image v2 to Nuxt OG Image v3.](https://nuxtseo.com/docs/og-image/v5/migration-guide/v3)