In this lesson, you will learn how to set up your Gatsby project to use Contentful as a data source using the gatsby-source-contentful
plugin.
One question - is it ok to directly mention the access token inside the gatsby-config.js? Since you might commit this code and share it with others, this could be a security issue. Is it not there any support for environment vars or something in gatsby? Thanks a lot.
One question - is it ok to directly mention the access token inside the gatsby-config.js? Since you might commit this code and share it with others, this could be a security issue. Is it not there any support for environment vars or something in gatsby? Thanks a lot.
My understanding is that it's a "read-only" token, so I'm guessing that's why it's okay to include it in the gatsby-config. I may be wrong, however.
Hi Shripada, That's a great question and a valid concern. as Frank mentioned the delivery token is read-only. But it is always best practice to include credentials in environment variables for extra security especially if your website is open source. For the purpose of this exercise, I decided to add the token directly in the gatsby-config for simplicity reasons.
Cheers, Khaled
Thanks for responses. Frank, Khaled. I understand it is a tutorial and I think we need to warn someone who plans to copy this code as is into their production. I have seen people making this mistake especially when they are new to programming...
Hi, one question, what’s in your cli, that shows like a ghost/autocomplete of what you’re typing?
Hi Alexander, I use zsh
with a plugin called zsh-autosuggestions
https://github.com/zsh-users/zsh-autosuggestions.