Use .env variables in ui.frontend on deployed environment
const Dotenv = require("dotenv-webpack");
//...
plugins: [
new Dotenv(),
//...
]
const Dotenv = require("dotenv-webpack");
//...
plugins: [
new Dotenv(),
//...
]
I thought it was clear that you must use Cloud Manager variables in the OSGI that you will commit to your git repositories, that way, the API key won't be exposed as I suggested.
Here is an example of what i am explaining https://medium.com/slalom-technology/how-to-use-environment-variables-in-adobe-experience-manager-aem-as-cloud-service-1e9145d78c2c, on top of that, you can follow the approach i suggested to grab the value in JS
You should commit something like this:
{
"apiKey": "$[secret:mycloudmanager-api-key-var]"
}
Hope this makes sense.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.