Skip to content

Installation

There are three ways to install RepoWidget. Choose the one that fits your workflow.

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:

Terminal window
npm install repo-widget

Then import in your JavaScript or TypeScript file:

import { createRepoWidget } from 'repo-widget';

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>

After adding the script, open your browser’s developer console and type:

typeof createRepoWidget

If it returns "function", the widget loaded correctly.