Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Jedidiah/gatsby-source-twitch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gatsby-source-twitch

A gatsby source plugin for fetching all the videos and channel info for a Twitch user ID.

Learn more about Gatsby plugins and how to use them here: https://www.gatsbyjs.org/docs/plugins/

Install

npm install --save gatsby-source-twitch

gatsby-config.js

plugins: [
  {
    resolve: `gatsby-source-twitch`,
    options: {
      userID: '<<Twitch UserID eg. 6058227 >>',
      clientID: '<< Add your Twitch client_id here>>'
    },
  },
  ...
]

Examples of how to query:

Get all the videos:

{
  allTwitchvideo {
    edges {
      node {
        title
        url
        type
      }
    }
  }
}

Get the user/channel info:

{
  twitchuser {
    display_name
    description
    profile_image_url
  }
}