Skip to content
Discussion options

You must be logged in to vote

I'd strongly recommend using Next's newer built in environment variable support. This will ensure that server secrets stay on the server and client secrets stay on the client.


With that said, if you are using the next.config.js environment variable support then the variables you use will only be exposed if you expose them in client code. If you are only using process.env.SECRET in your secretMethod and that method is only used in getServerSideProps then it will not be exposed to the client.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@hems
Comment options

@ghost
Comment options

Answer selected by jamesmosier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants