Socket
Socket
Sign inDemoInstall

@fyrepenguin/gatsby-source-youtube

Package Overview
Dependencies
3
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @fyrepenguin/gatsby-source-youtube

Sourcing youtube videos


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@fyrepenguin/gatsby-source-youtube

Source from Youtube API (v3) in Gatsby.


Install

npm install --save @fyrepenguin/gatsby-source-youtube

How to use

Prerequisites

First, you need a way to pass environment variables to the build process, so secrets and other secured data aren't committed to source control. I recommend using [dotenv][dotenv] which will then expose environment variables. [Read more about dotenv and using environment variables here][envvars]. Then you can use these environment variables and configure your plugin.

You'll need an API Key from google and Channel ID from youtube channel.

  1. Create your API Key

  2. Get your Channel ID

    1. Sign in to YouTube.
    2. In the top right, click your profile picture and then Settings Settings.
    3. From the left Menu, select Advanced settings.
    4. You’ll see your channel’s user and channel IDs.
  3. Save both to your environment variable file

It should look something like this:

API_KEY=your-api-key-here
CHANNEL_ID=your-session-id-here

gatsby-config

The plugin sets some defaults for the endpoints and options. Hence you can use it only with the two mandatory entries apiKey and channelId.

module.exports = {
  plugins: [
    {
      resolve: '@fyrepenguin/gatsby-source-youtube',
      options: {
        // apiKey and channelId are mandatory
        apiKey: process.env.API_KEY,
        channelId: process.env.CHANNEL_ID,
      },
    },
  ],
}

FAQs

Last updated on 27 Oct 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc