Changelog
The highseat package, with a proxy on your own domain
- Developers
- Install
import { createProxy } from "highseat/next"const proxy = createProxy({ clientIp: "vercel" })export { proxy as GET, proxy as POST }
npm install highseat gives a site everything it needs to talk to Highseat, typed. Render <Highseat /> from highseat/react or highseat/next, or call inject() anywhere else. track() knows the built-in events, such as signup and purchase. Declare your own events, and in strict mode a misspelt event name fails the type check.
Calls made before the tracker loads wait for it, and no call ever throws.
A proxy on your own path
createProxy() serves the tracker and forwards events from a path on your own domain, so a filter list that blocks Highseat's host doesn't block your site. It passes on each visitor's IP under your site secret, which keeps countries right, and Highseat drops the IP once it has looked up the country.
In Next.js, one route file holds the proxy and withHighseat() in next.config.ts points your proxy path at it. highseat/proxy has the same handler for any runtime with fetch, with guides for TanStack Start, Cloudflare Workers and Pages, Netlify, Vercel, Astro, Hono and nginx. Every test runs on Node, Bun and Cloudflare's workerd.
Improvements
- Server-side events sent with your site secret count as visits instead of being dropped.
- A 404 counts once per page path, and it is sent the moment the page loads.