access .env variables in web-src? | Community
Skip to main content
Urs_Boller
Community Advisor
Community Advisor
September 12, 2020
Solved

access .env variables in web-src?

  • September 12, 2020
  • 1 reply
  • 2010 views

is it possible to access the data saved in the .env file within the app? eg. I have a screen and I want to access data saved in the .env file - basically to make a check. or do I really need to write an action for this?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by sarahxxu

Hi @urs_boller 

 

You would need to pass that info in through your action. You can pass in the value from .env into your action. Then have the action return these values to be consumed by your frontend code. 

 

Hope this helps,

Sarah

1 reply

sarahxxu
Adobe Employee
sarahxxuAdobe EmployeeAccepted solution
Adobe Employee
September 15, 2020

Hi @urs_boller 

 

You would need to pass that info in through your action. You can pass in the value from .env into your action. Then have the action return these values to be consumed by your frontend code. 

 

Hope this helps,

Sarah

Urs_Boller
Community Advisor
Community Advisor
September 15, 2020

Hi @sarahxxu that's what I assumed I need to do. My use case is having a router where one route (screen) is access restricted. means when calling the screen, I need to invoke an action which returns true or false for access. Is there any other way I can make a part of the app with access restriction? eg. by checking a "product profile id" or something similar?