Packages

@posthog/ai

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

Your version

270 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 8.22.0

    20 Nov 2026
    • Read revisions, correct scores, and update or delete accepted offline evaluation items, results, and payloads.
      (2026-11-20)

  2. 8.21.1

    18 Nov 2026
    • ai: Stop logging a parse error for streamed Anthropic tool calls that take no arguments
      (2026-11-18)

  3. 8.21.0

    17 Nov 2026
    • 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)

    • 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)

  4. 8.20.2

    16 Nov 2026
    • Keep an object that appears twice in the input of a captured AI generation. The second occurrence was replaced with null.
      (2026-11-16)

  5. 8.20.1

    16 Nov 2026
    • Widen the supported @anthropic-ai/sdk peer range to >=0.112.3 <2.0.0 and @google/genai to ^1.52.0 || ^2.18.0 || ^3.0.0 to support current SDK majors.
      (2026-11-16)

  6. 8.20.0

    12 Nov 2026
    • Support versioned composite scorers, formula validation, and dependency-safe offline evaluation uploads.
      (2026-11-12)

  7. 8.19.3

    12 Nov 2026
    • Streamed OpenAI chat completions now keep custom tool calls in $ai_output_choices, the same way non-streaming completions do.
      (2026-11-12)

  8. 8.19.2

    10 Nov 2026
    • Capture 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)

  9. 8.19.1

    10 Nov 2026
    • OpenAI Agents instrument() now passes onError to the tracing processor it registers. It was accepted but ignored, so processor failures stayed silent.
      (2026-11-10)

  10. 8.19.0

    9 Nov 2026
    • Support openai 7 alongside 6, and type embeddings.create with encoding_format: 'base64' as returning base64 strings.
      (2026-11-09)

  11. 8.18.6

    9 Nov 2026
    • Report $ai_reasoning_tokens for Anthropic calls from usage.output_tokens_details.thinking_tokens, in the wrapper (streaming and non-streaming) and in the Claude Agent SDK processor.
      (2026-11-09)

  12. 8.18.5

    5 Nov 2026
    • Genkit: Redact credentials in model messages, so a credential that a tool returns no longer reaches $ai_input.
      (2026-11-05)

  13. 8.18.4

    5 Nov 2026
    • Keep 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)

  14. 8.18.3

    3 Nov 2026
    • Fix loading and constructing the OpenTelemetry span processor in bundled Cloudflare Workers.
      (2026-11-03)

  15. 8.18.2

    2 Nov 2026
    • Vercel AI SDK file capture: keep provider file IDs like file-abc123 as 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)

  16. 8.18.1

    2 Nov 2026
    • Capture Vercel AI SDK file parts passed as bytes instead of recording "raw files not supported"
      (2026-11-02)

  17. 8.18.0

    2 Nov 2026
    • Add a Genkit integration that captures flows, model calls, embedder calls and tool calls as AI observability events
      (2026-11-02)

  18. 8.17.2

    29 Oct 2026
  19. 8.17.1

    29 Oct 2026
    • Capture an $ai_generation error event when an OpenAI, Azure OpenAI or Anthropic call with stream: true fails before the stream opens (for example a 401, 429 or invalid model). Before, only the non-streaming call captured those errors.
      (2026-10-29)

  20. 8.17.0

    26 Oct 2026
    • Add per-item model attribution to offline evaluations and dataset execution conversion.
      (2026-10-26)

  21. 8.16.3

    23 Oct 2026
    • Capture streamed OpenAI-compatible tool calls that arrive without an index.
      (2026-10-23)

  22. 8.16.2

    23 Oct 2026
    • Apply the client privacyMode option to AI integrations, keep prompts out of errors, provider metadata and OTel spans in privacy mode, and redact MCP tool credentials
      (2026-10-23)

  23. 8.16.1

    22 Oct 2026
    • Capture the refusal text of OpenAI chat completions, streamed or not, in $ai_output_choices instead of an empty output.
      (2026-10-22)

  24. 8.16.0

    22 Oct 2026
    • Add datasets, versioned scorers, and resumable offline evaluation uploads.
      (2026-10-22)

    • Failed Vercel AI SDK generateText calls report the same $ai_provider as successful ones.
      (2026-10-22)

  25. 8.15.2

    22 Oct 2026
    • Count Gemini tool-use prompt tokens in the captured input tokens.
      (2026-10-22)

  26. 8.15.1

    22 Oct 2026
    • Capture Anthropic extended thinking blocks as reasoning content in captured output, streamed and not, and start time to first token at the first thinking delta.
      (2026-10-22)

  27. 8.15.0

    22 Oct 2026
    • Trace foreground Gemini Interactions API model calls.
      (2026-10-22)

  28. 8.14.5

    22 Oct 2026
    • Capture Gemini thought summaries (thinkingConfig.includeThoughts) as reasoning content blocks instead of answer text, in responses, streamed output, replayed input and the ADK plugin.
      (2026-10-22)

  29. 8.14.4

    21 Oct 2026
    • Use the cumulative input and cache token counts from Anthropic's final message_delta when streaming with server tools.
      (2026-10-21)

  30. 8.14.3

    20 Oct 2026
    • Capture Chat Completions responses that contain custom tool calls instead of throwing from the wrapped create() call.
      (2026-10-20)

  31. 8.14.2

    19 Oct 2026
    • Normalize AI tool-result capture and redact binary content while preserving existing provider limits.
      (2026-10-19)

  32. 8.14.1

    15 Oct 2026
    • Widen the supported @anthropic-ai/sdk peer range to >=0.112.3 <0.135.0, so installs can pick 0.134.0, the first version with OpenTelemetry tracing.
      (2026-10-15)

  33. 8.14.0

    14 Oct 2026
    • Add per-request PostHog context to AI spans through the PostHogSpanProcessor client option.
      (2026-10-14)

  34. 8.13.7

    14 Oct 2026
    • 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, and PromptFetchError is exported so callers can tell a timeout or server error from a missing prompt.
      (2026-10-14)

  35. 8.13.6

    13 Oct 2026
  36. 8.13.5

    6 Oct 2026
    • Dependencies updates:

  37. 8.13.4

    30 Sep 2026
    • 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)

  38. 8.13.3

    30 Sep 2026
    • Preserve Gemini tool calls and results in captured generation input
      (2026-09-30)

  39. 8.13.2

    24 Sep 2026
    • Preserve Gemini tool call IDs in captured generations.
      (2026-09-24)

  40. 8.13.1

    21 Sep 2026
    • Dependencies updates:

  41. 8.13.0

    17 Sep 2026
    • prompts.getAll() now works without a label. It fetches the latest version of every prompt in one request and warms the cache for plain prompts.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)

  42. 8.12.1

    15 Sep 2026
    • Fix prompts.getAll returning an empty result instead of an error on PostHog servers that do not support fetching prompts by label.
      (2026-09-15)

  43. 8.12.0

    15 Sep 2026
  44. 8.11.2

    15 Sep 2026
    • Dependencies updates:

  45. 8.11.1

    14 Sep 2026
    • Prevent tool argument serialization failures from disrupting Vercel tracing and LangChain callbacks.
      (2026-09-14)

  46. 8.11.0

    10 Sep 2026
    • prompts.getAll({ label: 'production' }) fetches every prompt that carries a label in one request and stores them in the prompt cache, so later get(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)

  47. 8.10.4

    10 Sep 2026
    • ai: Only record a service tier the provider actually served. The requested service_tier no longer reaches $ai_model_parameters from 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 (message response_metadata or generationInfo, depending on the adapter), and OpenAI and LangChain generations additionally emit the served tier as the explicit $ai_service_tier event property, which cost processing prices from.
      (2026-09-10)

  48. 8.10.3

    9 Sep 2026
    • Hold 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's Retry-After header.
      (2026-09-09)

  49. 8.10.2

    7 Sep 2026
    • Dependencies updates:

  50. 8.10.1

    3 Sep 2026
    • 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 by incomplete_details.reason (e.g. max_output_tokens) instead of the bare incomplete, 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.