Add environment variable declarations to the manifest
Components at Edge use a manifest.json file.
Add a top-level environment array to if you want to list the variable names the component is allowed to read.
Set each entry as required or optional with the required flag.
Your component must declare which environment variables it expects before the Component Service or a preview supplies values.
Required variables that are not set may cause the component to fail to load.
Plan defaults in code when you use required: false, or handle missing info.env values.
What to do
-
Open your component’s
manifest.jsonfile in your editor. -
Add the top-level
environmentfield with one or more variable definitions (name andrequiredflag) as needed for your feature. -
Validate that
"type": "edge"and your entry point match your project layout. For example, amain.mjsfile with Edge entry conventions.
Reference
Read the Add environment variable configuration to your manifest documentation for a full description, a sample manifest, and notes on DXP Console preview behavior.