I see a lot of information about using environment variables on php files or twig templates, but I want to use them on javascript. I need to pass the environment, located on the .env
file, to the Sentry init, located on assets/js/app.js
.
How could I safely access this? Do I need to install dotenv or similar or is there a 'Craft way' of doing this?
I would appreciate any help on how to do this, or maybe a suggestion for a different approach.