---
title: "updateSiteConfig()"
description: "How to update Site Config within Nitro."
canonical_url: "https://nuxtseo.com/docs/site-config/nitro-api/update-site-config"
---

> Index of every page on this site: [llms.txt](https://nuxtseo.com/llms.txt)

Same as [updateSiteConfig](https://nuxtseo.com/docs/site-config/api/update-site-config) but you will need to provide the request context.

::warning
When using this, you will need to run it as early as possible within the request lifecycle to avoid conflicts. It's
recommended to run this either in a Nitro plugin or a nitro middleware.
::

## Usage

```ts [serverMiddleware.ts]
import { defineEventHandler } from 'nuxt/server'
import { updateSiteConfig } from '#site-config/server'

export default defineEventHandler((e) => {
  updateSiteConfig(e, {
    name: 'My Site',
    url: 'https://example.com',
  })
})
```

## Sitemap

See the full [sitemap](https://nuxtseo.com/sitemap.md) for all pages.
