# microsoft/clarity

A behavioral analytics library that uses dom mutations and user interactions to generate aggregated insights.

Repository: https://github.com/microsoft/clarity
Canonical: https://ross.abutalabs.com/products/microsoft-clarity
Homepage: https://clarity.microsoft.com
Language: TypeScript
License: MIT
License Family: permissive
Topics: clarity, session-replay, heatmap
Last push: 2026-08-24T22:58:04+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 35, longevity 100
- inputs: {"age_days": 2316, "days_push": 9, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2722, forks 280 (observed 2026-08-28T04:07:15.614073+00:00)

## What it is
Microsoft Clarity is an open-source behavioral analytics library written in TypeScript that tracks DOM mutations and user interactions to generate session replays and heatmaps. It powers Microsoft's hosted Clarity product and emphasizes privacy (data masking) and performance.

## Use cases
- record and replay user sessions on my website
- generate heatmaps of where users click and scroll
- understand how users navigate and interact with my site
- self-host behavioral analytics with privacy masking
- debug user experience issues by watching real sessions
- capture live user interactions with a browser devtools extension

## When to choose
- you need privacy-first session replay and heatmap analytics you can inspect or self-host
- you want the same instrumentation code that powers Microsoft's hosted Clarity product
- you need lightweight client-side tracking that works across modern browsers and devices

## When to avoid
- you need a turnkey hosted dashboard with AI insights - use clarity.microsoft.com instead of the raw library
- you need server-side or backend analytics rather than client-side user behavior
- you need full-featured product analytics like funnels and cohorts out of the box - the open-source repo provides instrumentation, decode, and visualization packages rather than a complete platform

## Facets
- artifact type: library
- maturity: active
- function: analytics, monitoring, developer-tools
- domain: analytics, web-development, frontend, privacy
- platform: browser
- tags: session-replay, heatmap, behavioral-analytics, user-experience, dom-mutation-tracking, privacy-first, product-analytics, web-server, nodejs, typescript

## Member repositories
- microsoft/clarity (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:15.614073+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:15:11.654695+00:00, confidence not recorded.
  - readme: https://github.com/microsoft/clarity (fetched 2026-08-28T04:07:15.614073+00:00, sha 07a507d05bde)
  - homepage: https://clarity.microsoft.com (fetched 2026-08-29T09:58:34.668664+00:00, sha 958a35368177)
  - site_page: https://docs.microsoft.com/en-us/clarity (fetched 2026-08-29T09:58:34.690639+00:00, sha f80c0391b64a)
  - site_page: https://clarity.microsoft.com/session-recordings (fetched 2026-08-29T09:58:34.678331+00:00, sha d47b93e92715)
  - site_page: https://clarity.microsoft.com/heatmaps (fetched 2026-08-29T09:58:34.680495+00:00, sha 0371012b0185)
  - site_page: https://clarity.microsoft.com/copilot (fetched 2026-08-29T09:58:34.682204+00:00, sha 544ab1b34748)
  - site_page: https://clarity.microsoft.com/ai-visibility (fetched 2026-08-29T09:58:34.683777+00:00, sha 44d4fb95e373)
  - site_page: https://clarity.microsoft.com/brand-agents (fetched 2026-08-29T09:58:34.685266+00:00, sha 1e34fc671f82)
  - site_page: https://clarity.microsoft.com/integrations (fetched 2026-08-29T09:58:34.686804+00:00, sha b7a23c1dbea3)
  - site_page: https://clarity.microsoft.com/mobile-apps (fetched 2026-08-29T09:58:34.689185+00:00, sha c66777b58017)
- Data as of 2026-08-30T08:39:29.467469+00:00.
