How to use Netlify envornment variable in template

Hi Roger,

Have you seen this article?

It describes how to successfully USE the environment variable; TL;DR it’s usable at BUILD TIME ONLY, and during your build you’d put it into your static pages, since it isn’t available at BROWSE TIME for interpolation.

If you need to hide the API key, consider a function such as this one to “proxy” to that API with that key: https://github.com/netlify/code-examples/tree/master/function_examples/token-hider

1 Like