---
title: "How it works"
description: "Learn how the Nuxt Site Config module works, so you can get the most out of it."
canonical_url: "https://nuxtseo.com/docs/site-config/guides/how-it-works"
last_updated: "2026-10-04T12:18:09.535Z"
---

Site config resolves from the following sources, in order of precedence:

## Build Time

### 1. System

System details relate to the environment the app is running in.

```ts
export default {
  env: import.meta.envName || process.env.NODE_ENV,
}
```

If you do not set `indexable`, the resolved config derives it from `env`: `true` when `env` is `'production'`, else `false`.

### 2. Vendor CI Environment

When deploying to supported platforms, `url` and `name` are automatically populated from platform environment variables. These have low priority and are overridden by any explicit config you provide.

| Platform                       | `url`                               | `name`                          |
| ------------------------------ | ----------------------------------- | ------------------------------- |
| [Vercel](https://vercel.com)   | `VERCEL_URL`, `NUXT_ENV_VERCEL_URL` | `NUXT_ENV_VERCEL_GIT_REPO_SLUG` |
| [Netlify](https://netlify.com) | `URL`                               | `SITE_NAME`                     |
| Cloudflare Pages               | `CF_PAGES_URL`                      |                                 |

::note
As of v4, `site.name` is no longer inferred from your project directory or `package.json`. It will only be auto-populated from CI platform env vars listed above, or from explicit config. See the [v4 release notes](/docs/site-config/releases/v4).
::

3. **Module overrides**: Build time site config that modules set with `updateSiteConfig()`{lang="ts"} from `nuxt-site-config/kit`.
4. **Nuxt Config `site` key**: Site config provided by the user in the Nuxt config.
5. **Nuxt Hook**: `updateSiteConfig()`{lang="ts"} calls in the `site-config:resolve` hook.
6. **I18n**: `url` from `i18n.baseUrl` and the default locale.
7. **Runtime Config and Environment Variables**: `runtimeConfig.public.site` and the `NUXT_SITE_*` environment variables (e.g. `NUXT_SITE_URL`, `NUXT_SITE_NAME`), first at build time, then at runtime.

A build time `updateSiteConfig()`{lang="ts"} call without a `_priority` ranks with the `site` key (`SiteConfigPriority.config`). To rank an entry differently, pass `_priority` with a `SiteConfigPriority` value.

## SSR / Nitro Runtime

1. **Request URL**: The request URL determines the site URL at runtime.
2. **Build Time Site Config**: Config resolved in the build step, stored on `runtimeConfig['nuxt-site-config'].stack`.
3. **Route Rules**: Config resolved from the route rules of the request path, the `site` key. This allows for multi-site support.

## CSR Runtime

In CSR, the browser hydrates site config directly from the SSR-rendered payload sent by the server. This ensures the client has the same config as the server without any hydration mismatches.

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
