<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Scott Peterson</title>
    <description>The latest articles on DEV Community by Scott Peterson (@scott_peterson_bf7b8ea3f7).</description>
    <link>https://dev.to/scott_peterson_bf7b8ea3f7</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4069073%2Fc4e511d9-415f-4681-a5e5-7a302782a56b.jpg</url>
      <title>DEV Community: Scott Peterson</title>
      <link>https://dev.to/scott_peterson_bf7b8ea3f7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/scott_peterson_bf7b8ea3f7"/>
    <language>en</language>
    <item>
      <title>Free, Zero-Dependency YouTube Website Embed (Self-Hostable PHP/JS)</title>
      <dc:creator>Scott Peterson</dc:creator>
      <pubDate>Sat, 08 Aug 2026 18:34:00 +0000</pubDate>
      <link>https://dev.to/scott_peterson_bf7b8ea3f7/free-zero-dependency-youtube-website-embed-self-hostable-phpjs-338h</link>
      <guid>https://dev.to/scott_peterson_bf7b8ea3f7/free-zero-dependency-youtube-website-embed-self-hostable-phpjs-338h</guid>
      <description>&lt;p&gt;Hey DEV community! 👋&lt;/p&gt;

&lt;p&gt;If you've ever tried to embed a dynamic YouTube channel feed, a live stream detector, or playlist carousel on a client site, you've probably run into two major issues:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Expensive SaaS widgets&lt;/strong&gt; that slap watermarks on your site unless you pay a monthly fee.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Leaking your YouTube API Key&lt;/strong&gt; directly in the frontend script.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To solve this, we built &lt;strong&gt;YT Widget&lt;/strong&gt;—a free, self-hostable, dependency-free JavaScript library that handles YouTube feeds, playlists, channel stats, and live stream status seamlessly.&lt;/p&gt;




&lt;h2&gt;
  
  
  📦 Where to Get It
&lt;/h2&gt;

&lt;p&gt;The project is fully open-source and ready for your production projects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source Code &amp;amp; Contributions:&lt;/strong&gt; &lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/scott8462" rel="noopener noreferrer"&gt;
        scott8462
      &lt;/a&gt; / &lt;a href="https://github.com/scott8462/YT-Widget" rel="noopener noreferrer"&gt;
        YT-Widget
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A free, self-hostable, dependency-free JavaScript library for embedding YouTube feeds, playlists, channel stats, single videos, and live stream status on any website.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;YT Widget — Free Open-Source YouTube Website Embed&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://github.com/scott8462/YT-Widget/LICENSE" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667" alt="License: MIT"&gt;&lt;/a&gt;
&lt;a href="https://github.com" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/34e695c6016bc2a934a96bed696e29b2f2ab562a7134d65a55d00653cd506bea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c75652e737667" alt="Version"&gt;&lt;/a&gt;
&lt;a href="https://github.com/scott8462/YT-Widget/yt-widget.js" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/8f55ef5aea13011a3bf62bc50776a147c57b71f1b11cb50252d61b48e5c88d7d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646570656e64656e636965732d7a65726f2d627269676874677265656e2e737667" alt="Dependencies"&gt;&lt;/a&gt;
&lt;a href="https://www.randsdevelopment.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/a26626a2867640f80f59f48c5bf8011d0e654e88ac4ab1a023a083152f0c723b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50726963652d313030253235253230467265652d6f72616e67652e737667" alt="Free &amp;amp; Open Source"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A free, self-hostable, dependency-free JavaScript library for embedding YouTube feeds, playlists, channel stats, single videos, and live stream status on any website — just like SociableKIT, but 100% free and open-source.&lt;/p&gt;
&lt;p&gt;Created and provided free to the developer community by &lt;strong&gt;&lt;a href="https://www.randsdevelopment.com" rel="nofollow noopener noreferrer"&gt;R&amp;amp;S Development&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;✨ Features&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;📺 &lt;strong&gt;5 Widget Types&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;feed&lt;/code&gt;&lt;/strong&gt;: Latest channel uploads grid or list&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;live&lt;/code&gt;&lt;/strong&gt;: Auto-detects live broadcasts and embeds the live player — shows a custom &lt;strong&gt;Offline Card&lt;/strong&gt; with recent uploads when offline&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;playlist&lt;/code&gt;&lt;/strong&gt;: Show videos from any YouTube playlist&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;stats&lt;/code&gt;&lt;/strong&gt;: Channel metrics cards (Subscribers, Views, Videos count)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;single&lt;/code&gt;&lt;/strong&gt;: Responsive single video player with metadata&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;🔒 &lt;strong&gt;Secure PHP Server Proxy (&lt;code&gt;proxy/&lt;/code&gt;)&lt;/strong&gt;: Keep your YouTube API key hidden server-side with built-in CORS, rate limiting, and 5-minute response caching.&lt;/li&gt;

&lt;li&gt;🎨 &lt;strong&gt;Full Color Customization&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Light &amp;amp; Dark themes&lt;/li&gt;
&lt;li&gt;Custom Accent / Button…&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;&lt;/div&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/scott8462/YT-Widget" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;

