https://github.com/bellmano/umami-github-badges
Generate GitHub badges for your Umami analytics data
https://github.com/bellmano/umami-github-badges
badge badges css github-badge github-badges html javascript umami umami-analytics website
Last synced: 2 months ago
JSON representation
Generate GitHub badges for your Umami analytics data
- Host: GitHub
- URL: https://github.com/bellmano/umami-github-badges
- Owner: bellmano
- License: mit
- Created: 2026-01-19T15:55:43.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-01-25T13:25:17.000Z (2 months ago)
- Last Synced: 2026-01-25T16:28:17.949Z (2 months ago)
- Topics: badge, badges, css, github-badge, github-badges, html, javascript, umami, umami-analytics, website
- Language: JavaScript
- Homepage: https://umami-github-badges.vercel.app
- Size: 339 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# :ramen: Umami GitHub Badges



[](https://sonarcloud.io/summary/overall?id=bellmano_umami-github-badges)
[](https://sonarcloud.io/summary/overall?id=bellmano_umami-github-badges)
[](https://sonarcloud.io/summary/overall?id=bellmano_umami-github-badges)
[](https://sonarcloud.io/summary/overall?id=bellmano_umami-github-badges)
[](https://sonarcloud.io/summary/overall?id=bellmano_umami-github-badges)
[](https://sonarcloud.io/summary/overall?id=bellmano_umami-github-badges)
[](https://sonarcloud.io/summary/overall?id=bellmano_umami-github-badges)
Generate beautiful, dynamic GitHub badges for your Umami website analytics! Show off your website traffic, page views, and visitor stats directly in your README files.
## :rocket: Quick Start
### 1. Get Your Website ID and API Key
You'll need:
- Your Website ID (found in your website settings)
- An API key (Account Settings → API keys)
**:warning: Security Notice:** Your API key will be visible in the badge URL. This means anyone can view your website analytics data (views, visitors, etc.) but cannot modify settings or access other websites. Only use badges for public websites where you're comfortable sharing traffic statistics. You can rotate your API key anytime in Umami settings.
**Note:** This service is designed for **Umami Cloud** (https://cloud.umami.is) which uses the API endpoint `https://api.umami.is/v1`. If you're self-hosting Umami, you'll need to modify the code to point to your instance.
### 2. Generate Your Badge
**Option A: Use the Web Interface**
Visit: **[umami-github-badges.vercel.app](https://umami-github-badges.vercel.app/)**
**Option B: Create URL Manually**
```
https://umami-github-badges.vercel.app/api/{metric}?website={WEBSITE_ID}&token={API_TOKEN}&range=all&style=for-the-badge&cache=0&v=1
```
### 3. Add to Your README
```markdown

```
## :bar_chart: Available Metrics
| Metric | Description | Example |
|--------|-------------|---------|
| `views` | Total page views |  |
| `visitors` | Unique visitors |  |
| `visits` | Total visits |  |
| `bounce-rate` | Bounce rate percentage |  |
| `avg-session` | Average session duration |  |
## :art: Customization Options
| 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) |
## :test_tube: Running Tests
To run the tests and view coverage:
1. Install the required dev dependency:
```powershell
npm install
```
2. Run the test coverage script:
```powershell
npm run test:coverage
```
This will execute the tests and generate a coverage report.
## :handshake: Contributing
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
## :mega: Issues or Suggestions
Any issues or suggestions, please [create an issue on Github](https://github.com/bellmano/umami-github-badges/issues).
## :coffee: Buy me a coffee
Donations are welcome to appreciate my work and to keep this project alive, but isn't required at all.
