Skip to main content
Nuxt runs on a server, so it can use real secrets at runtime. Expose them through runtimeConfig and read them with useRuntimeConfig().

Local development

To run your app locally with Enkryptify secrets, install the Enkryptify CLI and link it to your project, then prefix your usual start script with ek run --:
Replace dev with whatever script starts your app. ek run fetches your project’s secrets and injects them as environment variables for that command only.

Accessing secrets in Nuxt

Declare your config in nuxt.config.ts. Keys under runtimeConfig stay server-only; keys under runtimeConfig.public are sent to the browser.
nuxt.config.ts
Nuxt fills these from environment variables at runtime: NUXT_<KEY> for server values and NUXT_PUBLIC_<KEY> for public ones. Name your Enkryptify secrets to match, then read them with useRuntimeConfig():
Only put non-sensitive values under runtimeConfig.public; everything there is visible in the browser.

Deploying

Use the sync for your host (for example the Vercel sync) to provide the same NUXT_* variables in production.