Skip to content

feat(registry): add download tracking via Umami#24

Merged
jal-co merged 1 commit into
mainfrom
feat/registry-download-tracking
Apr 13, 2026
Merged

feat(registry): add download tracking via Umami#24
jal-co merged 1 commit into
mainfrom
feat/registry-download-tracking

Conversation

@jal-co

@jal-co jal-co commented Apr 13, 2026

Copy link
Copy Markdown
Owner

Adds server-side registry download tracking using Umami analytics.

Changes

  • Dynamic route handler at /r/[name] with generateStaticParams for SSG + tracking
  • Umami tracking fires on each registry download in production
  • Removed shadcn build from build script (dynamic route replaces static /public/r/ files)
  • New registry utils: getAllItemNames() and buildRegistryItemResponse()

How it works

The route uses Next.js generateStaticParams to pre-render all component routes at build time, but the route handler still runs on each request — allowing us to track downloads without sacrificing performance.

Env vars (already set in Vercel)

Every npx shadcn add https://ui.justinlevine.me/r/<component>.json will now log a registry-download event to Umami.

- Add dynamic route handler at /r/[name] with generateStaticParams
- Track registry downloads server-side via Umami API
- Remove shadcn build from build script (dynamic route replaces static files)
- Add getAllItemNames() and buildRegistryItemResponse() to registry utils
@jal-co jal-co merged commit 04e0417 into main Apr 13, 2026
2 checks passed
@jal-co jal-co deleted the feat/registry-download-tracking branch April 13, 2026 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant