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

  1. Open your component’s manifest.json file in your editor.

  2. Add the top-level environment field with one or more variable definitions (name and required flag) as needed for your feature.

  3. Validate that "type": "edge" and your entry point match your project layout. For example, a main.mjs file 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.