Installation
There are three ways to install RepoWidget. Choose the one that fits your workflow.
CDN (recommended for most sites)
Section titled “CDN (recommended for most sites)”The fastest way to get started. Add this script tag before your closing </body> tag:
<!-- jsDelivr CDN (recommended) --><script src="https://cdn.jsdelivr.net/npm/repowidget/dist/repoWidget.min.js"></script>
<!-- or unpkg CDN --><!-- <script src="https://unpkg.com/repowidget/dist/repoWidget.min.js"></script> -->The CDN build is always in sync with the latest npm release and requires no local tooling.
Install via npm (or your preferred package manager) if you’re using a bundler:
npm install repowidgetpnpm add repowidgetyarn add repowidgetThen import in your JavaScript or TypeScript file:
import { createRepoWidget } from 'repowidget';ES module via CDN
Section titled “ES module via CDN”If you prefer modules without a local install:
<script type="module"> import { createRepoWidget } from 'https://cdn.jsdelivr.net/npm/repowidget/dist/repoWidget.esm.js';
createRepoWidget({ username: 'your-username', containerId: 'repo-container', });</script>Verifying the install
Section titled “Verifying the install”After adding the script, open your browser’s developer console and type:
typeof createRepoWidgetIf it returns "function", the widget loaded correctly.