Admin Area > Extending Functionality
Environment Variables
Learn how to inject environment variables into the admin app.
This feature is available since Webiny v5.39.0.
- how to inject new environment variables into the Admin app
Overview
Admin app relies on several environment variables that get injected into React apps at build time using Pulumi state files. Sometimes, you might want to inject new variables, relevant to your project, and in this article we show you how to do just that.
Note that the naming convention for environment variables is explained in a dedicated article on Environment Variables.
Inject Variables From Pulumi State
Admin app config modifier contains a utility called pulumiOutputToEnv
, which helps you load the Pulumi state of a specific app (for example, core
or api
), and use it modify the existing set of environment variables.
The ApiOutput
is a type definition of all the Pulumi outputs that Webiny ships by default. This gives you proper autocomplete on the output
object.
Inject Arbitrary Variables
Sometimes you will need to inject values that do not come from Pulumi, but from other sources, like .env
file, or some other places you might have. In that case, use a customEnv
method: