Getting started
Framework integrations
One package for Nuxt, Astro, Next.js or TanStack Start that sets up WebMCP tracking, Visitors, AI bots and API tracking together.
The browser SDK and the server SDK can each be added by hand (Framework guides, Server SDK). On these frameworks one package does both, and each key you set switches its part on:
| Key | Where it's set | What it tracks |
|---|---|---|
Public key, al_pub_… | config or a public env variable | WebMCP tool calls and Visitors, in the browser |
Server key, al_srv_… | AGENTSTATS_SERVER_KEY | AI crawlers and agents, including the ones that never run JavaScript |
API key, al_api_… | AGENTSTATS_API_KEY | calls AI agents make to your API routes |
Without keys, the packages still tell your code who's asking (isBot, isAI, category…) and send nothing.
Agents that browse in a real browser (ChatGPT agent, Google-Agent, headless browsers) get a short-lived visit cookie from the server half, and the browser half reads it, so their pageviews and WebMCP calls show up as theirs rather than as a person's.
The server half sees requests that reach your server. Pages served from a CDN cache or prerendered at build time don't, so send your host's logs with a log drain to cover them.