3.0.17 • Published 2 years ago

@dansunotori/gatsby-source-youtube-v3 v3.0.17

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

gatsby-source-youtube-v3

A gatsby source plugin for fetching videos from a list of Youtube channels using their channel IDs (and plays nice with Gatsby v3).

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

Install

npm install --save @dansunotori/gatsby-source-youtube-v3

gatsby-config.js

plugins: [
  {
    resolve: `@dansunotori/gatsby-source-youtube-v3`,
    options: {
      channelId: ['<< Array of Youtube channelIDs>>', 'UCK8sQmJBp8GCxrOtXWBpyEA'],
      apiKey: '<< Add your Youtube api key here>>', // Optional for public requests
      maxVideos: 50 // Defaults to 50
    },
  },
  ...
]

Examples of how to query:

Get all the videos:

{
  allYoutubeVideo {
    edges {
      node {
        id
        title
        description
        videoId
        publishedAt
        privacyStatus
        channelTitle
      }
    }
  }
}

Get videos from a specific channel:

{
  allYoutubeVideo(filter: {channelId: {eq: "UCK8sQmJBp8GCxrOtXWBpyEA"}}) {
    edges {
      node {
        id
        title
        description
        videoId
        publishedAt
        privacyStatus
        channelTitle
      }
    }
  }
}

Schema

title : The title of the Youtube video

description : The description of the Youtube video

videoId : The id for the video on Youtube, can be used to make a url to the video or to embed it

publishedAt : The date the video was published.

privacyStatus : The privacy status of the video, public, private, or unlisted

thumbnail : The information about the largest thumbnail available on Youtube. Sub-properties: url, width, height

localThumbnail : The information about the locally saved thumbnail. Works with gatsby-image

channelId : The channel id of the Youtube video

channelTitle : The title of the channel of the Youtube video

3.0.12

2 years ago

3.0.13

2 years ago

3.0.10

2 years ago

3.0.16

2 years ago

3.0.17

2 years ago

3.0.14

2 years ago

3.0.15

2 years ago

3.0.9

2 years ago

3.0.8

2 years ago

3.0.7

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago