# posthog-js

> Posthog-js allows you to automatically capture usage and send events to PostHog.

Latest version **1.434.11** (published 2026-09-23) · (Apache-2.0 AND MIT) license · 0 weekly downloads

## Install

```sh
npm install posthog-js
pnpm add posthog-js
yarn add posthog-js
bun add posthog-js
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; large bundle.

## Facts

| | |
|---|---|
| Version | 1.434.11 |
| Published | 2026-09-23 |
| First published | 2020-02-20 |
| Weekly downloads | 0 |
| License | (Apache-2.0 AND MIT) |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 10 |
| Unpacked size | 25.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 609 |
| Author | engineering@posthog.com |
| Maintainers | fuziontech, mariusandra, ben-posthog, timgl, rafael_posthog, fraserhopper, manoelposthog, robbie-c, gustavostrassburger, dustinbyrne, feliperalmeida, lucasheriques, frankposthog, tom-posthog, adamleithp, rauln, cat-ph, sarahxsanders, peterkirkhamposthog, ioannisj, huguespouillot |

## Links

- npm: https://www.npmjs.com/package/posthog-js
- Repository: https://github.com/PostHog/posthog-js
- Homepage: https://posthog.com/docs/libraries/js
- Issues: https://github.com/PostHog/posthog-js/issues
- npm.io page: https://npm.io/package/posthog-js

## Dependencies (10)

- [fflate](https://npm.io/package/fflate.md) ^0.4.8
- [preact](https://npm.io/package/preact.md) ^10.29.3
- [core-js](https://npm.io/package/core-js.md) ^3.49.0
- [dompurify](https://npm.io/package/dompurify.md) ^3.4.13
- [web-vitals](https://npm.io/package/web-vitals.md) ^6.2.1
- [@posthog/core](https://npm.io/package/@posthog/core.md) ^1.55.1
- [@posthog/types](https://npm.io/package/@posthog/types.md) ^1.412.4
- [web-vitals-soft-navs](https://npm.io/package/web-vitals-soft-navs.md) npm:web-vitals@6.2.1
- [@posthog/browser-common](https://npm.io/package/@posthog/browser-common.md) ^0.9.0
- [query-selector-shadow-dom](https://npm.io/package/query-selector-shadow-dom.md) ^1.0.1

## Recent versions

- 1.434.11 (latest) — 2026-09-23
- 1.297.4 (previous) — 2025-11-24
- 1.236.8-alpha.0 (alpha) — 2025-04-28
- 1.8.0-beta.1 (beta) — 2020-12-11
- 1.434.10 — 2026-09-23
- 1.434.9 — 2026-09-22
- 1.434.8 — 2026-09-22
- 1.434.7 — 2026-09-22
- 1.434.6 — 2026-09-22
- 1.434.5 — 2026-09-21
- 1.434.4 — 2026-09-21
- 1.434.3 — 2026-09-21
- 1.434.2 — 2026-09-18
- 1.434.1 — 2026-09-18
- 1.434.0 — 2026-09-17
- … 1408 more at https://npm.io/package/posthog-js/versions

## README

<p align="center">
  <img alt="posthoglogo" src="https://user-images.githubusercontent.com/65415371/205059737-c8a4f836-4889-4654-902e-f302b187b6a0.png">
</p>
<p align="center">
  <img alt="GitHub contributors" src="https://img.shields.io/github/contributors/posthog/posthog"/>
  <a href='http://makeapullrequest.com'><img alt='PRs Welcome' src='https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=shields'/></a>
  <img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/posthog/posthog-js"/>
  <img alt="GitHub closed issues" src="https://img.shields.io/github/issues-closed/posthog/posthog-js"/>
</p>

# PostHog JS

This is a monorepo containing multiple packages to integrate with PostHog using JavaScript!

Please see the main [PostHog docs](https://posthog.com/docs).

## Packages

- [posthog-js](./packages/browser/README.md)
- [posthog-js-lite](./packages/web/README.md)
- [posthog-node](./packages/node/README.md)
- [posthog-react-native](./packages/react-native/README.md)
- [@posthog/react](./packages/react/README.md)
- [@posthog/ai](./packages/ai/README.md)
- [@posthog/convex](./packages/convex/README.md)
- [@posthog/nextjs-config](./packages/nextjs-config/README.md)
- [@posthog/nuxt](./packages/nuxt/README.md)
- [@posthog/openfeature-node-provider](./packages/openfeature-node-provider/README.md)
- [@posthog/openfeature-web-provider](./packages/openfeature-web-provider/README.md)
- [@posthog/plugin-utils](./packages/plugin-utils/README.md)
- [@posthog/rollup-plugin](./packages/rollup-plugin/README.md)
- [@posthog/types](./packages/types/README.md)
- [@posthog/webpack-plugin](./packages/webpack-plugin/README.md)

## Contributing

See [CONTRIBUTING.md](./CONTRIBUTING.md)

---
_Source: https://npm.io/package/posthog-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
