// the find
microsoft/clarity
A behavioral analytics library that uses dom mutations and user interactions to generate aggregated insights.
Microsoft's open-source behavioral analytics SDK — the same capture library that powers clarity.microsoft.com. It records DOM mutations, pointer events, and user interactions, then lets you replay sessions pixel-perfectly. Four focused packages: capture (clarity-js), server-side decode, visualization, and a devtools extension for live capture during development.
Clean package separation means you can embed just clarity-js and pipe the encoded stream anywhere — you're not forced into Microsoft's ingestion pipeline. Privacy masking is on by default before any data leaves the browser, not a config flag you have to remember to flip. Production-proven at Microsoft scale, so the performance budget decisions in task.ts and throttle.ts reflect real-world constraints rather than theoretical ones. The devtools extension for generating live captures against any site in-browser is genuinely useful for debugging what gets recorded.
Self-hosting is effectively undocumented — you get the capture and replay primitives but zero guidance on building the ingestion endpoint, storage, or aggregation layer. The 'open source behavioral analytics' framing is misleading: the actual product with heatmap dashboards and session search lives at clarity.microsoft.com behind Microsoft's servers. Test coverage is thin for a library that monkeypatches DOM events at scale — three test files in clarity-js covering consent, hashing, and time. Still using tslint, which was deprecated in 2019 and archived; slow tooling maintenance is a warning sign for an instrumentation library where edge-case correctness matters.