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-patreon

v0.0.1

Published

Gatsby source plugin to include Patreon as a data source

Readme

gatsby-source-patreon

Gastby source plugin for pulling your campaign data from Patreon. This plugin uses the V2 API from Patreon that is still in active development. Expect things to break. When they do create an issue on Github.

This plugin will only work when you are a Patreon creator and will only pull data from your own campaigns.

Campaign data is only download at build time so you will need to either manually rebuild your site when campaign data changes or use a webhook to trigger a build.

Install

  1. yarn add gatsby-source-patreon
  2. Create a new API client on Patreon's website. Select V2 as the API version.
  3. Add this configuration to your gatsby-config.js:
{
    resolve: `gatsby-source-patreon`,
    options: {
        token: '<CREATOR_ACCESS_TOKEN>',
        refreshToken: '<CREATOR_REFRESH_TOKEN>'
    }
}
  1. Replace <CREATOR_ACCESS_TOKEN> and <CREATOR_REFRESH_TOKEN> with the tokens you received from Patreon when creating the client.

Usage

Most data about campaigns is optional and will return null values when they are left blank. Gatsby ignores these when building the GraphQL schema causing errors in your query when you request a field that's null. To check which fields / types are available run this query in your local GraphiQL UI after you've build your site.

{
    __type(name: "PatreonCampaign") {
        fields {
            name
            description
        }
    }
}

Then to query your campaigns run:

{
    allPatreonCampaign {
        edges {
          node {
            id
            creationName
          }
        }
    }
}

Access tokens

The access token you receive from Patreon when creating the client are valid for one month. This source plugin will not automatically refresh that token. When you receive 401 Unauthorized errors from Patreon when building your site it is time to refresh the tokens and update the config.

Current limitations

  • The plugin is currently limited to campaign data only. Data from members, benefits, goals etc. will follow
  • Pagination is currently not supported. The plugin will pull the default number of campaigns
  • The plugin uses V2 of the Patreon api. This API is still in development so things might break.
  • The is_nsfw field from the campaign data is missing as there is a bug preventing the plugin to request it.