# Install Wake

> Three steps: prove you own the host, deploy the collector on your edge or server, watch the first event land. Nothing runs in the browser.

## 0 · Or hand the whole thing to your AI

Open your desk → **Install → Give this to your AI**. Wake deep-scans the public site (how it answers GPTBot, ClaudeBot, PerplexityBot and a scripted client; the stack; llms.txt, agent card, MCP server card, OpenAPI; the site's shape by page class; docs without JavaScript; Markdown negotiation) and writes **`wake-playbook.md`**: every change the scan calls for, with the exact files generated from your own pages, where they go on your stack, the ownership tag, the collector for your stack with its key once ownership is confirmed, and a curl to verify each step. Save it in the repository and tell Claude Code, Cursor or Codex to complete every task in it. Also: `wake playbook --out wake-playbook.md`, `GET /api/wake/v1/playbook.md`, or the MCP tool `wake_playbook`.

## 1 · Ownership

Open your desk → **Install → Ownership**. Add one of:

- a DNS TXT record `_wake-verify.<host>` with the value shown, or
- the file `https://<host>/.well-known/wake-verify.txt` with the body shown,

then press **Verify now**. Either proves control of the host; nothing else is read. Ownership gates the collector keys, the readiness report and the listing plan.

## 2 · Collector

Press **Generate collector**. You get, once, an ingest key and three deploy-ready files that already carry it:

| File | Where it runs |
|---|---|
| `cloudflare-worker.js` | A Cloudflare Worker route in front of your origin (recommended; zero latency, `waitUntil`). |
| `express.js` | Express / Connect middleware on Node ≥ 18. |
| `nextjs-middleware.js` | Next.js `middleware.ts` on the Edge runtime. |

What the collector sends, per agent request: timestamp, method, **page class**, status code, the user-agent (used only to label the operator family, then discarded), a country code if your platform provides one, and an **opaque per-agent hint** computed from the client address with **your** site secret. The raw IP never leaves your infrastructure. No query string, body, cookie or referrer is ever sent.

You can also fetch the kit from a terminal once a key exists ([CLI](/wake/docs/cli)):

```bash
wake install --kit --out ./wake-collector
```

Rotating keys mints a new ingest key and site secret; the deployed collector stops until you redeploy, and nicknames restart.

## 3 · First event

The Install screen checks every 10 seconds. Wake never sends test traffic on your behalf: a real agent, or you running the worker locally with an agent user-agent, produces the first event. From then on **Overview** leads with the agents that came, what they did, and what to add to the site so they can navigate it.

## Connect your AI

Under **Connect your AI** mint an API key and paste one snippet into Claude Code, Cursor, Codex or Claude Desktop. Your assistant can then ask the desk what agents did and what to fix, directly. See [MCP](/wake/docs/mcp) and [API](/wake/docs/api).

## Troubleshooting

- **401 from the ingest endpoint**: the ingest key was rotated; redeploy with the new file.
- **No events but agents visit**: check the route covers the paths agents hit (docs, API); the Worker template matches the agent user-agent list and `Sec-Fetch` signals, not browsers.
- **Readiness says agents cannot fetch the homepage**: the first HTTPS request returned a challenge or a non-200. Serve a plain 200 with HTML or Markdown for named AI clients.
