
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@goil/badge
Advanced tools
Lightweight "Made with Goil" badge widget. Drops into any HTML page, React, or Next.js project.
prefers-color-scheme) and browser language
<script src="https://cdn.goil.app/badge/goil-badge.iife.min.js"></script>
With config (set before the script tag):
<script>
window.GoilBadgeConfig = {
variant: 'auto', // 'dark' | 'light' | 'auto' (default: 'auto')
lang: 'auto', // 'en' | 'es' | 'ca' | 'auto' (default: 'auto')
position: 'bottom-right', // 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'
zIndex: 9999,
};
</script>
<script src="https://cdn.goil.app/badge/goil-badge.iife.min.js"></script>
npm i @goil/badge
import { GoilBadge } from '@goil/badge/react'
export default function Layout({ children }: { children: React.ReactNode }) {
return (
<>
{children}
<GoilBadge variant="auto" lang="auto" />
</>
)
}
The React component renders inline. Wrap it in your own positioned container if you need it fixed.
import { createGoilBadge } from '@goil/badge'
const { element, destroy } = createGoilBadge({ variant: 'auto', lang: 'auto' })
document.body.appendChild(element)
// later
destroy()
interface GoilBadgeOptions {
variant?: 'dark' | 'light' | 'auto' // default: 'auto'
lang?: 'en' | 'es' | 'ca' | 'auto' // default: 'auto'
}
| variant | Background. auto follows prefers-color-scheme and updates live. |
| lang | Caption language. auto reads navigator.language (falls back to en). |
pnpm install
pnpm dev # Vite dev server with live-reloading demo
pnpm build # Builds dist/ — ESM + CJS + IIFE + .d.ts
pnpm typecheck # tsc --noEmit
Project layout:
src/
core.ts — Vanilla createGoilBadge() — single source of truth, uses Shadow DOM
react.tsx — React wrapper (mounts the vanilla badge via useEffect)
script.ts — IIFE entry — auto-mounts with window.GoilBadgeConfig
index.ts — npm main entry (vanilla)
demo/
index.html — Vite dev preview
main.ts
Two Vite configs:
vite.config.ts — library build (ESM + CJS for index and react), plus the dev servervite.script.config.ts — IIFE/minified bundle for the <script> tagdist/
index.js / index.cjs / index.d.ts — vanilla npm entry
react.js / react.cjs / react.d.ts — React wrapper
goil-badge.iife.min.js — CDN script
Published as @goil/badge on npm. The ./script subpath resolves to the IIFE for self-hosted CDN deploys.
Versioning, CHANGELOG and publishing are automated via Changesets and GitHub Actions.
Contributor flow:
# after making your change
pnpm changeset # describe the change + pick patch/minor/major
git commit -am "feat: ..."
git push # open PR, merge to main
When the PR is merged to main, a bot opens a "Version Packages" PR that bumps the version and regenerates CHANGELOG.md. Merging that PR triggers the release workflow, which:
@goil/badge to npms3://goil-cdn/badge/v<version>/goil-badge.iife.min.js (immutable, 1y cache)s3://goil-cdn/badge/latest/goil-badge.iife.min.js (mutable, 5min cache)Consumers can pin a version:
<script src="https://goil-cdn.s3.eu-west-1.amazonaws.com/badge/v0.1.0/goil-badge.iife.min.js"></script>
…or always use the latest:
<script src="https://goil-cdn.s3.eu-west-1.amazonaws.com/badge/latest/goil-badge.iife.min.js"></script>
1. npm — Trusted Publishing (OIDC, no token)
The workflow uses npm's Trusted Publishing — short-lived OIDC tokens, no NPM_TOKEN to manage or rotate. Setup:
pnpm release (with a classic token) so the package exists on npmjs.com.@goil/badge → Settings → Trusted Publishers → Add GitHub Actions:
goil-appweb-widgets-badgerelease.ymlchangeset publish from CI gets short-lived OIDC credentials automatically and publishes provenance attestations.Requires Node ≥ 22.14 / npm CLI ≥ 11.5.1 (already pinned in the workflow).
2. AWS — OIDC role
Same pattern: no static keys, short-lived credentials via GitHub OIDC.
token.actions.githubusercontent.com (one-time per account).repo:goil-app/web-widgets-badge:ref:refs/heads/main and permission to s3:PutObject on arn:aws:s3:::goil-cdn/badge/*.3. Discord — release notifications
Create a webhook in your Discord channel and copy the URL.
4. GitHub repo settings
Settings → Actions → General → Workflow permissions: Read and write + Allow Actions to create and approve pull requests.| Kind | Name | Value |
|---|---|---|
| Secret | DISCORD_WEBHOOK_URL | Discord channel webhook for release notifications |
| Var | AWS_ROLE_ARN | IAM role assumed via OIDC (e.g. arn:aws:iam::…:role/gh-actions-badge) |
| Var | AWS_REGION | eu-west-3 (matches existing Goil infra) |
| Var | S3_BUCKET | goil-cdn |
No NPM_TOKEN, no AWS_ACCESS_KEY_ID, no AWS_SECRET_ACCESS_KEY — everything is OIDC.
MIT © Goil
FAQs
Lightweight 'Made with Goil' badge for static sites, React and Next.js
The npm package @goil/badge receives a total of 0 weekly downloads. As such, @goil/badge popularity was classified as not popular.
We found that @goil/badge demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.