Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Access to env file

Avatar

Avatar
Coach
MVP
ursboller
MVP

Likes

517 likes

Total Posts

1,016 posts

Correct Reply

255 solutions
Top badges earned
Coach
Contributor
Bedrock
Seeker
Springboard
View profile

Avatar
Coach
MVP
ursboller
MVP

Likes

517 likes

Total Posts

1,016 posts

Correct Reply

255 solutions
Top badges earned
Coach
Contributor
Bedrock
Seeker
Springboard
View profile
ursboller
MVP

24-08-2020

is there an easy way to access the key/values from the env file within the app or within the actions? or do I need to install a node module that handles the env files?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 25
Employee
duypnguyen
Employee

Likes

26 likes

Total Posts

160 posts

Correct Reply

31 solutions
Top badges earned
Boost 25
Applaud 5
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Boost 25
Employee
duypnguyen
Employee

Likes

26 likes

Total Posts

160 posts

Correct Reply

31 solutions
Top badges earned
Boost 25
Applaud 5
Give Back 5
Give Back 3
Give Back 10
View profile
duypnguyen
Employee

24-08-2020

Hi @ursboller , the .env file is to defined the environment variables at build time. If you want to use them in the actions, you need to pass those variables to the actions via default parameters. To do the mapping, in manifest.yml, for each action there is an "inputs" section. You could simply map all the variables you want for the action there. For example: in .env you have `CAMPAIGN_TENANT="my-tenant"`, then in manifest add `campaignTenant: $CAMPAIGN_TENANT` to the respective action, finally in the action get it with `const tenant = params.campaignTenant`.

Reference docs: https://github.com/AdobeDocs/project-firefly/blob/master/getting_started/first_app.md#5-anatomy-of-a...

Answers (0)