I’m using Heroku and Stripe in a Python codebase.
There are different api keys stored in the .env file and not directly in a javascript file. Yet my stripe.js requires these keys.
I can access the keys in python, but my goal is to output a javascript constants file that contains this environmental variable so different deploys can use the different versions of the API key.
Thanks.
You can access environment variables using:
Regarding your particular use case, you could: