-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variables / config read after #72
Comments
Nuxt relies on a .env file for supplying environment variables during bootup. Using this file, or build args to the docker image, is the only way to access variables at time of initialization. Luckily, the env vars with NUXT_ prefix are turned into static assets. They can be used at runtime. However, this requires using the runtimeConfig. Some of the OIDC configuration therefore needs to move into the runtime config. Naming matters for runtimeconfig!
Our provider is a generic OIDC provider, therefore OIDC appears twice. But it could have been for instance NUXT_OIDC_PROVIDERS_ENTRA_CLIENT_ID. Rest of the config simply appears again in the root of defineNuxtConfig:
They are naturally just static values because they are not environment specific. This works for docker-compose and our kubernetes config. Note, this specific example only works in 0.15.0, but it's quite similar in versions above. Your code editor will tell you what fields to move in our out of either the static config, or runtimeconfig. |
Thanks so much Tony! I'll test this when I get a chance. |
Hi, yeah I tried doing this and then taking NUXT_OIDC_PROVIDERS_ZITADEL_CLIENT_ID set in my k8s values but the "built" version doesn't pick it up it seems. |
Have you set the |
Are the NUXT_OIDC_* vars read at runtime or and how does it play with nuxt.config.ts? I am having some issues where variable in my kubernetes deployment doesn't seem to work at runtime and nuxt.config.ts carries over.
The text was updated successfully, but these errors were encountered: