Agent setup: authorize Sight MCP and ask your agent to call
get_tracking_setup. It configures this integration automatically.
Astro
Sight analytics component for Astro — wraps
@sightapp/analytics.
Part of Sight — see
sightapp/sight-backend
SPEC.md and tasks/plan.md (Track B3).
Install
Until both packages are on npm, from sibling checkouts:
Usage
Drop it once in your layout, inside <body>:
How navigation is tracked
- Plain multi-page Astro site (no
<ClientRouter />): every navigation is a full page load, so the component'sinit()call fires once per real navigation — no extra wiring needed. - With
<ClientRouter />(Astro's View Transitions router): Astro dispatchesastro:page-loadon every transition, including the initial load. This component'sinit()call already tracks that initial load, so the firstastro:page-loadfiring is deliberately skipped to avoid double-counting page 1 — every transition after that is tracked.
Not independently re-verified this session against a live Astro app with
View Transitions enabled — the guard logic is written directly from
Astro's documented astro:page-load behavior. Worth a smoke test before
depending on it for SPA-style navigation counts in production.
Verify
Serve a page with the component installed and confirm a pageview lands: