Skip to content
Discussion options

You must be logged in to vote

I'd definitely recommend upgrading Next to 9.5.2! There are a TON of great new features!

If that's not possible then this link to the old dotenv example should help with older versions of Next.

You could create a .env file and then use dotenv to import those variables:

next.config.js

require('dotenv').config()
module.exports = {
  env: {
    // Reference a variable that was defined in the .env file and make it available at Build Time
    TEST_VAR: process.env.TEST_VAR,
  },
}

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@bipindubey-technoark
Comment options

@bipindubey-technoark
Comment options

Answer selected by bipindubey-technoark
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #16164 on August 13, 2020 20:29.