Dotenv: 401 INVALID_SITE (details: {})

I’m trying to make my site more secure by using dotenv to hide my api key.

The trouble is that the lack of documentation around this topic makes it difficult to problem solve the issue. Here is the published branch on my https://github.com/Jesse-Box/jessebox/tree/dotenv

I’ve double-checked the variable name in the gatsby.config and .env file and they match up so any guidance would be appreciated!

Ok I realised, that I didn’t name my dotenv file the following
.env.development which is important for Gatsby.

Hope this is helpful for people that run into the same issue

1 Like