Env Variables in nuxt.config.js
See original GitHub issueI am accessing some environment variables in my nuxt config for nuxt-auth oauth setup. It at least seems like the environment variables from now aren’t available in the config file.
I set them up properly with now.sh and am able to log them from a page file but when I make the oauth call it doesn’t appear to be sending along the app id in the url params. I can provide more information on my setup if you need but I’m really just curious about what happens to the next config file with the now builder.
Also I made sure to set up a new oauth app for my now.sh domain. It works fine using local nuxt and my oauth app set to localhost.
nuxt.config.js
auth: {
redirect: {
callback: '/callback'
},
strategies: {
github: {
client_id: process.env.GITHUB_CLIENT_ID,
client_secret: process.env.GITHUB_CLIENT_SECRET
}
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
The env property - Nuxt
The env property defines environment variables that should be available on the client side. They can be assigned using server side environment variables,...
Read more >How to use .env variables in Nuxt 2 or 3? - Stack Overflow
I have .env file in the project root, and in my nuxt config I am using variables to configure ReCaptcha like this:
Read more >What are .env files and how to use them in Nuxt | by Liam Hall
A .env file or dotenv file is a simple text configuration file for controlling your Applications environment constants. Between Local, Staging ...
Read more >Using Environment Variables in Nuxt 3 - Server Side Up
Nuxt 3 provides a simple composable that you can include in your setup() method. Nuxt 2 set the environment variables in a global...
Read more >Environment variables in Nuxt 3 - DEV Community
To use environment variables in Nuxt 3, we need to use runtimeConfig in nuxt.config. import {... Tagged with vue, nuxt, env, javascript.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just a nuxt.js static build . I got frustrated from logging out undefined variables 😃
@vickywane I’m glad it was helpful - and am sympathetic! Were you using
now-builder
or a Nuxt.js static build?