brandonmp / gatsby-source-google-sheets

A GatsbyJS plugin that pulls nodes from rows in a Google Sheet.
90 stars 32 forks source link

Accessing client_secret.json #24

Closed mckeever02 closed 5 years ago

mckeever02 commented 5 years ago

Is there any way to access the client_secret.json file when hosting on a service such as netlify. Obviously this file shouldn't be committed to the repo so how would you go about accessing it? Or is there another way to configure the credentials? In a .env file perhaps?

drewatk commented 5 years ago

client_secret should not be added to your hosting service, such as netlify. You should only need it when you build your Gatsby project

mckeever02 commented 5 years ago

Netlify builds on deployment, and would therefore need access to the details in the client_secret in one way or another in order to successfully build.

To answer my own question for anyone that comes across this in the future. You can achieve this using .env files. See here: https://stackoverflow.com/questions/55459528/using-private-key-in-a-env-file

dabrady commented 4 years ago

Thanks @mckeever02, this was the first question I had when looking into using this plugin. Great solution, breaking the credentials into separate environment variables and reading them in appropriately during build time. 👏