> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postiz.com/llms.txt
> Use this file to discover all available pages before exploring further.

# YouTube

> How to Add YouTube to Your System

<Snippet file="never-share.mdx" />

<Note>
  Watch the YouTube Tutorial: [https://youtu.be/b8fxx6DqIAw](https://youtu.be/b8fxx6DqIAw)
</Note>

Follow the instructions as available in the [Obtaining authorization credentials](https://developers.google.com/youtube/registering_an_application).

## General Setup

<Steps>
  <Step title="Go to Credentials Page">
    Make sure you are logged in to your Google account and visit the [Credentials - APIs & Services](https://console.cloud.google.com/projectselector2/apis/credentials) page. Make sure to read the terms and conditions and "Agree and Continue".
  </Step>

  <Step title="Create Project">
    Create a new project by clicking on the "Create Project" button. Fill in the project name, and details and click "Create".
  </Step>

  <Step title="Create OAuth Credentials">
    Create credentials by clicking on the "Create Credentials" button. Select the "OAuth client ID" option.
  </Step>

  <Step title="Configure Consent Screen">
    Make sure that your consent screen has been configured.
  </Step>

  <Step title="Fill in OAuth Details">
    Create the OAuth client ID. Select "Web application" as the application type and fill in the details.

    <Snippet file="oauth2redirect.mdx" />

    **Your YouTube OAuth2 Redirect URI:**

    * Production: `https://your-postiz-domain.com/integrations/social/youtube`
    * Local development: `http://localhost:4200/integrations/social/youtube`
    * Docker: `http://localhost:5000/integrations/social/youtube`

    Under "Authorized redirect URIs", insert your OAuth2 Redirect URI.

    <img src="https://mintcdn.com/postiz/NC1G4tduhaxm8LzE/images/providers/youtube/youtube-001.png?fit=max&auto=format&n=NC1G4tduhaxm8LzE&q=85&s=ed4f80902b3cf6c9005f53eceadaf016" alt="YouTube" width="784" height="733" data-path="images/providers/youtube/youtube-001.png" />

    After following all of the steps above you should be met with a screen that shows your client ID and client secret. Add these to your providers configuration.

    ```env theme={null}
    YOUTUBE_CLIENT_ID=""
    YOUTUBE_CLIENT_SECRET=""
    ```
  </Step>

  <Step title="Add Test User">
    Add yourself as a test user of the application

    <img src="https://mintcdn.com/postiz/NC1G4tduhaxm8LzE/images/providers/youtube/YouTube-Add-Test-Users.png?fit=max&auto=format&n=NC1G4tduhaxm8LzE&q=85&s=6d7922a5a7f4f78277989e157478e9d8" alt="YouTube" width="1477" height="885" data-path="images/providers/youtube/YouTube-Add-Test-Users.png" />
  </Step>

  <Step title="Activate YouTube's API">
    Go to "Enabled APIs and Services". Then click on "Enable APIs and Services". Search "YouTube Data API v3" and activate the API by selecting it and clicking "Enable". Do the same Process with "YouTube Analytics API" and "YouTube Reporting API".

    <img src="https://mintcdn.com/postiz/NC1G4tduhaxm8LzE/images/providers/youtube/YouTube-Enabled-APIs.png?fit=max&auto=format&n=NC1G4tduhaxm8LzE&q=85&s=2faa5c8897cdec07c27389e2475e5b03" alt="Enabled APIs" width="1918" height="867" data-path="images/providers/youtube/YouTube-Enabled-APIs.png" />

    <img src="https://mintcdn.com/postiz/NC1G4tduhaxm8LzE/images/providers/youtube/Enable-APIs-and-Services.png?fit=max&auto=format&n=NC1G4tduhaxm8LzE&q=85&s=7ffb5b0e1fc5d1ccde0cd2b33e2e9eed" alt="Enabled APIs" width="1136" height="367" data-path="images/providers/youtube/Enable-APIs-and-Services.png" />
  </Step>
</Steps>

## Additional Steps for Brand Accounts

<Note>
  When using a Brand account you will need to set your APP to External and setup a test user. You do not need to publish the APP, but it does take time for the changes to propagate. You will also need to add the app to the trusted apps within your google workspace Admin.
</Note>

<Steps>
  <Step title="Go to admin.google.com">
    Sign in
  </Step>

  <Step title="Go to Security Settings">
    Go to Security → Access and data Controls → API Controls
    Click Manage Third Party App Access
  </Step>

  <Step title="Configure new App">
    Click "Configure new App"
    Put your Client ID for the app you created in previous steps into the search box and select your app
  </Step>

  <Step title="Set scopes and Google Data Access">
    Set scopes and Google Data Access for the app to Trusted
    Once set, click save
  </Step>

  <Step title="Wait for propagation">
    Wait at least 5 hours for the changes to propagate.
    After this time you should now be able to add your YouTube channel to your Postiz account
  </Step>
</Steps>
