Clarity is a TypeScript behavioral analytics library that records DOM mutations and user interactions to explain how visitors use a site. It prioritizes privacy controls and performance and powers Microsoft’s hosted Clarity product.
Overview
Clarity is an open-source behavioral analytics library written in TypeScript. It captures how users view and interact with a website across modern browsers and devices, with stated goals around privacy and performance. The same codebase underpins Microsoft’s hosted behavioral analytics offering described on the product site.
The project is split into components: client instrumentation for sites, server-side decoding of uploaded payloads, visualization that reconstructs session replay from decoded data, and optional Chromium devtools for live captures against any site.
Sensitive content is masked by default before upload, with additional masking configuration so site owners control what is collected. Hosted Clarity features marketed on the website—such as session recordings, heatmaps, and AI summaries—sit on top of this telemetry model; the open components focus on capture, decode, and replay tooling.
Mobile app analytics are supported via a lightweight SDK for Android, iOS, Flutter, and React Native. Integrations, an MCP server, and a live browser extension extend how teams access analytics workflows.
Key features
- Client-side interaction and layout tracking
- Server decode of uploaded telemetry
- Pixel-oriented session replay visualization
- Default sensitive content masking
- Configurable privacy masking options
- Chromium devtools live capture extension
- Mobile SDKs for major app frameworks
- Privacy and performance oriented design
Use cases
- Understanding website navigation patterns
- Building self-hosted session replay pipelines
- Diagnosing UX friction via recordings
- Mobile app behavioral telemetry