#Backstage Frontend Access Env Vars in Frontend

4 messages · Page 1 of 1 (latest)

lunar quail
#

Hi we are currently trying to setup CloudWatch RUM with Backstage and when intialising the app, we are trying to access env vars in the front end (might not be the right approach but we are using the RUM client) but are getting faced with this error:

Module not found: You attempted to import .../node_modules/process/browser.js which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.

We initially wanted to access the creds through the configApi but we realised that our custom app-config.yaml was not being read properly. Any help would be great!

unkempt tangle
#

But really, this is an antipattern. Truly secret things, you don't want to allow onto the browser at all. For the RUM info it's probably OK though

lunar quail
#

Thanks @unkempt tangle will take a look into this!