Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A Gatsby starter boilerplate that pulls content from Google Sheets via the gatsby-source-google-spreadsheet plugin.
Gatsby Starter Google Sheets is a Gatsby boilerplate that wires a React-based static site to a Google Sheets spreadsheet as its data source using the gatsby-source-google-spreadsheet plugin.
It's a starter template for Gatsby, the React-based static site generator. It takes a Google Spreadsheet as input, configured through environment variables, and produces a static website that queries spreadsheet rows through GraphQL. The starter ships with main Gatsby configuration files and the gatsby-source-google-spreadsheet plugin so you can get up and running with minimal setup.
SPREADSHEET_ID, CLIENT_EMAIL, and PRIVATE_KEY stored in a .env file to authenticate and locate your sheet.http://localhost:8000/___graphql you can experiment with querying your spreadsheet data.src/pages/index.js updates the browser in real time during gatsby develop.The quick start instructs you to run gatsby new with the starter's GitHub URL, add credentials to a .env file (spreadsheet ID from the sheet URL, plus service account email and private key), then run gatsby develop. The plugin syncs sheets into GraphQL, and you edit src/pages/index.js to pull rows.
It needs SPREADSHEET_ID, CLIENT_EMAIL, and PRIVATE_KEY placed in a .env file. The SPREADSHEET_ID is taken from the sheet's URL, while CLIENT_EMAIL and PRIVATE_KEY come from a Google service account you create.
Copy it from the URL of the Google Sheet, which follows the format https://docs.google.com/spreadsheets/d/.../edit. The segment after /d/ is the spreadsheet ID.
The sheet must be shared with edit permission to the service account email address. The source plugin reads from the spreadsheet using those credentials, so the service account needs access.
The main page file is src/pages/index.js. During development, changes to this file appear in the browser in real time because of Gatsby's hot reloading.
While gatsby develop is running, you can visit http://localhost:8000/___graphql to use GraphiQL and test queries against your spreadsheet data.
