The .env files are typically used to store environment variables, which configure various aspects of your application. These settings may differ between development and production environments. While developing a theme on your local machine, the .env file allows you to point to different Experro environments and fetch data accordingly.

Experro’s provides three .env files:

  • .env
  • .env.development.local
  • .env.production

.env

Here’s how the .env file will look after you run experro-cli init and provide the necessary options:
CLI_TOKEN=XXXXXXXX
STORE_URL=XXX-en-us.experro.app
TENANT_ID=02438836-35e0-413b-bb55-0a1a3833b5b1
WORKSPACE_ID=117065b7-b084-421b-a3cb-5c81d76197f2
API_HOST=apis.experro.app
CHANNEL_IDS=XXXX-XXXX-XXXXXX-XXXX

How to Obtain Channel IDs?

To get Channel IDs, you can refer to the documentation Get Channel Information.

.env.development.local

The .env.development.local file contains environment variables that the Experro base theme uses to determine which modules to load or exclude during local theme development. Currently, the .env.development.local file must include the following predefined variables:
REACT_APP_BUILD_TARGET=app
REACT_APP_ECOMMERCE_MODULE_ENABLE=true
REACT_APP_STORE_URL=http://localhost:8080/
REACT_APP_STORE_TOKEN=http://localhost:8080/
In addition to these required variables, Experro also allows you to add two optional variables:
The additional variables below will be supported only when you are using a BigCommerce store with Experro Admin:
REACT_APP_MULTI_CURRENCY_ENABLE=false  // Enables or disables multi-currency support.
REACT_APP_EXTERNAL_CHECKOUT=true // Enables or disables the use of an external checkout versus an embedded one.
REACT_APP_BUILD_TARGET
The REACT_APP_BUILD_TARGET variable accepts two values: the default value app, and app-ui-builder. Setting it to app-ui-builder will launch the Visual Builder locally, allowing theme developers to customize component widgets accordingly.

.env.production

The .env.production file functions similarly to the .env.development.local file. While .env.development.local is used during local development, the .env.production file is utilized when creating or uploading a build using experro-cli. During local development, variables from .env.development.local are applied, but when you create a build or upload it, .env.production is used to determine the build configuration.