-
Notifications
You must be signed in to change notification settings - Fork 28.5k
docs: mention env option in the environment variables docs #77985
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
Conversation
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
@Netail Don't think we should add this as a Good to know because default recommendation has been to use |
Maybe as a Note? It's at least worth mentioning on the page that people are aware there's ANOTHER option to set env variables besides .env files |
@Netail I would just not include the mention of it overall, so folks are not pondering which one to use (adding via |
I mean, it may not be a recommended solution, it's still a supported feature which some people might have a use case for, like the peeps from that linked discussion post (Also used by "plugins" by wrapping something around the next config to add options). What about a |
@@ -178,6 +178,8 @@ const env = process.env | |||
setupAnalyticsService(env.NEXT_PUBLIC_ANALYTICS_ID) | |||
``` | |||
|
|||
> **Note**: Bundled environment variables can also be set using the [`env`](/docs/app/api-reference/config/next-config-js/env) option in `next.config.js`. These do not require the `NEXT_PUBLIC_` prefix. (not recommended) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The presence of (not recommended)
makes me fee like we should omit this from the docs as it being included is a form of recommending.
Summary
Mention env option of the next config on the environment variables docs page
Came up here; #21850 (reply in thread)
cc: @delbaoliveira @leerob @samcx :)