Generate dynamic badges for your Umami website analytics! Show off your website traffic, page views, and visitor stats directly in your README files or on your website.
You'll need:
- Your Website ID (found in your website settings)
- An API key (Account Settings → API keys)
Option A: Use the Web Interface
Visit: umami-badges.vercel.app
Option B: Build the URL yourself
Default (Umami Cloud):
https://umami-badges.vercel.app/api/{metric}?website={WEBSITE_ID}&token={API_TOKEN}&range=all&style=for-the-badge&cache=0
Self‑hosted or custom domain (add umamiUrl):
https://umami-badges.vercel.app/api/{metric}?website={WEBSITE_ID}&token={API_TOKEN}&range=all&style=for-the-badge&cache=0&umamiUrl={CUSTOM_UMAMI_API_URL}
| Parameter | Description | Values |
|---|---|---|
range |
Time range for stats | 7d, 30d, 90d, all (default: all) |
style |
Badge style | flat, flat-square, for-the-badge, plastic, social |
color |
Badge color | brightgreen, green, blue, red, orange, yellow, purple, or hex codes |
label |
Custom label text | Any text (URL encoded) |
To run the tests and view coverage:
- Install the required dev dependency:
npm install
- Run the test coverage script:
npm run test:coverage
This will execute the tests and generate a coverage report.
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Any issues or suggestions, please create an issue on Github.
Donations are welcome to appreciate my work and to keep this project alive, but isn't required at all.
