Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Jedidiah/gatsby-source-twitch

Gatsby source to fetch data from the Twitch API
https://github.com/Jedidiah/gatsby-source-twitch

gatsby-source gatsbyjs twitch

Last synced: 26 days ago
JSON representation

Gatsby source to fetch data from the Twitch API

Awesome Lists containing this project

README

        

# gatsby-source-twitch

A [gatsby](https://www.gatsbyjs.org/) 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

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

## Examples of how to query:

Get all the videos:

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

Get the user/channel info:

```graphql
{
twitchuser {
display_name
description
profile_image_url
}
}
```