---
title: "ssr:render Hook · Unhead"
canonical_url: "https://unhead.unjs.io/docs/svelte/head/api/hooks/ssr-render"
last_updated: "2026-08-03T13:32:58.297Z"
meta:
  description: "Hook for changing resolved tags and per-render serialization options during SSR."
  "og:description": "Hook for changing resolved tags and per-render serialization options during SSR."
  "og:title": "ssr:render Hook · Unhead"
---

Home

`
Unhead on GitHub

Switch to SvelteSwitch to TypeScriptSwitch to VueSwitch to ReactSwitch to Solid.jsSwitch to AngularSwitch to Nuxt

**Hooks**

# **ssr:render Hook**

[Copy for LLMs](https://raw.githubusercontent.com/unjs/unhead/refs/heads/main/docs/head/7.api/hooks/13.ssr-render.md)

The `**ssr:render**` hook runs after tags have been resolved and immediately before they are serialized into an `**SSRHeadPayload**`.

## Hook Signature

```
export interface Hook {
  'ssr:render': (ctx: {
    tags: HeadTag[]
    options: RenderSSRHeadOptions
  }) => HookResult
}
```

### Parameters

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| `**ctx.tags**` | `**HeadTag[]**` | Sanitized tags selected for this render |
| `**ctx.options**` | `**RenderSSRHeadOptions**` | Fresh copy of the renderer options for this render |

`**RenderSSRHeadOptions**` includes `**omitLineBreaks**`, `**resolvedTags**`, and `**tagWeight**`. At this stage, `**resolvedTags**` and `**tagWeight**` have already been used to select and order `**ctx.tags**`; changing them has no effect on the current render. Changing `**omitLineBreaks**` affects serialization.

Although the hook type permits a promise, serialization starts immediately after the hook call. Keep this hook synchronous.

## Usage Example

```
import { defineHeadPlugin } from '@unhead/svelte/plugins'

export const ssrReportPlugin = defineHeadPlugin({
  key: 'ssr-report',
  hooks: {
    'ssr:render': ({ tags }) => {
      console.log(\`Serializing ${tags.length} head tags\`)
    }
  }
})
```

Use [`**MinifyPlugin**`](https://unhead.unjs.io/docs/head/guides/plugins/minify) instead of setting `**omitLineBreaks**` directly when you also want to minify inline JavaScript, CSS, or JSON.

[~~Edit this page~~](https://github.com/unjs/unhead/edit/main/docs/head/7.api/hooks/13.ssr-render.md)

[~~Markdown For LLMs~~](https://raw.githubusercontent.com/unjs/unhead/refs/heads/main/docs/head/7.api/hooks/13.ssr-render.md)

**Did this page help you? **

[**ssr:beforeRender** Hook for allowing or canceling an SSR head render before tag resolution begins.](https://unhead.unjs.io/docs/head/api/hooks/ssr-before-render) [**ssr:rendered** Hook for inspecting or synchronously changing the serialized SSR head payload.](https://unhead.unjs.io/docs/head/api/hooks/ssr-rendered)

**On this page **

- [Hook Signature](#hook-signature)
- [Usage Example](#usage-example)