OakData is first-party web analytics built for the agent era. One snippet captures what real users do - pageviews, clicks, web vitals, errors, sessions, and optionally session replay. You read that data back two ways: a REST API for your own tooling, and a Model Context Protocol (MCP) serverthat lets a coding agent like Claude or Cursor watch real users and fix what's broken without leaving the editor.
The two halves
- The SDK (
oakdata-js) runs in the browser: events, identity, sessions, replay. Install it with a quickstart; the full surface is in the SDK reference. - The read APIs serve your data back. The REST API is a plain bearer-authed JSON surface; the MCP server exposes the same data as tools an AI agent calls directly.
How tracking works
After oak.init(), the SDK batches events and posts them to the ingest endpoint. Each event is stamped with a session, a distinct id, and contextual properties. The server classifies bots, enforces rate limits and quotas, and stores the result - all queryable per project.
Two keys, two jobs
Public keys (oak_pub_…) are safe to ship in the browser and can only write events. Secret keys (oak_sec_…) stay server-side and are the only keys that can read analytics through the REST API and MCP.