How to read SAP Cloud Platform User-Provided Variables from a SAPUI5 app?

777 Views Asked by At

I was looking for a way to read the User-Provided Variables using JavaScript from a SAPUI5 app. I've seen examples for node.js and Java, but those don't apply to a SAPUI5 app.

The node.js "version" requires a @sap/xsenv package that unfortunately I don't seem to be able to include in my app.

I'd like to read those variables from a SAPUI5 controller.

Has anyone done that before?

1

There are 1 best solutions below

0
alperdedeoglu On

You need to write an action on your backend application. And this action needs to read environment variables from directly app or via using CF API and must return that to you as response.

You should not read directly anything using CF credentials in a frontend application.