Elestia Open Source Ratings
8.2

PostHog JS

A strong pick. 1st of 9 product analytics SDKs.

posthog-js is the browser SDK for PostHog, an open-source analytics platform that you can self-host. One script gives you autocapture, custom events, session replay, feature flags, experiments and surveys. Today it is the strongest all-round pick in this category for teams willing to use PostHog's backend. Its supply-chain record carries a real scar from November 2025.

Best for: Engineering-led teams that want product analytics, session replay and feature flags from one open-source SDK and service.

WebsiteGitHubnpm

Scores

Overall8.2

How strongly do we recommend it for a new project today?

Claude Opus 5.5: 8.0, likely 7.0 to 9.0

It is the most capable and fastest-growing SDK here, and it is backed by an open-source, well-funded platform. That makes it a strong pick for most new web products that want analytics. Pin versions, given the 2025 supply-chain incident and the daily releases. Pick Plausible or Vercel Analytics if you only need lightweight page analytics.

GPT-6.2 Sol: 8.3, likely 7.3 to 9.1

PostHog JS is a strong first choice for new web products that want event tracking, replay, and flags in one integration. Plausible is a better fit for teams that mainly need lightweight traffic analytics, and buyer feedback puts PostHog alongside Amplitude and Mixpanel for full product analytics. The browser SDK migration and the recent npm compromise keep it short of a clear default across the category.

Needed by many6.8

How many developers need a tool for this job?

Claude Opus 5.5: 7.0, likely 6.0 to 8.0

Most teams building web apps or SaaS products want product analytics. PostHog's all-in-one take, with replay and flags, fits a large share of them. The package covers the browser only, while Node and React Native use separate packages, so it is a little narrower than the category.

GPT-6.2 Sol: 6.6, likely 5.5 to 7.6

Product event tracking serves a large group of JavaScript and TypeScript teams building user-facing web apps. The SDK works across major frontend frameworks and plain JavaScript, while server-side tracking uses a separate SDK. Developer surveys establish how common browser development is, but leave the share of projects that need full product analytics uncertain.

Helps a lot8.4

How well does it do the job for those who need it?

Claude Opus 5.5: 8.0, likely 7.0 to 9.0

No peer SDK has a wider feature set. It has autocapture, replay, flags, experiments and surveys, plus typed APIs and strong docs. Users praise session replay and flag propagation. The limits are bundle weight, a reported replay memory leak, and the complexity that comes with so many features.

GPT-6.2 Sol: 8.7, likely 7.7 to 9.5

Stable version 1.453.2 combines autocapture, explicit events, identity, replay, and flags in one client. Its types, setup examples, and debug mode give developers and coding agents a clear path for basic instrumentation, while consent and route tracking still depend on configuration. An independent page-load test found the standard script substantially heavier than Plausible, and a user confirmed that an SDK update fixed a replay slowdown in their app. Performance varies by bundle and feature set, and the available measurements cover specific setups.

Holds up over time8.1

Will it still be a good choice in two years?

Claude Opus 5.5: 8.5, likely 7.5 to 9.5

Activity is very high: 2,935 commits, 3,674 merged PRs in total, 251 contributors, and a push on the day we read the data. A company raised a $75M Series E in 2025 and pays for the work. The very fast release cadence is the main risk, because it raises the chance of regressions.

GPT-6.2 Sol: 7.7, likely 6.5 to 8.8

PostHog staffs a dedicated SDK team with rotating support, and the browser package shipped 569 versions in the past year. The repository-wide commit and release totals also include other SDKs and tools. Dated configuration defaults let teams adopt behavior changes on their own schedule. PostHog is preparing @posthog/browser v2 and tracking migration gaps, which leaves the current package's two-year support outlook uncertain.

Used widely7.6

How many use it, and is that growing?

Claude Opus 5.5: 8.0, likely 7.0 to 9.0

It has about 101M downloads in 4 weeks, up 12x on a year before, which is well above the 4.1 median ratio. That is the most in the category. Part of that is probably CI installs and other tools that pull it in. Its 2,707 dependent repos lead every peer except Vercel Analytics (18,078), which supports real and growing direct use.

  • npm downloadsLast4Weeks: 101M, against 8.4M a year ago
  • medianDownloadsRatio: 12x growth against a 4.1 median
  • dependents repos: 2,707, second to Vercel Analytics

