nums is an open source hit counter and badge service for your website. It provides fast, serverless tracking using golang. the main purpose is to use it to increment and display website visits.
View the full documentation and api reference here
- Change
label=hitsto customize the badge text. cacheSecondscontrols update frequency (min 30s)
- Customize label, style (
style=terminalor default), background, and colors usingbg,labelColor,valueColor, andfontquery params. - Example with custom background:
For integrating into scripts or as a simple counter:
https://<your-vercel-deployment>.vercel.app/count.txt?id=home
"use client";
import { useEffect, useState } from 'react';
export function HitCounter({ id }: { id: string }) {
const [hits, setHits] = useState<number>();
useEffect(() => {
fetch(`${process.env.NEXT_PUBLIC_HIT_COUNTER_URL}/hit?id=${encodeURIComponent(id)}`, {
headers: { 'X-Auth-Token': process.env.HIT_COUNTER_SECRET_TOKEN! }
}).then(r => r.json()).then(d => setHits(d.hits));
}, [id]);
return <span>{hits ?? '…'}</span>;
}401 Unauthorized: Check your token.- Not persisting: Ensure Redis vars are correctly set.
- Badge always 0: Call
/hit?id=...at least once.
- Hosted docs: https://docs.advay.ca
- Guide + API reference (Mintlify) in
docs/(open locally withmint dev).
