Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

gatsby-source-github-contributors

npm

A Gatsby source plugin for pulling all the contributors for a github repository.

Install

via npm

npm install --save gatsby-source-github-contributors

or via yarn

yarn add gatsby-source-github-contributors

Example

Getting data from two different tables:

// In gatsby-config.js
plugins: [
  {
    resolve: `gatsby-source-github-contributors`,
    options: {
      repo: "strawberry-graphql/strawberry"
    }
  }
];

Get all the contributors via GraphQL

{
    allGitHubContributor {
        nodes {
            login
            name
            url
        }
    }
}

API Keys

This source doesn’t require API keys but, since GitHub throttles requests, it is recommended to use a token or app credentials.

Using a token

// In gatsby-config.js
plugins: [
  {
    resolve: `gatsby-source-github-contributors`,
    options: {
      repo: "strawberry-graphql/strawberry",
      token: process.env.GITHUB_TOKEN
    }
  }
];

For more authentication options, refer to github-base docs.

© 2024 Gatsby, Inc.