'How to create/use environment variables for API Secret Keys in Shopify/Liquid?

I am trying to use the ipapi API (https://ipapi.com/documentation) to get the geolocation data of users and I have an API key which I will need to use to make the API call to get the JSON results.

In nodejs, we can use .env to store secret keys and access them with process.env.KEY_NAME. The same goes for servers such as Heroku and AWS, where we can store an API keys as config vars.

But for shopify, I can't seem to find out where to store secret API keys.

I have read some examples:

How to define global variables in Liquid? (this doesn't seem like the right thing to do as I want to store it as a secret and access it from another file).

https://devcenter.heroku.com/articles/config-vars (only for themekit/slate development).

Is it safe to just create another .liquid file and place all my secret keys there and just call it from another file?

Would appreciate if someone could point me the right direction.

Thank you!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source