question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Env Variables in nuxt.config.js

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
vickywanecommented, Feb 15, 2020

Just a nuxt.js static build . I got frustrated from logging out undefined variables 😃

0reactions
danielroecommented, Feb 15, 2020

@vickywane I’m glad it was helpful - and am sympathetic! Were you using now-builder or a Nuxt.js static build?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found