Toolkit for generating sponsors images.
Create .env
file with:
; Token requires the `read:user` and `read:org` scopes.
SPONSORKIT_GITHUB_TOKEN=your_github_token
SPONSORKIT_GITHUB_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({
// Providers configs
github: {
login: 'antfu',
},
// Rendering configs
width: 800,
formats: ['json', 'svg', 'png'],
tiers: [
{
title: 'Backers',
preset: presets.base,
},
{
title: 'Sponsors',
monthlyDollars: 10,
preset: presets.medium,
},
{
title: 'Silver Sponsors',
monthlyDollars: 50,
preset: presets.large,
},
{
title: 'Gold Sponsors',
monthlyDollars: 100,
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