@posthog/ai
8.22.0 · 20 Nov 2026MIT1.9M / weekRepositoryHomepagenpmAtom feed
270 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
8.22.0
20 Nov 2026Read revisions, correct scores, and update or delete accepted offline evaluation items, results, and payloads.
(2026-11-20)
8.21.1
18 Nov 2026ai: Stop logging a parse error for streamed Anthropic tool calls that take no arguments
(2026-11-18)
8.21.0
17 Nov 2026With posthog-node 6.x.x, every AI event is sent through
captureAion the capture v1 AI lane, andenableFullAiCaptureonly controls truncation and media redaction. With posthog-node 5.x.x, nothing changes: AI events usecaptureunlessenableFullAiCaptureis set.
(2026-11-17)Add per-event options for posthog-node:
posthogOptionson wrapped provider calls andwithTracing(), andoptionson 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 theprocess_person_profileoption. On posthog-node 5.x.x, each option that version knows is sent in the form it reads, and other keys are dropped. OpenAI Agentsinstrument()now passes every processor option, includingoptionsandonError, to the processor it registers.
(2026-11-17)Genkit spans and
@posthog/mcpevents with no user distinct id set theprocess_person_profile: falseevent option on posthog-node 6.x.x, so a registered or contextprocess_person_profile: trueoption 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)
Minor Changes
With posthog-node 6.x.x, every AI event is sent through
captureAion the capture v1 AI lane, andenableFullAiCaptureonly controls truncation and media redaction. With posthog-node 5.x.x, nothing changes: AI events usecaptureunlessenableFullAiCaptureis set.
(2026-11-17)Add per-event options for posthog-node:
posthogOptionson wrapped provider calls andwithTracing(), andoptionson 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 theprocess_person_profileoption. On posthog-node 5.x.x, each option that version knows is sent in the form it reads, and other keys are dropped. OpenAI Agentsinstrument()now passes every processor option, includingoptionsandonError, to the processor it registers.
(2026-11-17)
Patch Changes
Genkit spans and
@posthog/mcpevents with no user distinct id set theprocess_person_profile: falseevent option on posthog-node 6.x.x, so a registered or contextprocess_person_profile: trueoption 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/aiand@posthog/mcpshare one copy.
(2026-11-17)@posthog/ainow recognizes posthog-node 6.x.x by itsregisterOptionsmethod instead of bygetLibraryVersion(). 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 usecapture()unlessenableFullAiCaptureis on.
(2026-11-17)Supports posthog-node 6.x.x. Exception autocapture passes an options object to
captureExceptionwhen 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: falseevent 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)
8.20.2
16 Nov 2026Keep an object that appears twice in the input of a captured AI generation. The second occurrence was replaced with
null.
(2026-11-16)
8.20.1
16 Nov 2026Widen the supported
@anthropic-ai/sdkpeer range to>=0.112.3 <2.0.0and@google/genaito^1.52.0 || ^2.18.0 || ^3.0.0to support current SDK majors.
(2026-11-16)
8.20.0
12 Nov 2026Support versioned composite scorers, formula validation, and dependency-safe offline evaluation uploads.
(2026-11-12)
8.19.3
12 Nov 2026Streamed OpenAI chat completions now keep custom tool calls in
$ai_output_choices, the same way non-streaming completions do.
(2026-11-12)
8.19.2
10 Nov 2026Capture reasoning tokens from OpenAI Agents SDK Responses API spans in
$ai_reasoning_tokens
(2026-11-10)Capture custom tool calls in OpenAI Responses API output.
(2026-11-10)
8.19.1
10 Nov 2026OpenAI Agents
instrument()now passesonErrorto the tracing processor it registers. It was accepted but ignored, so processor failures stayed silent.
(2026-11-10)
Patch Changes
OpenAI Agents
instrument()now passesonErrorto the tracing processor it registers. It was accepted but ignored, so processor failures stayed silent.
(2026-11-10)
8.19.0
9 Nov 2026Support
openai7 alongside 6, and typeembeddings.createwithencoding_format: 'base64'as returning base64 strings.
(2026-11-09)
8.18.6
9 Nov 2026Report
$ai_reasoning_tokensfor Anthropic calls fromusage.output_tokens_details.thinking_tokens, in the wrapper (streaming and non-streaming) and in the Claude Agent SDK processor.
(2026-11-09)
8.18.5
5 Nov 2026Genkit: Redact credentials in model messages, so a credential that a tool returns no longer reaches
$ai_input.
(2026-11-05)
8.18.4
5 Nov 2026Keep the refusal text of OpenAI Responses API outputs instead of dropping it from the captured
$ai_output_choices
(2026-11-05)Count Gemini Interactions tool-use tokens in the captured input tokens.
(2026-11-05)
8.18.3
3 Nov 2026Fix loading and constructing the OpenTelemetry span processor in bundled Cloudflare Workers.
(2026-11-03)
8.18.2
2 Nov 2026Vercel AI SDK file capture: keep provider file IDs like
file-abc123as they are instead of turning them into data URLs, use the same placeholder for an over-budget file however it was passed, and skip encoding output files in privacy mode
(2026-11-02)
Patch Changes
Vercel AI SDK file capture: keep provider file IDs like
file-abc123as they are instead of turning them into data URLs, use the same placeholder for an over-budget file however it was passed, and skip encoding output files in privacy mode
(2026-11-02)
8.18.1
2 Nov 2026Capture Vercel AI SDK file parts passed as bytes instead of recording "raw files not supported"
(2026-11-02)
8.18.0
2 Nov 2026Add a Genkit integration that captures flows, model calls, embedder calls and tool calls as AI observability events
(2026-11-02)
8.17.2
29 Oct 2026Fix
@posthog/ai/otelso that it loads with OpenTelemetry JS 3.x, which has no@opentelemetry/sdk-trace-base.
(2026-10-29)
8.17.1
29 Oct 2026Capture an
$ai_generationerror event when an OpenAI, Azure OpenAI or Anthropic call withstream: truefails before the stream opens (for example a 401, 429 or invalid model). Before, only the non-streaming call captured those errors.
(2026-10-29)
8.17.0
26 Oct 2026Add per-item model attribution to offline evaluations and dataset execution conversion.
(2026-10-26)
8.16.3
23 Oct 2026Capture streamed OpenAI-compatible tool calls that arrive without an index.
(2026-10-23)
8.16.2
23 Oct 2026Apply the client
privacyModeoption to AI integrations, keep prompts out of errors, provider metadata and OTel spans in privacy mode, and redact MCP tool credentials
(2026-10-23)
Patch Changes
Apply the client
privacyModeoption to AI integrations, keep prompts out of errors, provider metadata and OTel spans in privacy mode, and redact MCP tool credentials
(2026-10-23)
8.16.1
22 Oct 2026Capture the refusal text of OpenAI chat completions, streamed or not, in
$ai_output_choicesinstead of an empty output.
(2026-10-22)
8.16.0
22 Oct 2026Add datasets, versioned scorers, and resumable offline evaluation uploads.
(2026-10-22)Failed Vercel AI SDK
generateTextcalls report the same$ai_provideras successful ones.
(2026-10-22)
8.15.2
22 Oct 2026Count Gemini tool-use prompt tokens in the captured input tokens.
(2026-10-22)
8.15.1
22 Oct 2026Capture Anthropic extended thinking blocks as
reasoningcontent in captured output, streamed and not, and start time to first token at the first thinking delta.
(2026-10-22)
8.15.0
22 Oct 2026Trace foreground Gemini Interactions API model calls.
(2026-10-22)
8.14.5
22 Oct 2026Capture Gemini thought summaries (
thinkingConfig.includeThoughts) asreasoningcontent blocks instead of answer text, in responses, streamed output, replayed input and the ADK plugin.
(2026-10-22)
8.14.4
21 Oct 2026Use the cumulative input and cache token counts from Anthropic's final
message_deltawhen streaming with server tools.
(2026-10-21)
8.14.3
20 Oct 2026Capture Chat Completions responses that contain custom tool calls instead of throwing from the wrapped
create()call.
(2026-10-20)
8.14.2
19 Oct 2026Normalize AI tool-result capture and redact binary content while preserving existing provider limits.
(2026-10-19)
8.14.1
15 Oct 2026Widen the supported
@anthropic-ai/sdkpeer range to>=0.112.3 <0.135.0, so installs can pick 0.134.0, the first version with OpenTelemetry tracing.
(2026-10-15)
8.14.0
14 Oct 2026Add per-request PostHog context to AI spans through the PostHogSpanProcessor client option.
(2026-10-14)
8.13.7
14 Oct 2026prompts.get()now makes one request when several callers ask for the same prompt at once, instead of one request per caller. Prompt fetches also time out after 10 seconds instead of hanging on a stalled connection, andPromptFetchErroris exported so callers can tell a timeout or server error from a missing prompt.
(2026-10-14)
Patch Changes
prompts.get()now makes one request when several callers ask for the same prompt at once, instead of one request per caller. Prompt fetches also time out after 10 seconds instead of hanging on a stalled connection, andPromptFetchErroris exported so callers can tell a timeout or server error from a missing prompt.
(2026-10-14)
8.13.6
13 Oct 2026Widen the supported
@anthropic-ai/sdkpeer range to>=0.112.3 <0.134.0.
(2026-10-13)
8.13.5
6 Oct 2026Dependencies updates:
8.13.4
30 Sep 2026Capture Anthropic streaming tool call arguments when a thinking or server tool block precedes the tool call.
(2026-09-30)Fix missing cache-read and cache-write token reporting in OpenAI Agents traces.
(2026-09-30)
Patch Changes
Capture Anthropic streaming tool call arguments when a thinking or server tool block precedes the tool call.
(2026-09-30)Fix missing cache-read and cache-write token reporting in OpenAI Agents traces.
(2026-09-30)
8.13.3
30 Sep 2026Preserve Gemini tool calls and results in captured generation input
(2026-09-30)
8.13.2
24 Sep 2026Preserve Gemini tool call IDs in captured generations.
(2026-09-24)
8.13.1
21 Sep 2026Dependencies updates:
8.13.0
17 Sep 2026prompts.getAll()now works without a label. It fetches the latest version of every prompt in one request and warms the cache for plainprompts.get(name)calls. Previously the label was required by the method's type, and the server treats any label value as a filter, so there was no way to batch-fetch unlabeled prompts.
(2026-09-17)
8.12.1
15 Sep 2026Fix
prompts.getAllreturning an empty result instead of an error on PostHog servers that do not support fetching prompts by label.
(2026-09-15)
8.12.0
15 Sep 2026Add a Claude Agent SDK integration that captures LLM analytics for
@anthropic-ai/claude-agent-sdkqueries
(2026-09-15)
8.11.2
15 Sep 2026Dependencies updates:
Patch Changes
Dependencies updates:
Updated dependency
@anthropic-ai/sdk@>=0.112.3 <0.125.0↗︎ (from>=0.112.3 <0.123.0, inpeerDependencies) (2026-09-15)
8.11.1
14 Sep 2026Prevent tool argument serialization failures from disrupting Vercel tracing and LangChain callbacks.
(2026-09-14)
8.11.0
10 Sep 2026prompts.getAll({ label: 'production' })fetches every prompt that carries a label in one request and stores them in the prompt cache, so laterget(name, { label })calls are cache hits. Apps with many prompts no longer need one request per prompt per cache cycle. Against a PostHog server that does not support labels on the prompt list endpoint yet, the call fails with a clear error instead of caching wrong versions.
(2026-09-10)
8.10.4
10 Sep 2026ai: Only record a service tier the provider actually served. The requested
service_tierno longer reaches$ai_model_parametersfrom any capture path — OpenAI error paths, the LangChain callback, and Anthropic events (whose'auto'/'standard_only'request values were previously recorded) — so cost processing cannot price tokens at an unconfirmed tier. The LangChain callback now reads the served tier from the response (messageresponse_metadataorgenerationInfo, depending on the adapter), and OpenAI and LangChain generations additionally emit the served tier as the explicit$ai_service_tierevent property, which cost processing prices from.
(2026-09-10)
8.10.3
9 Sep 2026Hold a stale prompt in the cache for a cooldown after a failed refetch, instead of going back to the network on every
prompts.get()call. A rate-limited client now stays on cache until the limit clears. On a 429 the cooldown follows the server'sRetry-Afterheader.
(2026-09-09)
8.10.2
7 Sep 2026Dependencies updates:
Patch Changes
Dependencies updates:
Updated dependency
@anthropic-ai/sdk@>=0.112.3 <0.123.0↗︎ (from>=0.112.3 <0.121.0, inpeerDependencies) (2026-09-07)
8.10.1
3 Sep 2026Only terminal Responses API statuses become
$ai_stop_reason(a queued or in-progress background run no longer records a lifecycle state as its stop reason), and the native OpenAI wrapper now names a truncated run byincomplete_details.reason(e.g.max_output_tokens) instead of the bareincomplete, matching the LangChain callback
(2026-09-03)
Patch Changes
Only terminal Responses API statuses become
$ai_stop_reason(a queued or in-progress background run no longer records a lifecycle state as its stop reason), and the native OpenAI wrapper now names a truncated run byincomplete_details.reason(e.g.max_output_tokens) instead of the bareincomplete, matching the LangChain callback
(2026-09-03)
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.