A Gatsby source plugin for fetching videos from YouTube channels via the YouTube Data API v3. It consumes channel IDs and an API key to retrieve video metadata including title, description, thumbnails, and privacy status. The plugin supports Gatsby v3 (and v2 with older versions) and provides GraphQL nodes for use in Gatsby sites. Version 3.0.2 is the latest stable release as of early 2023, with irregular updates. It differentiates from similar plugins by supporting local thumbnail caching for use with gatsby-image, filtering by channel, and limiting max videos. The plugin requires a YouTube API key and handles pagination automatically.
npm install gatsby-source-youtube-v3No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows plugin configuration in gatsby-config.js and a GraphQL query to retrieve videos with thumbnails.
Ensure gatsby-plugin-sharp and gatsby-transformer-sharp are installed and configured when using localThumbnail.
Only use graphql in page components or static queries.
Set API key via environment variable, e.g., process.env.YOUTUBE_API_KEY, and never commit it.
Use the channel ID from the YouTube channel's advanced settings, e.g., 'UCK8sQmJBp8GCxrOtXWBpyEA'.
Set maxVideos to a number up to 50 (the free API limit per page).
Run 'npm install gatsby-source-youtube-v3' or add to package.json.
Ensure plugin is added to gatsby-config.js plugins array and restart the Gatsby development server.
Verify the API key is correct, has YouTube Data API v3 enabled, and quota not exhausted.
Update to latest version of gatsby-source-youtube-v3 and clear Gatsby cache (gatsby clean).