In many projects that i have been working I want to manage GLOBAL’s variables, so to do that use direnv.

to install (MacOS):

brew install direnv

Now the project needs to create a file .envrc like this:

# Stripe Credentials
export STRIPE_PRIVATE_KEY="xxxxxxxxxxxx"
export STRIPE_WEBHOOK_SECRET="xxxxxxxxxxxxxxxx"

entering in that directory direnv asks to allow the execution and use of that variables, so:

direnv allow .

And that’s it! you don’t need a custom solution for every programming language.