I am building a Wordpress site with Divi plugin and the project is hosted in an AWS Lightsail environment.
My ultimate goal is to make my Wordpress project use different environment variables in both testing and production environments. A button should contain a link to a different website based on the environment.
I have tried using the file wp-config.php, but I cannot get JavaScript to consume this file's environment variables (I have tried with process.env.[the name of the variable] and with other built-in functions of Wordpress and none worked).
Would you know how to do that? Should be straightforward. Thanks in advance!