---
title: "Nuxt Safe Runtime Config"
description: "Validate Nuxt runtime config with Valibot, Zod, ArkType or an annotated .env.example, and read it through a typed composable."
canonical_url: "https://nuxt-safe-runtime-config.onmax.me"
---
# Nuxt Safe Runtime Config

> Validate Nuxt runtime config with Valibot, Zod, ArkType or an annotated .env.example, and read it through a typed composable.

<landing-hero>



</landing-hero>

<u-page-section description="Write the schema once. The module checks it against nuxt.config.ts while you build and against the NUXT_* variables the server starts with, and types useSafeRuntimeConfig() from it." title="One schema, checked where your values come from">
<template v-slot:features="">
<u-page-feature icon="i-ph-hammer" title="At build" to="https://nuxt-safe-runtime-config.onmax.me/guide/validation#at-build">

`nuxt build` stops when a value in `nuxt.config.ts` is missing or malformed.

</u-page-feature>

<u-page-feature icon="i-ph-cloud-check" title="At runtime" to="https://nuxt-safe-runtime-config.onmax.me/guide/validation#when-the-server-starts">

Invalid `NUXT_*` values stop startup with synchronous schemas or fail requests with asynchronous schemas.

</u-page-feature>

<u-page-feature icon="i-ph-arrows-left-right" title="NUXT_* strings converted" to="https://nuxt-safe-runtime-config.onmax.me/guide/environment-overrides">

`NUXT_FLAG=false` becomes `false` and `NUXT_RATE=0.5` becomes `0.5` when the schema asks for them.

</u-page-feature>

<u-page-feature icon="i-ph-shield-check" title="Typed from the schema" to="https://nuxt-safe-runtime-config.onmax.me/guide/type-safety">

`useSafeRuntimeConfig()` has your schema's types in pages, plugins and server routes.

</u-page-feature>

<u-page-feature icon="i-ph-file-text" title=".env.example as schema" to="https://nuxt-safe-runtime-config.onmax.me/guide/env-schema">

Add `@type` comments to the file you already commit, and build without secrets.

</u-page-feature>

<u-page-feature icon="simple-icons:eslint" title="One-command migration" to="https://nuxt-safe-runtime-config.onmax.me/guide/eslint">

`eslint --fix` rewrites every `useRuntimeConfig()` call to `useSafeRuntimeConfig()`.

</u-page-feature>
</template>
</u-page-section>

## Resources for Agents

- [API catalog: every service document this site publishes](https://nuxt-safe-runtime-config.onmax.me/.well-known/api-catalog)
- [Sitemap (XML)](https://nuxt-safe-runtime-config.onmax.me/sitemap.xml)
- [Sitemap (Markdown): every page on the site](https://nuxt-safe-runtime-config.onmax.me/sitemap.md)
- [MCP server card: MCP endpoint at https://nuxt-safe-runtime-config.onmax.me/mcp](https://nuxt-safe-runtime-config.onmax.me/.well-known/mcp/server-card.json)
- [MCP endpoint (streamable HTTP)](https://nuxt-safe-runtime-config.onmax.me/mcp)
- [llms.txt: index of the documentation for LLMs](https://nuxt-safe-runtime-config.onmax.me/llms.txt)
- [llms-full.txt: the full documentation as a single file](https://nuxt-safe-runtime-config.onmax.me/llms-full.txt)
- [OpenAPI document: every route this site serves to agents](https://nuxt-safe-runtime-config.onmax.me/openapi.json)


## Sitemap

See the full [sitemap](https://nuxt-safe-runtime-config.onmax.me/sitemap.md) for all pages.
