Set environment variables in local development
To test an Edge component on your system, supply environment values using the DXP CLI or a project-specific mechanism.
This populates info.env in a way that matches DXP behavior, within the limits of your local tool.
What to do
-
Use the DXP CLI
cmp devcommand and pass variables as required for your shell, or set them through the process described in the reference. -
Confirm the component hot-reloads or restarts and that the UI reflects the value you set.
-
If required variables are missing, fix the local configuration or make the variable
required: falsein themanifest.jsonfile and handle the empty case in code. Read the Add environment variable configuration to your manifest documentation for more information.
Reference and related tutorials
-
Local testing in the Create a component tutorial (CLI workflow and preview).