Introduction

OakData is web analytics built for the agent era — one snippet to instrument, one MCP to query. Start here.

OakData is first-party web analytics built for the agent era. You drop one snippet into your site and OakData captures pageviews, autocaptured clicks, web vitals, errors, sessions, and — optionally — session replay. Then you read it all back two ways: a REST API for your own tooling, and a Model Context Protocol (MCP) server that 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. It tracks events, identifies users, and records sessions. See the quickstarts to install it, and the SDK reference for the full API.
  • 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 can call directly.

How tracking works

After oak.init(), the browser SDK batches events and POSTs them to OakData's ingest endpoint. Each event is stamped with a sticky session, a distinct id, and contextual properties. The server classifies bots, enforces rate limits and plan quotas, and stores the result. Everything is then 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. Never expose a secret key in client code.

Where to go next