&lt;/li&gt;

&lt;li&gt;
&lt;strong&gt;Alternative Downloads &amp;amp; Mirrors:&lt;/strong&gt; &lt;a href="https://sourceforge.net/projects/yt-widget/" rel="noopener noreferrer"&gt;Download on SourceForge&lt;/a&gt;
&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  ✨ Core Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;📺 &lt;strong&gt;5 Widget Types:&lt;/strong&gt; Switch layouts instantly (&lt;code&gt;feed&lt;/code&gt; grid/list, &lt;code&gt;live&lt;/code&gt; stream detector, &lt;code&gt;playlist&lt;/code&gt; fetcher, profile &lt;code&gt;stats&lt;/code&gt;, or &lt;code&gt;single&lt;/code&gt; responsive video).&lt;/li&gt;
&lt;li&gt;🔒 &lt;strong&gt;Secure PHP Server Proxy (&lt;code&gt;proxy/&lt;/code&gt;):&lt;/strong&gt; Keeps your YouTube API key safely hidden server-side with built-in CORS, rate limiting, and 5-minute response caching.&lt;/li&gt;
&lt;li&gt;🎨 &lt;strong&gt;Full Color Customization:&lt;/strong&gt; Includes a smart &lt;strong&gt;Auto-Contrast Engine&lt;/strong&gt; for text layers, light/dark themes, and custom accent controls (&lt;code&gt;data-accent-color&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;⚡ &lt;strong&gt;Zero Dependencies:&lt;/strong&gt; Pure Vanilla JS &amp;amp; HTML5. No jQuery, no React, and no heavy layout frameworks.&lt;/li&gt;
&lt;li&gt;🎛️ &lt;strong&gt;Visual Builder Dashboard:&lt;/strong&gt; Comes with a local &lt;code&gt;index.html&lt;/code&gt; GUI to generate code parameters dynamically.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚀 Quick Start (2-Minute Setup)
&lt;/h2&gt;

&lt;p&gt;You can run this project in direct API key mode, but we highly recommend using the included &lt;strong&gt;PHP Proxy&lt;/strong&gt; to secure your credentials.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Drop the Proxy on Your Server
&lt;/h3&gt;

&lt;p&gt;Upload the &lt;code&gt;proxy/&lt;/code&gt; folder and insert your key into &lt;code&gt;proxy/config.php&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nb"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'YTW_API_KEY'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'AIzaSyXXXXXXXXXXXXXXXXXXXXXXXXX'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Add the HTML5 Embed Snippet
&lt;/h3&gt;

&lt;p&gt;Place the semantic HTML container anywhere on your site:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- YouTube Widget Container --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt;
  &lt;span class="na"&gt;data-yt-widget&lt;/span&gt;
  &lt;span class="na"&gt;data-proxy-url=&lt;/span&gt;&lt;span class="s"&gt;"https://yoursite.com/proxy/api-proxy.php"&lt;/span&gt;
  &lt;span class="na"&gt;data-channel-id=&lt;/span&gt;&lt;span class="s"&gt;"UCxxxxxxxxxxxxxxxxxxxxxx"&lt;/span&gt;
  &lt;span class="na"&gt;data-type=&lt;/span&gt;&lt;span class="s"&gt;"feed"&lt;/span&gt;
  &lt;span class="na"&gt;data-layout=&lt;/span&gt;&lt;span class="s"&gt;"grid"&lt;/span&gt;
  &lt;span class="na"&gt;data-max-results=&lt;/span&gt;&lt;span class="s"&gt;"9"&lt;/span&gt;
  &lt;span class="na"&gt;data-load-more=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- Include script before your closing body tag --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"yt-widget.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔴 The Live Stream Detector + Offline Card
&lt;/h2&gt;

&lt;p&gt;One of our favorite features is the &lt;code&gt;data-type="live"&lt;/code&gt; parameter. &lt;/p&gt;

&lt;p&gt;When your channel is &lt;strong&gt;Live&lt;/strong&gt;, it builds a responsive 16:9 player with a pulsing &lt;strong&gt;● LIVE&lt;/strong&gt; badge and counter. When you are &lt;strong&gt;Offline&lt;/strong&gt;, it renders a customized offline hero card featuring your latest video, a call to action to subscribe, and a custom 16:9 placeholder banner.&lt;/p&gt;




&lt;h2&gt;
  
  
  🤝 Open For Feedback &amp;amp; Contributions
&lt;/h2&gt;

&lt;p&gt;We built this tool under the &lt;strong&gt;MIT License&lt;/strong&gt; to give web developers an actual free tier option for website embeds. &lt;/p&gt;

&lt;p&gt;If you use it, we would love your feedback!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What features or layout modes should we add next?&lt;/li&gt;
&lt;li&gt;If you find it helpful, please consider starring the repository or throwing us a link back at &lt;a href="https://www.randsdevelopment.com" rel="noopener noreferrer"&gt;R&amp;amp;S Development&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let us know what you think in the comments below! 👇&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>php</category>
    </item>
  </channel>
</rss>
