Nuxt · NUXT0102

Do not read private runtimeConfig in client code

Finds client code that reads a private runtimeConfig key from useRuntimeConfig().
NUXT0102vite-doctor/nuxtruntime-configwarnSuggestion

Run this rule

pnpm nuxt doctor --rules nuxt/runtime/no-private-runtime-config-in-client

Why it matters

Nuxt sends only runtimeConfig.public and runtimeConfig.app to the browser, so any other top-level key is undefined there even though its type says string. In development Nuxt warns "Could not access key" (NUXT_E1003). Doctor checks components, pages, layouts, client plugins, and route middleware, using the private keys in the Doctor manifest. It skips server-only branches and plugins. It also skips server-registered components and conventional islands unless the import graph shows a raw file import that can bypass the registration. Component reports use heuristic-medium confidence because Doctor does not prove which parents render them. Without runtimeConfig evidence Doctor records an evidence gap instead.

Move the key under runtimeConfig.public if it is safe to expose. Otherwise read it in a server route and fetch the result, or guard the read with import.meta.server.

Example

Keep private config on the server

Before

<script setup lang="ts">
const config = useRuntimeConfig()
const { data } = await useFetch('https://api.example.com/items', {
  headers: { Authorization: config.apiSecret },
})
</script>

After

<script setup lang="ts">
const { data } = await useFetch('/api/items')
</script>
Copyright © 2026