GPT-6.2 Sol: 7.2, likely 6.1 to 8.3

Four-week npm downloads rose from 8.35 million to 101.25 million, or 12.1×, well above the catalog's 4.1× baseline. Ecosyste.ms found 2,707 dependent repositories, more than Mixpanel, Amplitude, or Segment in this sample and far fewer than Vercel Analytics. FirstSited detected PostHog on about 80,000 sites at launch since April, and Ramp reports rising adoption among buyers in its category. Automated installs and React wrappers inflate npm counts, while script-tag installs bypass npm, so the direct project count remains an estimate.

Vouched for7.3

Who stands behind it being good?

Claude Opus 5.5: 7.0, likely 6.0 to 8.0

More than 1,000 G2 reviews average about 4.5, and many startups run it in production. Even its rival Amplitude describes it as the engineer-focused all-in-one choice. Stripe led a funding round. There is no independent survey data for this category, and many comparisons are written by vendors, which keeps the score below 8.

GPT-6.2 Sol: 7.6, likely 6.5 to 8.7

Langfuse lists the browser SDK in its web app, and Linear names PostHog as a product analytics provider. Alium's buyer interviews describe engineering teams using the combined analytics and replay workflow and rate the platform roughly alongside Amplitude and Mixpanel. That feedback is mostly about the platform, so there is less direct evidence about long-term satisfaction with this browser package.

Safe6.4

How safe is it to depend on?

Claude Opus 5.5: 6.0, likely 4.5 to 7.5

Version 1.297.3 shipped the Shai-Hulud 2.0 credential-stealing worm in November 2025, through a CI workflow flaw. PostHog pulled it within hours and published a post-mortem. It moved to npm trusted publishing and disabled install scripts in CI. The Scorecard is 7.9, with weak branch protection and a weak security policy. The licence is permissive and there are 10 dependencies, but the incident is recent and serious.

GPT-6.2 Sol: 6.7, likely 5.5 to 7.9

The November 2025 compromise affected npm version 1.297.3, which PostHog removed within about five hours of publication before moving to trusted publishing and requiring security review for workflow changes. The older cross-site scripting issue was patched in 1.57.2. The package uses permissive Apache-2.0 AND MIT terms, and the current SDK can verify runtime extensions or use a build that avoids loading them. Ten direct dependencies, optional runtime scripts, and weak branch protection and security policy checks on a 7.9 OpenSSF Scorecard keep the range wide.

Good

  • One SDK covers analytics, autocapture, session replay, feature flags, experiments, surveys and heatmaps.
  • Very active development: about 2,900 commits a year, 251 contributors and a well-funded company behind it.
  • Ships TypeScript types and has thorough docs, a slim bundle and lazy-loaded extensions to cut its weight.
  • The PostHog backend is open source and can be self-hosted, unlike the Mixpanel, Amplitude and Segment services.

Bad

  • Version 1.297.3 was published with the Shai-Hulud 2.0 worm in November 2025, after a CI workflow flaw.
  • The full bundle is heavy (roughly 50 KB or more) next to tiny trackers like Plausible or Vercel Analytics.
  • Releases ship several times a day (569 versions a year), so behaviour changes such as consent defaults can slip in unnoticed.
  • Ties you to PostHog's backend, unlike vendor-neutral layers such as Analytics or RudderStack.

The numbers

npm downloads, 4 weeks
101M ×12 in a year
GitHub stars
649
Commits, 12 months
2.9k
npm version
1.453.2 Nov 2026
Versions, 12 months
569
Advisories, 24 months
1 of 2 ever
OpenSSF Scorecard
7.9 out of 10, Nov 2026
Licence
(Apache-2.0 AND MIT)

Read on 21 November 2026 from GitHub (PostHog/posthog-js), npm (posthog-js), OSV and the OpenSSF Scorecard.

Product analytics SDKs

  1. 8.2PostHog JS
  2. 7.3Amplitude SDK
  3. 7.3Plausible tracker
  4. 7.0Mixpanel SDK
  5. 6.8RudderStack SDK
  6. 6.5OpenPanel
  7. 6.5Segment Analytics.js
  8. 6.2Vercel Analytics
  9. 4.9Analytics
Compare all 9 on six scores