Packages

@posthog/ai

8.22.0 · 20 Nov 2026MIT1.9M / weekRepositoryHomepagenpmAtom feed

Your version

8.21.0

17 Nov 2026Where it was published

8.22.0 is the newest release of 8.x.

In short

3 new3 fixed4 internal

Release note

Minor Changes

  • With posthog-node 6.x.x, every AI event is sent through captureAi on the capture v1 AI lane, and enableFullAiCapture only controls truncation and media redaction. With posthog-node 5.x.x, nothing changes: AI events use capture unless enableFullAiCapture is set.
    (2026-11-17)

  • Add per-event options for posthog-node: posthogOptions on wrapped provider calls and withTracing(), and options on the LangChain, OpenAI Agents, Claude Agent SDK, Google ADK and Genkit integrations. An event with no distinct id still has person processing turned off. On posthog-node 6.x.x, AI events carry person processing only as the process_person_profile option. On posthog-node 5.x.x, each option that version knows is sent in the form it reads, and other keys are dropped. OpenAI Agents instrument() now passes every processor option, including options and onError, to the processor it registers.
    (2026-11-17)

Patch Changes

  • Genkit spans and @posthog/mcp events with no user distinct id set the process_person_profile: false event option on posthog-node 6.x.x, so a registered or context process_person_profile: true option no longer creates a person for each trace or session. Genkit also counts an empty or whitespace-only distinct id as missing.
    (2026-11-17)

  • Export the table of per-event options and the event properties posthog-node 5.x.x reads instead, so posthog-node, @posthog/ai and @posthog/mcp share one copy.
    (2026-11-17)

  • @posthog/ai now recognizes posthog-node 6.x.x by its registerOptions method instead of by getLibraryVersion(). A posthog-node 6.x.x client whose version a wrapper or subclass overrides, for example @posthog/mcp, no longer sends its AI events to the analytics endpoint. posthog-node 5.x.x clients still use capture() unless enableFullAiCapture is on.
    (2026-11-17)

  • Supports posthog-node 6.x.x. Exception autocapture passes an options object to captureException when the client is posthog-node 6.x.x, and positional arguments for posthog-node 5.x.x.
    (2026-11-17)

  • An AI event with no user distinct id now also sets the process_person_profile: false event option, so with posthog-node 6.x.x it stays personless even when a context or registered option turns person processing on. An empty or whitespace-only distinct id now counts as missing in every integration, so the event uses the trace or run id and stays personless.
    (2026-11-17)

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.