{
 "kind": "tool",
 "slug": "posthog-js",
 "path": "tools/posthog-js/",
 "name": "PostHog JS",
 "maker": null,
 "density": "basic",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Logging, monitoring and analytics",
   "tools/observability-analytics/"
  ]
 ],
 "lead": "Automatic event capture and product analytics SDK for JavaScript applications.",
 "chips": [
  {
   "label": "Logging, monitoring and analytics",
   "path": "tools/observability-analytics/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install posthog-js"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/PostHog/posthog-js"
  },
  {
   "label": "Website",
   "href": "https://posthog.com/docs/libraries/js"
  },
  {
   "label": "API page",
   "path": "apis/posthog/"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "(Apache-2.0 AND MIT)",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/PostHog/posthog-js"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 24, 2026",
   "note": "Latest GitHub release Nov 23, 2026. ",
   "src": "https://github.com/PostHog/posthog-js"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "68 projects",
   "status": "info",
   "sub": "#8 of 121 in its category",
   "note": "Dependency in 68 public GitHub projects set up for AI coding agents that we scanned (1.1%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What PostHog JS does",
   "parts": [
    {
     "t": "prose",
     "text": "Automatic event capture and product analytics SDK for JavaScript applications."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "PostHog JS popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "62",
       "of": "/ 100",
       "l": "Gid Score, #915 overall"
      },
      {
       "n": "28.4M",
       "l": "downloads a week, npm"
      },
      {
       "n": "671",
       "l": "GitHub stars"
      },
      {
       "n": "68",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How PostHog JS is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "PostHog JS is a dependency in 68 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (1.4% of the 4,867 JavaScript/TypeScript ones), #8 of 121 in logging, monitoring and analytics.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 200; those are left out of every share on this page.",
      "The most used alternative in our scan is Vercel Analytics (226 projects).",
      "Projects that use it most often also use Tailwind Merge (70.6%), clsx (72.1%), React (91.2%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "48 projects, 1.5%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "35 projects, 1.4%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "24 projects, 0.8%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "9 projects, 1.9%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "6 projects, 2.2%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 70.6% of its projects",
       "v": "Tailwind Merge",
       "path": "tools/tailwind-merge/"
      },
      {
       "l": "In 72.1% of its projects",
       "v": "clsx",
       "path": "tools/clsx/"
      },
      {
       "l": "In 91.2% of its projects",
       "v": "React",
       "path": "tools/react/"
      },
      {
       "l": "In 91.2% of its projects",
       "v": "Tailwind CSS",
       "path": "tools/tailwindcss/"
      },
      {
       "l": "In 70.6% of its projects",
       "v": "Lucide React",
       "path": "tools/lucide-react/"
      },
      {
       "l": "In 57.4% of its projects",
       "v": "Testing Library",
       "path": "tools/testing-library/"
      },
      {
       "l": "In 60.3% of its projects",
       "v": "Class Variance Authority",
       "path": "tools/class-variance-authority/"
      },
      {
       "l": "In 60.3% of its projects",
       "v": "Playwright (JavaScript)",
       "path": "tools/playwright-test/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about PostHog JS",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Head to head",
       "items": [
        {
         "text": "Vercel Analytics vs PostHog JS",
         "note": "used together in 14 projects",
         "path": "tools/compare/vercel-analytics-vs-posthog-js/"
        }
       ]
      },
      {
       "title": "More in Logging, monitoring and analytics",
       "path": "tools/observability-analytics/",
       "items": [
        {
         "text": "psutil",
         "path": "tools/psutil/"
        },
        {
         "text": "Vercel Speed Insights",
         "path": "tools/vercel-speed-insights/"
        },
        {
         "text": "Sentry for Next.js",
         "path": "tools/sentry-nextjs/"
        },
        {
         "text": "OpenTelemetry",
         "path": "tools/opentelemetry/"
        },
        {
         "text": "Pino",
         "path": "tools/pino/"
        },
        {
         "text": "structlog",
         "path": "tools/structlog/"
        },
        {
         "text": "Loguru",
         "path": "tools/loguru/"
        },
        {
         "text": "pino-pretty",
         "path": "tools/pino-pretty/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "PostHog JS",
       "me": true,
       "facts": [
        "(Apache-2.0 AND MIT)",
        "Gid 62",
        "28.4M/wk"
       ]
      },
      {
       "name": "Vercel Analytics",
       "why": "Real-time web analytics SDK for tracking traffic and user behavior.",
       "path": "tools/vercel-analytics/",
       "facts": [
        "MIT",
        "Gid 60",
        "10.7M/wk"
       ]
      }
     ],
     "more": "Compare PostHog JS with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install posthog-js"
    },
    {
     "t": "gap",
     "text": "No step-by-step start for PostHog JS yet: we have not written its hand-checked card."
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm posthog-js"
  ],
  [
   "Category",
   "Logging, monitoring and analytics"
  ],
  [
   "License",
   "(Apache-2.0 AND MIT)"
  ],
  [
   "Gid Score",
   "61.5"
  ],
  [
   "Rank in category",
   "#8 of 121"
  ],
  [
   "GitHub",
   "PostHog/posthog-js"
  ],
  [
   "Last change",
   "Nov 24, 2026"
  ]
 ],
 "good": [],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/posthog.png"
}