npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gatsby-source-google-sheets-flexible

v1.0.3

Published

Gatsby source plugin that has all the options provided by the Google Sheets api. You can also simply use the Google Sheets url instead of the its ID, for convenience.

Readme

Description

This is a Gatsby source plugin that has all the options provided by the Google Sheets api. You can also simply use the Google Sheets url instead of the its ID for convenience.

Install

npm i gatsby-source-google-sheets-flexible

How to use

Step 1: Prepare your Google API

  1. Create a Google API project
  2. Enable Google Sheets API for that project
    • Click the ENABLE button and select the project that you created
  3. Create the Google API key for that project
    • Click CREATE CREDENTIALS button and select API key

Step 2: Configure your Gatsby Project

  1. Install plugin by running npm i gatsby-source-google-sheets-flexible
  2. Add the plugin in your gatsby-config.js file

Available Options:

  • apiKey: Your google api key as in step 1.
  • spreadsheetId: The ID of the Google Sheets document to retrieve data from. Not required if you use the spreadsheetUrl option (next line).
  • spreadsheetUrl: The url of Google Sheets document to retrieve data from. Not required if you use the spreadsheetId option (previous line).
  • tabName: the tab name of the spreadsheet that you want to retrieve from the Google Sheets document.
  • cellRange (OPTIONAL): the range within the Google Sheets document of the cells you want to retrieve data from. Defaults to "A1:Z1000".
  • majorDimension (OPTIONAL): The major dimension that results should use. 2 Possible values: "ROWS" (default), "COLUMNS". Check out the majorDimension parameter here for more information.
  • valueRenderOption (OPTIONAL): Determines how values should be rendered in the output. 3 possible values: "FORMATTED_VALUE" (default), "UNFORMATTED_VALUE", "FORMULA". Check out here for more information.
  • dateTimeRenderOption (OPTIONAL): Determines how dates should be rendered in the output. 2 possible values: "SERIAL_NUMBER", "FORMATTED_STRING". Check out here for more information.

Additional Notes:

  • All of the values should be of string type, within quotation marks.
  • You can add the plugin with different configurations multiple times to pull data from different Google Sheets tabs/files

Example of using the plugin to retrieve data from 2 tabs in the same Google Sheets document, using spreadsheetUrl for one, and spreadsheetId for the other: (in gatsby-config.js)

module.exports = {
    plugins: [
        {
            resolve: "gatsby-source-google-sheets-flexible",
            options: {
                apiKey: "AIzaSyCQQlbvNPEp21LLRsA_S0-R3r2TdxyUE-k",
                spreadsheetUrl: "https://docs.google.com/spreadsheets/d/16x6gtYQl7TAhehSqcaf_SAMDKNpEgoMxAGgMpQ7NUMs/edit#gid=72026853",
                tabName: "site",
                cellRange: "A1:B23",
                majorDimension: "COLUMNS",
            },
        },
        {
        resolve: 'gatsby-source-google-sheets-flexible',
            options: {
                apiKey: "AIzaSyCQQlbvNPEp21LLRsA_S0-R3r2TdxyUE-k",
                spreadsheetId: "16x6gtYQl7TAhehSqcaf_SAMDKNpEgoMxAGgMpQ7NUMs",
                tabName: "listing",
                cellRange: "A1:H1000",
                majorDimension: "ROWS",
            }
        }   
    ],
}

Step 3: View the results

  1. start the project in dev environment by running gatsby develop
  2. go to http://localhost:8000/___graphql to see the retrieved data. It should have created your Google Sheets data under all<tabName>SheetsData