# Quickstart

From zero to a SQL-free answer about your traffic in five minutes. You need an email address and a website you can edit.

## 1. Create an account

Enter your email on the [home page](https://capless.sh/#signup) or call the signup API yourself:

```sh
curl -s https://api.capless.sh/v1/signup \
  -d '{"email":"you@example.com","siteName":"my-site","allowedOrigins":["https://example.com"]}'
```

The response contains everything you need. Save `apiKey`: it is shown once.

```json
{
  "user": { "id": "…", "email": "you@example.com" },
  "project": { "id": "prj_…", "name": "…", "plan": "trial", "trialEndsAt": "…" },
  "apiKey": "cpl_…",
  "site": { "key": "cs_…", "snippet": "<script async src=\"https://c.capless.sh/c.js\" data-site=\"cs_…\"></script>" },
  "dashboardUrl": "https://app.capless.sh/…",
  "mcp": { "url": "https://mcp.capless.sh/mcp", "headers": { "Authorization": "Bearer cpl_…" } }
}
```

* `dashboardUrl` is a one-time sign-in link, valid for 15 minutes. Later, sign in at [app.capless.sh/login](https://app.capless.sh/login).
* We send a verification email. Your 14-day trial starts now, no credit card.
* `409 email_taken` means you already have an account: [log in](https://app.capless.sh/login) instead.

## 2. Add the snippet

Paste the snippet into every page, right before `</head>`:

```html
<script async src="https://c.capless.sh/c.js" data-site="cs_…"></script>
```

That's it: pageviews, clicks, form submits, errors, Web Vitals and session replays are collected automatically. Single-page apps are detected (`pushState`, back/forward). See [Web SDK](https://capless.sh/docs/web-sdk.md) for custom events and user identification.

## 3. Check that data arrives

Open your site in a browser, then read the newest events:

```sh
export CAPLESS_API_KEY=cpl_…
curl -s https://api.capless.sh/v1/streams/web.events -H "authorization: Bearer $CAPLESS_API_KEY"
# → {"name":"web.events","entryCount":3,"lastCommittedAt":"…", …}

curl -s https://api.capless.sh/v1/streams/web.events/read -H "authorization: Bearer $CAPLESS_API_KEY" \
  -d '{"filter":"entry.type == \"pageview\"","map":"{\"path\": entry.path, \"at\": entry.timestamp}"}'
```

Or open the dashboard at [app.capless.sh](https://app.capless.sh) to watch sessions and replays.

## 4. Ask questions

* **From your coding agent**: [connect the MCP server](https://capless.sh/docs/mcp.md) and ask "which pages had the most rage clicks this week?".
* **With CEL**: filter and reshape events server-side on `/read` ([CEL functions](https://capless.sh/docs/cel.md)).
* **With SQL** (Team plan): [materialize](https://capless.sh/docs/materializations.md) `web.events` into ClickHouse and run real SQL.

## Track your own events

```js
capless("track", "checkout_started", { plan: "pro" });
capless("identify", "user_42", { email: "jane@example.com" });
```

Custom events are `type: "custom"` records with `name` and `properties` in the same `web.events` stream.
