← Back to dashboard

Help · Connect YouTube

TL;DR: Creators never paste a YouTube API key. Sign in to SnapCinema, open the dashboard, click Connect YouTube, sign in with Google, approve OAuth, and confirm your channel appears under Social accounts. Operators configure GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, redirect URIs for /api/youtube/callback, and encryption for stored tokens.

Last updated: May 2026.

Connect YouTube to SnapCinema

This guide explains what creators do in Google to link a channel, and what you (the app operator) configure once per environment. The dashboard links here: Help → Connect YouTube (/help/connect-youtube).


For creators: what you do on YouTube / Google

You do not create a YouTube API key or paste secrets into SnapCinema. You connect your channel with Google sign-in (OAuth).

  1. Log in to SnapCinema with your usual sign-in (for example magic link).
  2. Open the Dashboard.
  3. Under Social accounts, click Connect YouTube.
  4. Google opens in your browser. Pick the Google account that owns or manages the YouTube channel you want to use.
  5. Review the permissions SnapCinema requests (for example read channel information and upload). Choose Allow to finish.
  6. You should return to the dashboard; your channel avatar and title should appear under Social accounts.

Multiple YouTube channels under one Google account

One Connect YouTube / Google sign-in covers every channel that YouTube returns as “yours” for that Google account. If you have more than one channel, the dashboard shows a channel menu: choose which channel analytics (and related jobs) should use. You do not need to reconnect to switch—only to re-authorize or change the linked Google account (Reconnect YouTube resets the selection to the default channel from Google).

If something goes wrong

  • Wrong Google account: Sign out of Google in that browser tab, or use a private/incognito window, then click Connect YouTube again and choose the correct account.
  • “Access blocked” or consent errors: Your Google account or a Google Workspace admin may block third-party apps. Try a personal Google account, or ask your admin to allow this app’s OAuth client.
  • Errors about redirect URL or “mismatch”: That is almost always fixed on the server side by the person running SnapCinema (see For operators below). Send them the exact error message.

What you are not asked to do

  • You do not need a YouTube Data API key in the product. API keys for public features are configured only on the server by the operator.

For operators: deploy and configure (step by step)

  1. Merge and deploy to production so these routes work on your real domain: /api/youtube/start, /api/youtube/callback, and the dashboard.
  2. Set environment variables on your host (for example Vercel), at minimum:

- GOOGLE_CLIENT_ID - GOOGLE_CLIENT_SECRET - TOKEN_ENCRYPTION_KEY (encrypts stored OAuth tokens) - NEXT_PUBLIC_APP_URL — your canonical site URL with no trailing slash (for example https://www.example.com). This should match the URL users actually use. - `POSTGRES_PRISMA_URL` (or link Vercel ↔ Supabase) and your Supabase keys (and any other vars your deployment already needs).

  1. Google Cloud Console (same or separate project per environment):

- Enable YouTube Data API v3. - Go to APIs & Services → Credentials → Create credentials → OAuth client ID → type Web application. - Under Authorized redirect URIs, add exactly: - https://<your-production-domain>/api/youtube/callback - For local development: http://localhost:3000/api/youtube/callback (change the port if your dev server uses another). - Copy the Client ID and Client secret into GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET.

  1. OAuth consent screen: Add your app name, support email, and the scopes your app uses. If you move out of testing mode with sensitive scopes, you may need Google verification.
  2. Database: Run Prisma migrations in production so tables for linked YouTube accounts exist (see your schema, for example YoutubeAccount).
  3. Optional — analytics / public API calls only: Set `YOUTUBE_DATA_API_KEY` on the server, restricted in Google Cloud to YouTube Data API v3 (and IP or referrer if you can). Creators never paste this; it is for server-side public calls such as trending or search.
  4. Verify: Sign in on production, open the dashboard, click Connect YouTube, complete Google consent, and confirm the channel name appears.

Quick reference

ItemWhoPurpose
Connect YouTube (dashboard)CreatorOAuth link to their channel
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRETOperatorOAuth client for that flow
YOUTUBE_DATA_API_KEYOperatorServer-only public Data API usage

See also the repository root file .env.example for variable names and comments.