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:
<script src="https://cdn.jsdelivr.net/gh/peterbenoit/RepoWidget@latest/dist/repoWidget.min.js"></script>The CDN build is always in sync with the latest release and requires no local tooling.
Install via npm (or your preferred package manager) if you’re using a bundler:
npm install repo-widgetpnpm add repo-widgetyarn add repo-widgetThen import in your JavaScript or TypeScript file:
import { createRepoWidget } from 'repo-widget';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/repo-widget/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.