@brightinteractive/bright-js-framework

Environmental Variables

.env file

Adding a .env file to your project root allows you to specify environmental variables for use in development mode. These environment variables can be accessed as if running in a Node environment, i.e. process.env.EXAMPLE_ENVIRONMENT_VARIABLE_NAME.

These variables are not compiled into the javascript bundle. They are returned by the server as part of a page request. This allows you to use the same javascript bundle on both staging and production servers.

Environmental variables must be whitelisted before they are made available to the frontend. They must be specified in the app config before they are passed from server to client.

This file should be formatted as an envfile (KEY=VALUE lines). It should be added to your .gitignore file and not checked into source control.