View counters

View counters

Embeddable counters — as an SVG badge, an interactive widget, or raw JSON.

Create a counter in the dashboard, then embed it in one of three ways.

SVG badge (no JavaScript)

<img src="https://cdn.devlune.in/badge/YOUR_COUNTER_ID.svg" alt="views">

Interactive widget

<span data-devlune-counter="YOUR_COUNTER_ID"></span>
<script defer src="https://cdn.devlune.in/embed/view-counter.js"></script>

JSON API (style it yourself)

GET https://cdn.devlune.in/counter/YOUR_COUNTER_ID
// → { "total": 12486, "unique": 8421 }

Abuse protection

Counter increments are rate-limited per IP at the edge to keep counts honest.