Skip to content

Node.js environment variables

Environment variables are used to provide information to an application. This circumvents the need to hardcode configuration values and allows an application to have environment-specific behavior. On the VIP Platform, environment variables are provided when a Node.js application is built and at runtime.

Custom environment variables can be added and managed with VIP-CLI.

Redis environment variables and New Relic environment variables can be used on Node.js environments as well.

NODE_ENV environment variable

The value for NODE_ENV is always set to “production” for all Node.js environments on the VIP Platform, even non-production environments. The purpose of the production value is to indicate that an environment is “not a local development environment”, and forces important optimizations.

Overriding the NODE_ENV value is strongly discouraged and can have negative effects. The behavior of many Node.js libraries is based on the NODE_ENV variable and may no longer work as expected if this value is changed.

VIP environment variables

VIP environment variables are set per environment and can be used to customize environment-specific behavior.

  • VIP_GO_APP_BRANCH: The Git branch deploying to an environment (e.g. main)
  • VIP_GO_APP_CURRENT_COMMIT_HASH: The Git commit SHA1 hash of the currently deployed code (e.g. e7ba94e2a07dc8f70e247660692164ce016b39ef)
  • VIP_GO_APP_ID: An application’s unique ID (e.g. 8886)
  • VIP_GO_APP_NAME: An application’s name (e.g. example-app)
  • VIP_GO_APP_ENVIRONMENT: The name of an application’s environment (e.g. production or preprod)  

Last updated: August 08, 2024

Relevant to

  • Node.js