Toolkit for generating sponsors images.
Create .env
file with:
SPONSORKIT_TOKEN=your_github_token
SPONSORKIT_LOGIN=your_github_username
Run:
npx sponsorkit
Example Setup | GitHub Actions Setup | Generated SVG
Create sponsorkit.config.js
file with:
import { defineConfig, presets } from 'sponsorkit'
export default defineConfig({
login: 'antfu',
width: 800,
tiers: [
{
title: 'Backers',
monthlyDollars: 10,
preset: presets.base,
},
{
title: 'Sponsors',
monthlyDollars: 50,
preset: presets.medium,
},
{
title: 'Silver Sponsors',
monthlyDollars: 100,
preset: presets.large,
},
{
title: 'Gold Sponsors',
preset: presets.xl,
},
],
})
Also check the example.
You can also use SponsorKit programmatically:
import { fetchSponsors } from 'sponsorkit'
const sponsors = await fetchSponsors(token, login)
Check the type definition or source code for more utils available.
MIT License ยฉ 2022 Anthony Fu