---
title: "updateSiteConfig() · Nuxt Site Config · Nuxt SEO"
canonical_url: "https://nuxtseo.com/docs/site-config/nitro-api/update-site-config"
last_updated: "2026-08-14T16:53:47.416Z"
meta:
  description: "How to update Site Config within Nitro."
  "og:description": "How to update Site Config within Nitro."
  "og:title": "updateSiteConfig() · Nuxt Site Config · Nuxt SEO"
---

Nuxt SEO on GitHub

Switch to Site ConfigSwitch to Nuxt SEOSwitch to RobotsSwitch to SitemapSwitch to OG ImageSwitch to Schema.orgSwitch to Link CheckerSwitch to SEO UtilsSwitch to Skew ProtectionSwitch to AI Ready

**Nitro API**

# **updateSiteConfig()**

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

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

serverMiddleware.ts

```ts
import { defineEventHandler } from '#imports'
import { updateSiteConfig } from '#site-config/server/composables'

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

**Was this page helpful?**

### **Related **

[**updateSiteConfig()**](https://nuxtseo.com/docs/site-config/api/update-site-config)

[**getSiteConfig()**](https://nuxtseo.com/docs/site-config/nitro-api/use-site-config)

[**Runtime Site Config**](https://nuxtseo.com/docs/site-config/guides/runtime-site-config)

[**getSiteConfig()** How to use Site Config within Nitro.](https://nuxtseo.com/docs/site-config/nitro-api/use-site-config) [**getSiteIndexable()** Check if the current site is indexable within Nitro.](https://nuxtseo.com/docs/site-config/nitro-api/get-site-indexable)