Core environment variable definitions

Environment variable definitions are used for validation and documentation of the configuration management system of PWA Studio.

Build scripts normally use the values set in the current environment, but it is sometimes necessary to use the definitions themselves, such as when an extension defines its own global config variables.

There are two ways to access the environment variable definitions object:

  • Third-party code should use the builtin target envVarDefinitions when adding definitions.
  • Core Buildpack code uses getEnvVarDefinitions(), which builds environment variable definitions for the project. It starts with core variables listed below and then calls the envVarDefinitions target so installed extensions can add their own variables.

Connecting to a Magento store


Type: url


Connect to an instance of Magento 2.3 by specifying its public domain name.

Magento Store Edition


Type: str

Default: EE

Example: EE

Specify the edition of the magento store (Enterprise Edition or Community Edition). Can be one of CE or EE.

Magento Store View


Type: str

Specify the Magento store view code set in Stores > Settings > All Stores > Store View name


Type: bool

Includes the store code in the store URLs if value is true.

Image Optimizing Origin


Type: str

Default: auto

Specify the origin to use for images in the UI. Set to `backend` when Fastly or another CDN is optimizing images, and the frontend will load images directly from the Magento instance at MAGENTO_BACKEND_URL. To force usage of the onboard image optimizer, set to `onboard`. Set to `auto` to autodetect whether the backend is using FastlyIO and optimize onboard only if it needs to.

Default Country


Type: str

Default: US

Specify the default country to be selected in forms containing country field such as address books and shipping information forms.

Custom local origin


Type: bool

Default: true

Get or create a secure, unique hostname/port combination and a trusted SSL certificate for local development.


Type: bool

Default: true

Add a unique hash string to the custom origin, based on filesystem location. This naturally separates domains when running multiple project folders on one developer machine.


Type: str

Specify the subdomain prefix of the custom origin manually, instead of using the package name.


Type: str

Specify the exact domain of the custom origin manually.

Development server


Type: str

Specify the hostname the dev server should bind to. If this is set, it overrides the host chosen by custom origin settings.


Type: num

Specify the port the dev server should bind to. If this is set, it overrides the port chosen by custom origin settings.


Type: bool

Use a service worker in developer mode (PWADevServer), which are disabled in dev mode normally to simplify cache. Good for debugging.


Type: num

Set to a number greater than 0 to denote a polling interval in milliseconds. If this is greater than 0, the dev server will use filesystem polling instead of native filesystem events to watch for changes. Can increase CPU usage, but sometimes is the best option for exotic filesystems (e.g. NFS).

Staging server


Type: str

Specify the hostname the staging server should bind to. If this is set, it overrides the host chosen by custom origin settings.


Type: num

Specify the port the staging server should bind to. If this is set, it overrides the port chosen by custom origin settings.


Type: str

Specify the id which Buildpack will put in a comment above all generated bundle files and the index.html file

Onboard image optimization service


Type: str

Default: 1 hour

Example: 5 minutes

Lifetime of images in the local cache of resized images. Format is “[length] [unit]”, as in “10 minutes” or “1 day”.


Type: bool

Log image cache debug info to the console.

UPWARD server settings


Type: str

Default: upward.yml

UPWARD configuration file to use for the PWADevServer and the “stage:venia” sample server.


Type: bool

Default: true

Upon launching the staging server, automatically attach to a local port and listen.


Type: bool

Default: true

Log the bound URL to stdout once the sever is listening. Useful in testing and discovery scenarios, but may be disabled in production.

Checkout and payment settings


Type: str

Example: sandbox_8yrzsvtm_s2bg8fs563crhqzk

Specify a Braintree API token to direct the Venia storefront to communicate with your Braintree instance. You can find this value in Braintree’s Control Panel under Settings > API Keys > Tokenization Keys.

BuildBus and targets


Type: str

A list of resolvable NPM modules that BuildBus will scan for targets, in addition to those declared in project `dependencies` and `devDependencies`.

Custom HTTPS certificates


Type: str

Absolute path to the custom HTTPS certificate key file.


Type: str

Absolute path to the custom HTTPS certificate cert file.

Express compression settings


Type: bool

Specify if express server compression needs to be enabled. Defaults to false if not provided.