This is a small project to learn how to integrate youtube videos into a Gatsby site programmatically using the youtube api.
It uses the gatsby-source-youtube-v2 plugin
Getting Started
Clone the repo.
Install all dependencies
npm install
Add your channel ID and youtube API key
- Go to the gatsby-config.js file at the root of the project folder and replace YOUR_CHANNEL_ID and YOUR_YOUTUBE_API_KEY
{
resolve: `gatsby-source-youtube-v2`,
options: {
channelId: ['YOUR_CHANNEL_ID'],
apiKey: 'YOUR_YOUTUBE_API_KEY',
maxVideos: 50 // Defaults to 50
}
}
Start up the site
gatsby develop
Learn more