New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

posthog-js

Package Overview
Dependencies
Maintainers
21
Versions
1389
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

posthog-js

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

Source
npmnpm
Version
1.429.5
Version published
Weekly downloads
10M
-11.22%
Maintainers
21
Weekly downloads
 
Created
Source

PostHog JavaScript package

npm package MIT License

Please see the main PostHog docs.

SDK usage examples and code snippets live in the official documentation so they stay up to date.

Documentation

Surveys and capture

Built-in surveys stay hidden while event capture is disabled, including before consent when opt_out_capturing_by_default is enabled. This applies to automatic display, displaySurvey() (including ignoreConditions), and renderSurvey(). Delayed surveys recheck capture before appearing.

canRenderSurvey() and canRenderSurveyAsync() return a disabled reason in this state. Custom integrations can still discover surveys through getActiveMatchingSurveys().

If capture stops while a survey is open, submitting keeps the answers in the form and shows an error. It does not mark the survey complete or clear its saved progress. The person can retry after capture is enabled again.

FAQs

Package last updated on 10 Sep 2026

Related posts