About five minutes. The collector runs on your stack, forwards bot, agent and AI-referral traffic only, and fails open: if we're down, your site isn't.
The collectors ship with our first design partners. The snippets show the shape of the install; exact names may change before release.
Install in three steps
01
Set your keys
Your workspace shows an ingest key once, when you create it. Keep it in your secrets manager. We recommend setting the hash secret too. Generate it yourself with openssl rand -hex 32; we never see it. It is also what lets us tell real AI crawlers from fakes on your site. Without it we group callers less precisely and cannot check crawlers that claim to be a well-known AI bot. We never see a visitor's address or can derive one from the hash; the only full IPs we receive belong to crawlers claiming to be a known AI bot, so we can check them.
$ npx wrangler secret put PRIMETRA_INGEST_KEY$ npx wrangler secret put IP_HASH_SECRET$ npx wrangler deploy
Runs inside ctx.waitUntil, so it adds no latency to your responses.
Any error inside the collector is swallowed. Your site never notices.
Next.js middleware
@primetra/collector-nextAbout 5 minutes
Next.js apps on Vercel or anywhere else.
How Next.js middleware fits in
Sent to Primetra
Bots, agents, AI referrals, and non-browser API and MCP calls
Method, path without the query string, status, size and latency
A truncated, hashed IP prefix
Never leaves your stack
Ordinary visitors browsing your site
Query strings, cookies and auth headers
Request and response bodies
Full IPs, except for a claimed vendor bot
01Install the package
bash
$ npm install @primetra/collector-next
02Add it to your proxy
Next.js 16 calls this file proxy.ts. On older versions it's middleware.ts.
proxy.ts · illustrative
import { primetraMiddleware } from "@primetra/collector-next";// Already have a proxy? Wrap it instead: export default withPrimetra(yourProxy);export default primetraMiddleware();export const config = { matcher: ["/((?!_next/static|_next/image|favicon.ico).*)"],};
03Set the environment variables
Add the three variables from “Set your keys” to your hosting provider, then redeploy.
Sends in the background, after your response is on its way.
Vercel log drains don't include request headers. Use the middleware, not a drain, if you want bot verification.
MCP SDK
@primetra/mcpAbout 5 minutes
Your own MCP server. Needed for “got data” and “came back”.
How MCP SDK fits in
Sent to Primetra
Method, tool, client and duration
Outcome: data, empty, error or rejected
A truncated, hashed IP prefix
Never leaves your stack
Tool arguments (redacted capture is opt-in and stays on your server)
Tool results
Full IPs
01Install the package
bash
$ npm install @primetra/mcp
02Instrument your server
One call after you register your tools. It never changes your tool schemas.
server.ts · illustrative
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";import { instrument } from "@primetra/mcp";const server = new McpServer({ name: "your-server", version: "1.0.0" });// ...register your tools...instrument(server, { ingestKey: process.env.PRIMETRA_INGEST_KEY!, endpoint: process.env.PRIMETRA_INGEST_URL, ipHashSecret: process.env.IP_HASH_SECRET,});
Tool arguments are never sent by default. Redacted capture is opt-in and, today, local only: it labels probe calls on your server and sends the label, not the values.
It records method, tool, client, duration and outcome (data, empty, error, rejected).
What leaves your stack
Sent to us
Requests from bots and agents
Visits that arrive from an AI assistant's answer (AI referrals): its referrer, or a utm_source the assistant documents (only the assistant's name is sent, never the query, and then not the referrer). With AI_REFERRAL_MODE=count_only, only an hourly count per assistant and page
Calls to your API and MCP paths from anything that isn't a browser, which can include your own scripts and apps
Time, method, path without the query string, status, size and latency
User agent and bot signature headers
Country (edge collectors) and, on Cloudflare, the network (ASN), from your platform's own lookup; sent with or without the hash secret
A truncated IP prefix, hashed under a secret only you hold. Without it, no IP prefix or hash is sent
Referrer host, and MCP method, tool, client and outcome
Which collector sent it, and whether the request was a signup
Never sent
Ordinary visitors browsing your site
Query strings, cookies and auth headers
Request and response bodies
MCP tool arguments (redacted capture is opt-in and stays on your server)
One exception: when a user agent claims to be a known vendor bot that publishes its addresses (GPTBot, Googlebot, ClaudeBot), the collector sends the full IP so we can check it against the vendor's published ranges. Our queue holds it only until that check; it is never stored.