'How do you put JSON into environment variables?

I have a Google Analytics API JSON Key (a json file containing credential information). It should be stored as environment variables. How do you do that? I think I have two options.

  1. Encode JSON in Base64 and store it as single key:value environment variable pair.
  2. List all key and value pairs into environment variables. Thanks!


Sources

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

Source: Stack Overflow

Solution Source