posthog-ai
8.22.1
Patch Changes
- #5860
4288b33Thanks @utsxvrai! - Keep the choices of ann > 1streamed OpenAI chat completion apart in$ai_output_choices, one message per choice as non-streamed calls already do, and take$ai_stop_reasonfrom the first choice. (2026-11-25)
8.22.0
Minor Changes
- #5835
6e58c08Thanks @Radu-Raicea! - Read revisions, correct scores, and update or delete accepted offline evaluation items, results, and payloads. (2026-11-20)
8.21.1
Patch Changes
- #5764
93a47d8Thanks @pcbeingused333! - fix(ai): stop logging a parse error for streamed Anthropic tool calls that take no arguments (2026-11-18)
8.21.0
Minor Changes
-
#5407
6405dfdThanks @eli-r-ph! - With posthog-node 6.x.x, every AI event is sent throughcaptureAion 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) -
#5407
6405dfdThanks @eli-r-ph! - 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
-
#5407
6405dfdThanks @eli-r-ph! - 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) -
#5407
6405dfdThanks @eli-r-ph! - 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) -
#5407
6405dfdThanks @eli-r-ph! -@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) -
#5407
6405dfdThanks @eli-r-ph! - Supports posthog-node 6.x.x. Exception autocapture passes an options object tocaptureExceptionwhen the client is posthog-node 6.x.x, and positional arguments for posthog-node 5.x.x. (2026-11-17) -
#5407
6405dfdThanks @eli-r-ph! - An AI event with no user distinct id now also sets theprocess_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) -
Updated dependencies [
6405dfd,6405dfd,6405dfd,6405dfd,6405dfd,6405dfd,6405dfd,6405dfd,6405dfd,6405dfd,6405dfd,6405dfd,6405dfd,6405dfd,6405dfd,6405dfd,6405dfd,6405dfd,6405dfd,6405dfd,6405dfd,6405dfd]:- @posthog/core@1.69.0
- posthog-node@6.0.0
8.20.2
Patch Changes
- #5533
50197f0Thanks @yoarajota! - Keep an object that appears twice in the input of a captured AI generation. The second occurrence was replaced withnull. (2026-11-16)
8.20.1
Patch Changes
- #5728
74013baThanks @mindulle! - Widen 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
Minor Changes
- #5678
22d5e11Thanks @Radu-Raicea! - Support versioned composite scorers, formula validation, and dependency-safe offline evaluation uploads. (2026-11-12)
8.19.3
Patch Changes
- #5691
3e62421Thanks @shehjaddev! - Streamed 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
Patch Changes
-
#5604
a516cf3Thanks @smitp1402! - Capture reasoning tokens from OpenAI Agents SDK Responses API spans in$ai_reasoning_tokens(2026-11-10) -
#5622
7d96fa3Thanks @pcbeingused333! - Capture custom tool calls in OpenAI Responses API output. (2026-11-10)
8.19.1
Patch Changes
- #5624
567c5b7Thanks @eli-r-ph! - OpenAI Agentsinstrument()now passesonErrorto the tracing processor it registers. It was accepted but ignored, so processor failures stayed silent. (2026-11-10) - Updated dependencies [
fb313fe,fee9bee,fee9bee]:- posthog-node@5.65.0
- @posthog/core@1.66.0
8.19.0
Minor Changes
- #5625
a93bee2Thanks @tokerson! - Supportopenai7 alongside 6, and typeembeddings.createwithencoding_format: 'base64'as returning base64 strings. (2026-11-09)
8.18.6
Patch Changes
- #5609
eb11f00Thanks @pcbeingused333! - Report$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
Patch Changes
- #5556
b63702fThanks @eli-r-ph! - Genkit: redact credentials in model messages, so a credential that a tool returns no longer reaches$ai_input. (2026-11-05)
8.18.4
Patch Changes
-
#5563
b1bbf31Thanks @pcbeingused333! - Keep the refusal text of OpenAI Responses API outputs instead of dropping it from the captured$ai_output_choices(2026-11-05) -
#5555
a129e9fThanks @smitp1402! - Count Gemini Interactions tool-use tokens in the captured input tokens. (2026-11-05)
8.18.3
Patch Changes
- #5530
9909feeThanks @marandaneto! - Fix loading and constructing the OpenTelemetry span processor in bundled Cloudflare Workers. (2026-11-03)
8.18.2
Patch Changes
- #5520
af74347Thanks @bernatixer! - Vercel AI SDK file capture: keep provider file IDs likefile-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) - Updated dependencies [
3fbb667]:- @posthog/core@1.62.1
8.18.1
Patch Changes
- #5496
3611fd2Thanks @bernatixer! - Capture Vercel AI SDK file parts passed as bytes instead of recording "raw files not supported" (2026-11-02)
8.18.0
Minor Changes
- #5381
bac61c2Thanks @Brian-1812! - Add a Genkit integration that captures flows, model calls, embedder calls and tool calls as AI observability events (2026-11-02)
8.17.2
Patch Changes
- #5439
a22cbecThanks @posthog! - Fix@posthog/ai/otelso that it loads with OpenTelemetry JS 3.x, which has no@opentelemetry/sdk-trace-base. (2026-10-29)
8.17.1
Patch Changes
- #5478
aa4ed5dThanks @pcbeingused333! - Capture 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
Minor Changes
- #5438
acdbdd2Thanks @Radu-Raicea! - Add per-item model attribution to offline evaluations and dataset execution conversion. (2026-10-26)
8.16.3
Patch Changes
- #5353
6970c88Thanks @pcbeingused333! - Capture streamed OpenAI-compatible tool calls that arrive without an index. (2026-10-23)
8.16.2
Patch Changes
- #5385
faacff0Thanks @carlos-marchal-ph! - Apply the clientprivacyModeoption to AI integrations, keep prompts out of errors, provider metadata and OTel spans in privacy mode, and redact MCP tool credentials (2026-10-23) - Updated dependencies [
faacff0,f827137]:- posthog-node@5.57.1
- @posthog/core@1.60.1
8.16.1
Patch Changes
- #5355
e027825Thanks @pcbeingused333! - Capture the refusal text of OpenAI chat completions, streamed or not, in$ai_output_choicesinstead of an empty output. (2026-10-22)
8.16.0
Minor Changes
- #5360
26e65ecThanks @Radu-Raicea! - Add datasets, versioned scorers, and resumable offline evaluation uploads. (2026-10-22)
Patch Changes
- #5121
0f5d25aThanks @breken-ai! - Failed Vercel AI SDKgenerateTextcalls report the same$ai_provideras successful ones. (2026-10-22)
8.15.2
Patch Changes
- #5368
3e46e4cThanks @pcbeingused333! - Count Gemini tool-use prompt tokens in the captured input tokens. (2026-10-22)
8.15.1
Patch Changes
- #5375
def5ab4Thanks @shehjaddev! - fix: Capture Anthropic extended thinking blocks asreasoningcontent in captured output, streamed and not, and start time to first token at the first thinking delta. (2026-10-22)
8.15.0
Minor Changes
- #5091
2192bb1Thanks @gouveags! - Trace foreground Gemini Interactions API model calls. (2026-10-22)
8.14.5
Patch Changes
- #5357
b5e99d1Thanks @shehjaddev! - fix: Capture 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
Patch Changes
- #5352
dd58d50Thanks @pcbeingused333! - fix: Use the cumulative input and cache token counts from Anthropic's finalmessage_deltawhen streaming with server tools. (2026-10-21)
8.14.3
Patch Changes
- #5251
717d2fcThanks @yoarajota! - Capture Chat Completions responses that contain custom tool calls instead of throwing from the wrappedcreate()call. (2026-10-20)
8.14.2
Patch Changes
- #5155
a9d29f1Thanks @gouveags! - Normalize AI tool-result capture and redact binary content while preserving existing provider limits. (2026-10-19)
8.14.1
Patch Changes
- #5305
7319620Thanks @carlos-marchal-ph! - Widen 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
Minor Changes
- #5299
7587be3Thanks @carlos-marchal-ph! - Add per-request PostHog context to AI spans through the PostHogSpanProcessor client option. (2026-10-14)
8.13.7
Patch Changes
- #5266
411d364Thanks @jurajmajerik! -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) - Updated dependencies [
e6598be]:
8.13.6
Patch Changes
- #5286
4f739c6Thanks @carlos-marchal-ph! - Widen the supported@anthropic-ai/sdkpeer range to>=0.112.3 <0.134.0. (2026-10-13)
8.13.5
Patch Changes
- #5201
085ffd8Thanks @dependabot! - dependencies updates:- Updated dependency
@anthropic-ai/sdk@>=0.112.3 <0.129.0↗︎ (from>=0.112.3 <0.126.0, inpeerDependencies) (2026-10-06)
- Updated dependency
8.13.4
Patch Changes
-
#5113
41f1243Thanks @yoarajota! - Capture Anthropic streaming tool call arguments when a thinking or server tool block precedes the tool call. (2026-09-30) -
#5056
9ddb74cThanks @brandon-julio-t! - Fix missing cache-read and cache-write token reporting in OpenAI Agents traces. (2026-09-30) -
Updated dependencies [
2d2560a]:
8.13.3
Patch Changes
- #5088
882606dThanks @gouveags! - Preserve Gemini tool calls and results in captured generation input (2026-09-30)
8.13.2
Patch Changes
- #5087
2bce7b2Thanks @gouveags! - Preserve Gemini tool call IDs in captured generations. (2026-09-24)
8.13.1
Patch Changes
- #5039
15914bdThanks @dependabot! - dependencies updates:- Updated dependency
@anthropic-ai/sdk@>=0.112.3 <0.126.0↗︎ (from>=0.112.3 <0.125.0, inpeerDependencies) (2026-09-21)
- Updated dependency
8.13.0
Minor Changes
- #5000
1dfde0eThanks @jurajmajerik! -prompts.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
Patch Changes
- #4961
8fb9367Thanks @jurajmajerik! - Fixprompts.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
Minor Changes
- #4824
7ca1cdcThanks @posthog! - Add a Claude Agent SDK integration that captures LLM analytics for@anthropic-ai/claude-agent-sdkqueries (2026-09-15)
8.11.2
Patch Changes
- #4955
e88501aThanks @dependabot! - dependencies updates:- Updated dependency
@anthropic-ai/sdk@>=0.112.3 <0.125.0↗︎ (from>=0.112.3 <0.123.0, inpeerDependencies) (2026-09-15)
- Updated dependency
- Updated dependencies [
07c1045]:- @posthog/core@1.54.1
- posthog-node@5.52.3
8.11.1
Patch Changes
- #4943
abf9123Thanks @marandaneto! - Prevent tool argument serialization failures from disrupting Vercel tracing and LangChain callbacks. (2026-09-14)
8.11.0
Minor Changes
- #4903
825d830Thanks @jurajmajerik! -prompts.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
Patch Changes
- #4818
475743cThanks @bernatixer! - fix(ai): only record a service tier the provider actually served. The requestedservice_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
Patch Changes
- #4775
2fad74bThanks @posthog! - Hold a stale prompt in the cache for a cooldown after a failed refetch, instead of going back to the network on everyprompts.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
Patch Changes
- #4820
56e0a44Thanks @dependabot! - dependencies updates:- Updated dependency
@anthropic-ai/sdk@>=0.112.3 <0.123.0↗︎ (from>=0.112.3 <0.121.0, inpeerDependencies) (2026-09-07)
- Updated dependency
- Updated dependencies [
74ca945]:- posthog-node@5.51.7
- @posthog/core@1.50.6
8.10.1
Patch Changes
- #4736
c16a7ceThanks @bernatixer! - 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) - Updated dependencies [
dbbb58e]:- @posthog/core@1.50.3
8.10.0
Minor Changes
- #4687
657b173Thanks @AhmadHammad21! - Add a Google ADK (@google/adk) observability adapter.@posthog/ai/adkexposesPostHogADKPlugin, an ADKBasePluginthat captures a full$ai_generationevent (input, output, model, token usage, latency, finish reason, trace id, session id, distinct id and groups) for every model call an ADK agent makes, funnelling through the sharedcaptureAiGenerationprimitive so PostHog derives cost from the model and tokens. (2026-09-02)
8.9.3
Patch Changes
-
#4700
a105b77Thanks @bernatixer! - Capture$ai_stop_reasonfrom LangChain runs that use the OpenAI Responses API.The callback only understood Chat Completions vocabulary (
finish_reason/stop_reason), so Responses API runs, which reportstatusandincomplete_details.reasoninstead, never carried a stop reason. The Chat Completions keys keep priority, andincomplete_details.reasonoutranksstatus, so an early stop names its cause (for examplemax_output_tokens) instead of justincomplete. (2026-09-01) -
Updated dependencies [
e87820a]:- @posthog/core@1.50.1
8.9.2
Patch Changes
- #4664
86fe9daThanks @bernatixer! - Interrupted or cancelled streams now report the token usage and latency they actually observed, instead of zeros, across the OpenAI, Anthropic, Gemini, Azure and Vercel wrappers. When usage was never reported, token counts and override costs are omitted entirely, so$ai_input_tokenscan be absent where it was previously always0. (2026-09-01)
8.9.1
Patch Changes
- #4698
5ae5c29Thanks @dependabot! - Preserve Anthropic workspace IDs on wrapped provider promises and support@anthropic-ai/sdkversions from 0.112.3 through 0.120.x. (2026-09-01) - Updated dependencies [
444bf35,6ae173f,6723395]:- @posthog/core@1.50.0
- posthog-node@5.51.5
8.9.0
Minor Changes
- #4556
a47b232Thanks @gouveags! - Add LangChain v1 agent middleware for AI observability. (2026-08-27)
Patch Changes
- Updated dependencies [
7902e44,e899b1c]:- @posthog/core@1.48.12
- posthog-node@5.51.3
8.8.1
Patch Changes
- #4609
da5d0eeThanks @marandaneto! - Share OpenAI-compatible telemetry reducers across OpenAI and Azure and align Azure usage, tools, stop reason, web search, background output, and sanitization telemetry. (2026-08-25) - Updated dependencies [
1faeb74,930de19,d4eee8f]:- posthog-node@5.51.2
- @posthog/core@1.48.11
8.8.0
Minor Changes
- #4289
c9086deThanks @carlos-marchal-ph! - Public betacaptureAi()/captureAiImmediate(): AI events on a dedicated isolated endpoint with the event UUID returned. NewenableFullAiCaptureoption replaces the internal_useAiLane/_enableMultimodalCapture; wrappers route through the AI endpoint and skip redaction/truncation when set (privacy mode still wins). (2026-08-13)
Patch Changes
- Updated dependencies [
c9086de]:- @posthog/core@1.48.0
- posthog-node@5.49.0
8.7.1
Patch Changes
- #4473
9b5922fThanks @fivestarspicy! - fix(gemini): declare Gemini's cache accounting model on generations with cache reads, so ingestion prices cached tokens from$ai_cache_reporting_exclusiveinstead of inferring it from the token counts (2026-08-07)
8.7.0
Minor Changes
- #4319
4d379bbThanks @kdawgwilk! - Support AI SDK v7 provider peers for OpenTelemetry integrations and reject v7 models passed to the legacywithTracingwrapper. (2026-08-07)
8.6.8
Patch Changes
-
#4189
2831de1Thanks @Fortiz2305! - Report cache-write tokens for the OpenAI wrapper. OpenAI-compatible providers that follow Anthropic's cache-write convention (e.g. Claude via OpenRouter) return cache-write tokens in the response usage (prompt_tokens_details.cache_write_tokensfor Chat Completions,input_tokens_details.cache_write_tokensfor Responses), but the wrapper only surfaced cache reads. It now populates$ai_cache_creation_input_tokensacross Chat Completions and Responses (streaming, non-streaming, andparse()), so ingestion can price the cache-write premium for Claude/Anthropic models instead of under-reporting cost on cache-heavy calls. Completes the cache-aware cost fix started in #4071 (#3615). (2026-08-06) -
#4236
d36a421Thanks @gouveags! - Preserve Anthropic cache creation TTL breakdowns in streaming and LangChain generation events. (2026-08-06) -
Updated dependencies [
4751b33,64ba193]:- posthog-node@5.48.1
- @posthog/core@1.46.9
8.6.7
Patch Changes
- #4416
5a585b2Thanks @carlos-marchal-ph! - Capture the reasoning text of assistant turns replayed in a Vercel AI SDK prompt. The input mapper read a non-existentreasoningfield instead of the spec'stext, so$ai_inputreasoning parts arrived empty for multi-step agentic loops. (2026-08-05)
8.6.6
Patch Changes
- #4365
63d87d8Thanks @marandaneto! - Track OpenAI and Azure background Responses through their terminal state. (2026-08-04)
8.6.5
Patch Changes
-
#4366
1aa1690Thanks @marandaneto! - Capture failed and incomplete Responses API results correctly. (2026-08-04) -
#4364
2c6c614Thanks @marandaneto! - Redact binary content consistently across AI integrations. (2026-08-04) -
Updated dependencies [
facb4c1]:
8.6.4
Patch Changes
-
#4406
e2e88f6Thanks @github-actions! - Capture Vercel AI SDK provider error status codes in$ai_http_status. (2026-08-04) -
#4360
98bd34bThanks @marandaneto! - Preserve provider SDK promise helpers when instrumenting requests, and accept the full Anthropic and Azure OpenAI client options, including custom fetch, timeout, and retry settings. (2026-08-04)
8.6.3
Patch Changes
-
#4361
0d79b00Thanks @marandaneto! - Preserve stream cancellation and backpressure while monitoring AI responses. (2026-08-04) -
#4362
cd4da1bThanks @marandaneto! - Prevent telemetry failures from affecting provider calls and errors. (2026-08-04)
8.6.2
Patch Changes
-
#4370
ea64094Thanks @marandaneto! - Capture Chat Completions usage from OpenAI Agents spans. (2026-08-04) -
#4368
45c0559Thanks @marandaneto! - Remove the undeclared OpenTelemetry core runtime dependency. (2026-08-04) -
#4369
6e2f33aThanks @marandaneto! - Resolve OpenAI Agents APIs through the declared peer dependency. (2026-08-04) -
#4371
a9a78c0Thanks @marandaneto! - Support current LangChain message usage and response metadata. (2026-08-04) -
#4363
821a2c6Thanks @marandaneto! - Safely capture circular and otherwise unknown telemetry values with a shared JSON-safe value converter. (2026-08-04) -
#4367
5483f25Thanks @marandaneto! - Handle Vercel AI stream errors and cancellation exactly once. (2026-08-04) -
Updated dependencies [
d4ffb83,821a2c6]:- posthog-node@5.47.8
- @posthog/core@1.46.6
8.6.1
Patch Changes
- #4345
484c482Thanks @willwearing! - Treat LangGraph control-flow exceptions (GraphInterrupt,NodeInterrupt,ParentCommand, and otheris_bubble_uperrors) as non-error trace and span completions in the LangChain callback, surfacing pending interrupts as$ai_output_stateunder the__interrupt__key. (2026-08-03)
8.6.0
Minor Changes
- #4335
9a453b9Thanks @marco-g-pm! - The OpenAI Agents SDKgroupIdnow also maps to$ai_session_idon$ai_traceand span events, so grouped runs show up as sessions in PostHog AI observability.$ai_group_idis still emitted alongside it. (2026-07-30)
Patch Changes
- #4336
1eb04c1Thanks @marco-g-pm! - Fix LangChain spans being named after their class instead of the runnable. LangChain passesrunNameas a bare string, which the name resolver skipped because it only inspected object arguments, so every tool span was captured asDynamicStructuredToolrather than the tool's own name. (2026-07-30)
8.5.0
Minor Changes
- #4329
5baf90aThanks @jurajmajerik! -Prompts.get()results now includeconfig, the JSON object of model parameters or agent configuration stored with the prompt version in PostHog prompt management (nullwhen the version has none). Config is carried through the client-side cache and the stale-cache fallback, and each result gets its own copy so mutatingresult.configcannot pollute later cache hits. The hardcodedfallbackstring has no config, so use defensive access like(result.config ?? {}).temperature. (2026-07-30)
8.4.3
Patch Changes
- #4306
05088ffThanks @marandaneto! - fix(ai): prefer the OpenAIservice_tierreported by the response for accurate cost attribution (2026-07-29)
8.4.2
Patch Changes
- #4072
0369b09Thanks @nandinitiw! - fix(ai): capture OpenAIservice_tierin$ai_model_parametersso PostHog can correctly attribute costs for flex and priority tier requests (2026-07-29)
8.4.1
Patch Changes
- #4196
b96a066Thanks @reclaim-admin! - Redact base64 content from LangChain trace and span input and output state. (2026-07-28)
8.4.0
Minor Changes
- #4163
45f5488Thanks @jurajmajerik! - feat(ai): add alabeloption toPrompts.get()to fetch the prompt version a label (e.g.production) currently points to. Labeled fetches are cached separately, results carry the resolvedlabel, and a warning is logged when the server does not resolve the requested label (older PostHog versions ignore the parameter and return the latest version). (2026-07-17)
8.3.1
Patch Changes
- #4071
182434fThanks @DerGeraetK! - fix(ai): declare$ai_cache_reporting_exclusive: falseon OpenAI wrapper events so ingestion no longer double-bills cached input tokens for Claude models served through OpenAI-compatible hosts (e.g. OpenRouter). The flag stays unset when callers pass their own input or cache token counts throughposthogProperties, so existing passthrough workarounds keep reporting correctly. (2026-07-16)
8.3.0
Minor Changes
- #4084
f4b453aThanks @marandaneto! - Add optional error callback support to the OpenAI Agents tracing processor. (2026-07-07)
8.2.3
Patch Changes
- #4076
68640deThanks @bamtheboozle! - fix: prevent unhandled promise rejection from crashing the host process when a streamed provider response errors mid-flight (OpenAI, Azure OpenAI, Anthropic wrappers) (2026-07-06)
8.2.2
Patch Changes
- #3966
a277530Thanks @marandaneto! - Skip capturing pending OpenAI background Responses without token usage. (2026-06-25)
8.2.1
Patch Changes
- #3754
d8419d4Thanks @archievi! - Wrap the Azure OpenAIresponsesAPI inPostHogAzureOpenAIsoresponses.createcalls are tracked, matching the non-AzurePostHogOpenAIclient. (2026-06-16) - Updated dependencies [
b3ec845,a0553b3,c6c163a]:- @posthog/core@1.33.0
- posthog-node@5.38.0
8.2.0
Minor Changes
- #3793
b477c02Thanks @richardsolomou! - feat: warn when abase_urlpoints at the PostHog AI Gateway. The gateway emits its own$ai_generation, so routing through it double-captures (and, for billable products, double-bills) every call. Detection covers the provider wrappers (OpenAI, Azure, Anthropic, Gemini, Vercel), LangChain, OpenAI Agents, directcaptureAiGenerationcallers, and the OTel exporter/processor (via the span'sserver.address/url.full). The warning logs on every routed call; the event is left untouched, since it carries data the gateway never sees (groups, custom properties, trace hierarchy). (2026-06-11)
8.1.11
Patch Changes
- Updated dependencies []:
- @posthog/core@1.32.3
- posthog-node@5.36.17
8.1.10
Patch Changes
- Updated dependencies [
25822ac]:- @posthog/core@1.32.2
- posthog-node@5.36.16
8.1.9
Patch Changes
- Updated dependencies []:
- @posthog/core@1.32.1
- posthog-node@5.36.15
8.1.8
Patch Changes
- Updated dependencies [
612f97a]:- @posthog/core@1.32.0
- posthog-node@5.36.14
8.1.7
Patch Changes
- Updated dependencies []:
- @posthog/core@1.31.4
- posthog-node@5.36.13
8.1.6
Patch Changes
- Updated dependencies []:
- @posthog/core@1.31.3
- posthog-node@5.36.12
8.1.5
Patch Changes
- Updated dependencies []:
- @posthog/core@1.31.2
- posthog-node@5.36.11
8.1.4
Patch Changes
- Updated dependencies []:
- @posthog/core@1.31.1
- posthog-node@5.36.10
8.1.3
Patch Changes
- Updated dependencies [
0c2acb9]:- @posthog/core@1.31.0
- posthog-node@5.36.9
8.1.2
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.14
- posthog-node@5.36.8
8.1.1
Patch Changes
- #3748
7820929Thanks @marandaneto! - Reduce duplicate internal code found by dry4ts. (2026-06-09) - Updated dependencies [
7820929]:- posthog-node@5.36.7
- @posthog/core@1.30.13
8.1.0
Minor Changes
- #3751
9140a67Thanks @richardsolomou! - feat: populate$ai_base_urlon the Vercel and OpenAI Agents instrumentation paths so gateway-routed$ai_generationevents can be deduped on ingestion. The Vercel middleware recovers the base URL from the provider's internalconfig(config.baseURL, or theconfig.url({ path })closure used by@ai-sdk/openai/openai-compatible) instead of hardcoding an empty string. The OpenAI Agents processor emits it frommodel_config.base_urlwhen the SDK exposes it (best-effort; the SDK omits it for Responses calls and for chat calls with model settings). (2026-06-09)
8.0.1
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.12
- posthog-node@5.36.6
8.0.0
Major Changes
-
#3771
227c9b0Thanks @dustinbyrne! - Major release: move provider SDKs to optional peer dependencies and clean up staged deprecations.Optional peer dependencies (#3610):
openai,@anthropic-ai/sdk,@google/genai, and@langchain/coreare now optional peer dependencies, and the unusedlangchaindependency is dropped — you only install the SDK for the integration you use. Integration clients are no longer exported from the package root; import them from their subpaths:1- import { OpenAI } from '@posthog/ai' 2+ import { OpenAI } from '@posthog/ai/openai' // npm install openai 3- import { AzureOpenAI } from '@posthog/ai' 4+ import { AzureOpenAI } from '@posthog/ai/openai' // npm install openai 5- import { Anthropic } from '@posthog/ai' 6+ import { Anthropic } from '@posthog/ai/anthropic' // npm install @anthropic-ai/sdk 7- import { GoogleGenAI } from '@posthog/ai' 8+ import { GoogleGenAI } from '@posthog/ai/gemini' // npm install @google/genai 9- import { LangChainCallbackHandler } from '@posthog/ai' 10+ import { LangChainCallbackHandler } from '@posthog/ai/langchain' // npm install @langchain/corewithTracing(Vercel AI SDK) andcaptureAiGenerationremain exported from the package root and need no provider SDK.Removed deprecations:
-
Prompts.get()now always returns aPromptResultobject ({ source, prompt, name, version }) — the plain-string return and thewithMetadataoption are gone. Read the template fromresult.prompt:1- const template = await prompts.get('my-prompt') 2- const compiled = prompts.compile(template, vars) 3+ const result = await prompts.get('my-prompt') 4+ const compiled = prompts.compile(result.prompt, vars) -
PostHogTraceExporterandPostHogSpanProcessorno longer accept the deprecatedapiKeyoption — useprojectToken:1- new PostHogTraceExporter({ apiKey: 'phc_...' }) 2+ new PostHogTraceExporter({ projectToken: 'phc_...' }) 3- new PostHogSpanProcessor({ apiKey: 'phc_...' }) 4+ new PostHogSpanProcessor({ projectToken: 'phc_...' }) 5``` (2026-06-08)
-
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.11
- posthog-node@5.36.5
7.21.0
Minor Changes
- #3762
a6234bdThanks @carlos-marchal-ph! - Redact base64/binary multimodal content from AI spans in the OTelPostHogSpanProcessorandPostHogTraceExporterbefore export, matching the redaction already applied by the direct provider wrappers. Content is redacted by value (data URLs and large base64 blobs) across span attributes and span events, so it works regardless of which GenAI semantic convention produced the span. (2026-06-08)
7.20.14
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.10
- posthog-node@5.36.4
7.20.13
Patch Changes
- #3624
be7c3c7Thanks @pntech20! - Preserve OpenAI APIPromise response helpers on instrumented OpenAI wrapper calls. (2026-06-05)
7.20.12
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.9
- posthog-node@5.36.3
7.20.11
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.8
- posthog-node@5.36.2
7.20.10
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.7
- posthog-node@5.36.1
7.20.9
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.6
- posthog-node@5.35.15
7.20.8
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.5
- posthog-node@5.35.14
7.20.7
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.4
- posthog-node@5.35.13
7.20.6
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.3
- posthog-node@5.35.12
7.20.5
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.2
- posthog-node@5.35.11
7.20.4
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.1
- posthog-node@5.35.10
7.20.3
Patch Changes
- #3703
f3cc6faThanks @marandaneto! - Disable/no-op initialization paths instead of throwing or sending requests when PostHog project tokens are missing or blank. (2026-06-01) - Updated dependencies [
f3cc6fa,3d4a76f]:- posthog-node@5.35.9
- @posthog/core@1.30.0
7.20.2
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.15
- posthog-node@5.35.8
7.20.1
Patch Changes
- Updated dependencies [
d9ad199]:- @posthog/core@1.29.14
- posthog-node@5.35.7
7.20.0
Minor Changes
- #3306
1a2f8a8Thanks @johnsykim! - Add$ai_completion_idand$ai_provider_metadatato$ai_generationevents for the OpenAI and Azure OpenAI wrappers.$ai_completion_idis the provider's response ID (e.g.chatcmpl-…/resp_…);$ai_provider_metadatacarries OpenAI-specific fields (system_fingerprint,request_id). Together they enable correlating PostHog events with OpenAI's Logs dashboard (platform.openai.com/logs/{completion_id}). The same options (completionId,providerMetadata) are now accepted by the publiccaptureAiGenerationprimitive so other provider wrappers can follow the same pattern. (2026-05-29)
7.19.7
Patch Changes
- Updated dependencies [
7b84b75]:- @posthog/core@1.29.13
- posthog-node@5.35.6
7.19.6
Patch Changes
-
#3668
7c80b2eThanks @rafaeelaudibert! - ExposeprojectTokenin addition toapiKeyforPostHogTraceExporterWe're moving towards a place where we're calling this
projectTokeneverywhere. Let's release this as a patch version because it's a tiny change and we still support the old usage. This might be dropped in the next packages/ai major version. (2026-05-28)
7.19.5
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.12
- posthog-node@5.35.5
7.19.4
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.11
- posthog-node@5.35.4
7.19.3
Patch Changes
- Updated dependencies [
5568f12]:- @posthog/core@1.29.10
- posthog-node@5.35.3
7.19.2
Patch Changes
- Updated dependencies [
c806cca]:- @posthog/core@1.29.9
- posthog-node@5.35.1
7.19.1
Patch Changes
- Updated dependencies [
18ea8b5]:- posthog-node@5.35.0
- @posthog/core@1.29.8
7.19.0
Minor Changes
- #3605
82fa498Thanks @carlos-marchal-ph! - Improved error serialization to capture cause, message and stack (2026-05-21)
7.18.12
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.7
- posthog-node@5.34.9
7.18.11
Patch Changes
- Updated dependencies [
a880dbc]:- @posthog/core@1.29.6
- posthog-node@5.34.7
7.18.10
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.5
- posthog-node@5.34.5
7.18.9
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.4
- posthog-node@5.34.4
7.18.8
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.3
- posthog-node@5.34.3
7.18.7
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.2
- posthog-node@5.34.2
7.18.6
Patch Changes
- Updated dependencies [
4b895bf]:- @posthog/core@1.29.1
- posthog-node@5.34.1
7.18.5
Patch Changes
- Updated dependencies [
ad60818]:- @posthog/core@1.29.0
- posthog-node@5.34.0
7.18.4
Patch Changes
- Updated dependencies [
223d925]:- @posthog/core@1.28.7
- posthog-node@5.33.7
7.18.3
Patch Changes
- Updated dependencies []:
- @posthog/core@1.28.6
- posthog-node@5.33.6
7.18.2
Patch Changes
- Updated dependencies []:
- @posthog/core@1.28.5
- posthog-node@5.33.5
7.18.1
Patch Changes
- Updated dependencies []:
- @posthog/core@1.28.4
- posthog-node@5.33.4
7.18.0
Minor Changes
- #3539
6b23fd3Thanks @carlos-marchal-ph! - Added a new generic binary payload sanitizer to catch more edge cases (2026-05-07)
7.17.5
Patch Changes
- Updated dependencies []:
- @posthog/core@1.28.3
- posthog-node@5.33.3
7.17.4
Patch Changes
- Updated dependencies [
220cd61,255b273]:- @posthog/core@1.28.2
- posthog-node@5.33.2
7.17.3
Patch Changes
- Updated dependencies [
8aee3d5]:- @posthog/core@1.28.1
- posthog-node@5.33.1
7.17.2
Patch Changes
- Updated dependencies [
cf56753,04db756]:- @posthog/core@1.28.0
- posthog-node@5.32.1
7.17.1
Patch Changes
- #3507
38e85c9Thanks @richardsolomou! - perf(vercel): drop O(N²) prompt trim and reuse TextEncoder/TextDecoder inmapVercelPrompt/truncateso long conversations no longer block the main thread for hundreds of milliseconds inwithTracing's stream flush (2026-04-30)
7.17.0
Minor Changes
- #3499
0601162Thanks @richardsolomou! - AddcaptureAiGeneration, a generic primitive for emitting$ai_generationevents from LLM calls that don't go through one of the wrapped clients (Cloudflare Workers AI, TanStack AI, custom HTTP, etc.). All built-in wrappers (withTracing,OpenAI,Anthropic,GoogleGenAI) now funnel through the same primitive, so external events are indistinguishable from SDK-wrapped ones. (2026-04-30)
7.16.15
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.9
- posthog-node@5.30.8
7.16.14
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.8
- posthog-node@5.30.7
7.16.13
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.7
- posthog-node@5.30.6
7.16.12
Patch Changes
- #3487
09b4b3dThanks @richardsolomou! - Widen the@opentelemetry/exporter-trace-otlp-httppeer dependency range from^0.200.0(which only matched0.200.x) to>=0.200.0 <1.0.0, so newer 0.x releases brought in by other OpenTelemetry-aware packages no longer trigger ERESOLVE failures or require--legacy-peer-deps. (2026-04-27)
7.16.11
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.6
- posthog-node@5.30.5
7.16.10
Patch Changes
- Updated dependencies [
70508df]:- @posthog/core@1.27.5
- posthog-node@5.30.4
7.16.9
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.4
- posthog-node@5.30.3
7.16.8
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.3
- posthog-node@5.30.2
7.16.7
Patch Changes
- Updated dependencies [
daf028d]:- @posthog/core@1.27.2
- posthog-node@5.30.1
7.16.6
Patch Changes
- Updated dependencies [
96f19b7]:- @posthog/core@1.27.1
- posthog-node@5.29.7
7.16.5
Patch Changes
- Updated dependencies [
1a8b727]:- @posthog/core@1.27.0
- posthog-node@5.29.6
7.16.4
Patch Changes
- Updated dependencies [
922a1c1]:- @posthog/core@1.26.0
- posthog-node@5.29.5
7.16.3
Patch Changes
- #3433
6e7d4ceThanks @richardsolomou! - fix(ai): adjust V3 cache tokens for Claude on any host (including Bedrock) (2026-04-22)
7.16.2
Patch Changes
- #3431
ea2cc33Thanks @richardsolomou! - fix(ai): read tool-call input field in vercel non-streaming output (2026-04-21)
7.16.1
Patch Changes
- #3426
1a0b58dThanks @marandaneto! - Trim surrounding whitespace from user-provided API keys, personal API keys, and host config values before using them. (2026-04-21) - Updated dependencies [
1a0b58d]:- @posthog/core@1.25.3
- posthog-node@5.29.3
7.16.0
Minor Changes
- #3387
7ea6e26Thanks @carlos-marchal-ph! -Prompts.get()now accepts{ withMetadata: true }and returns aPromptResultobject containingsource(api,cache,stale_cache, orcode_fallback),name, andversionalongside the prompt text. The previous plain-string return is deprecated and will be removed in a future major version. (2026-04-15)
7.15.0
Minor Changes
-
#3358
85d3bd1Thanks @richardsolomou! - AddPostHogSpanProcessoras a self-contained OpenTelemetrySpanProcessorthat handles batching and export internally. BothPostHogSpanProcessorandPostHogTraceExporternow automatically filter to AI-related spans only (gen_ai.*,llm.*,ai.*,traceloop.*). (2026-04-14) -
#3377
b90b54eThanks @andrewm4894! - Add OpenAI Agents SDK tracing support via@posthog/ai/openai-agents. ImplementsPostHogTracingProcessorthat captures agent traces, spans, and LLM generations as PostHog LLM analytics events. Supports all span types including generation, response, function/tool, agent, handoff, guardrail, custom, audio, and MCP. (2026-04-14)
7.14.0
Minor Changes
-
#3368
c1f2c32Thanks @carlos-marchal-ph! - Add$ai_stop_reasonproperty capturing the LLM's reason for stopping generation across all providers (2026-04-10) -
#3369
cf69f96Thanks @carlos-marchal-ph! - Add GeminiembedContenttracking support (2026-04-10)
7.13.2
Patch Changes
- Updated dependencies [
c735b08]:- @posthog/core@1.25.2
- posthog-node@5.29.2
7.13.1
Patch Changes
- Updated dependencies [
57ee5b2]:- @posthog/core@1.25.1
- posthog-node@5.29.1
7.13.0
Minor Changes
- #3302
fc5589fThanks @dmarticus! - preserve $set_once semantics in local flag evaluation cache (2026-04-07)
Patch Changes
- Updated dependencies [
fc5589f]:- @posthog/core@1.25.0
- posthog-node@5.29.0
7.12.8
Patch Changes
- Updated dependencies [
a01a3d5]:- @posthog/core@1.24.6
- posthog-node@5.28.11
7.12.7
Patch Changes
- #3309
197eedaThanks @marandaneto! - Extract CLI and sourcemap utilities from @posthog/core into @posthog/plugin-utils to remove cross-spawn from React Native dependencies (2026-04-01) - Updated dependencies [
197eeda]:- @posthog/core@1.24.5
- posthog-node@5.28.10
7.12.6
Patch Changes
- #3299
4561c25Thanks @richardsolomou! - Remove PostHogTraceExporter from the main entry point to avoid crashing when @opentelemetry/exporter-trace-otlp-http is not installed. Use@posthog/ai/otelto import it instead. (2026-03-31)
7.12.5
Patch Changes
- Updated dependencies [
a863914]:- @posthog/core@1.24.4
- posthog-node@5.28.9
7.12.4
Patch Changes
- Updated dependencies [
4bdfdbc]:- @posthog/core@1.24.3
- posthog-node@5.28.8
7.12.3
Patch Changes
- Updated dependencies [
8d34289]:- @posthog/core@1.24.2
- posthog-node@5.28.7
7.12.2
Patch Changes
- #3264
d5b84c4Thanks @richardsolomou! - Fix crash in Vercel AI middleware when model returns only tool calls with no text content (2026-03-20) - Updated dependencies [
314120a]:- @posthog/core@1.24.1
- posthog-node@5.28.5
7.12.1
Patch Changes
- Updated dependencies [
9cd2313]:- @posthog/core@1.24.0
- posthog-node@5.28.4
7.12.0
Minor Changes
- #3232
476a823Thanks @richardsolomou! - Replace otel client-side span mapping with PostHogTraceExporter. PostHog now converts gen_ai.* spans into $ai_generation events server-side, so the client-side mapper pipeline (PostHogSpanProcessor, captureSpan, aiSdkSpanMapper) has been replaced with a simple OTLPTraceExporter wrapper. (2026-03-18)
Patch Changes
- Updated dependencies [
697e423]:
7.11.2
Patch Changes
- Updated dependencies [
bc30c2d,bc30c2d,bc30c2d]:- @posthog/core@1.23.4
- posthog-node@5.28.2
7.11.1
Patch Changes
- Updated dependencies [
4009c15]:- @posthog/core@1.23.3
- posthog-node@5.28.1
7.11.0
Minor Changes
- #3210
2d9eb60Thanks @Radu-Raicea! - Add version-specificPrompts.clearCache(name, version)support and switch prompt caching to structured name/version entries instead of string-encoded cache keys. (2026-03-09)
7.10.0
Minor Changes
- #3206
43a81c5Thanks @Radu-Raicea! - Add version-aware prompt fetching to the Prompts SDK so callers can request a specific published prompt version without colliding with the latest prompt cache entry. (2026-03-09)
7.9.5
Patch Changes
- #3194
eccec25Thanks @Radu-Raicea! - Sanitize inline base64 video_url's in chat completions calls, which is supported by OpenRouter for video understanding models (2026-03-03)
7.9.4
Patch Changes
- #3180
42b4223Thanks @dependabot! - dependencies updates: - Updated dependency@google/genai@^1.43.0↗︎ (from^1.42.0, independencies) - Updated dependency@langchain/core@^1.1.29↗︎ (from^1.1.27, independencies) - Updated dependencylangchain@^1.2.28↗︎ (from^1.2.25, independencies) - Updated dependencyopenai@^6.25.0↗︎ (from^6.22.0, independencies) (2026-03-02) - Updated dependencies [
5e8d5fc]:- @posthog/core@1.23.2
- posthog-node@5.26.2
7.9.3
Patch Changes
- #3147
b98aa23Thanks @andrewm4894! - Add$ai_tokens_sourceproperty ("sdk" or "passthrough") to all$ai_generationevents to detect when token values are externally overridden viaposthogProperties(2026-02-25) - Updated dependencies [
d43e90d,d43e90d]:
7.9.2
Patch Changes
- #3137
7d92690Thanks @dependabot! - dependencies updates: - Updated dependency@langchain/core@^1.1.27↗︎ (from^1.1.17, independencies) (2026-02-24)
7.9.1
Patch Changes
- #3133
9138eecThanks @dependabot! - dependencies updates: - Updated dependency@anthropic-ai/sdk@^0.78.0↗︎ (from^0.74.0, independencies) - Updated dependency@google/genai@^1.42.0↗︎ (from^1.40.0, independencies) - Updated dependencylangchain@^1.2.25↗︎ (from^1.2.3, independencies) - Updated dependencyopenai@^6.22.0↗︎ (from^6.17.0, independencies) (2026-02-23)
7.9.0
Minor Changes
- #3103
526520aThanks @richardsolomou! - Added AI SDK OTEL span processing pipeline (2026-02-18)
7.8.13
Patch Changes
- Updated dependencies [
9dbc05e]:- @posthog/core@1.23.1
- posthog-node@5.24.17
7.8.12
Patch Changes
- #3102
f505865Thanks @Radu-Raicea! - Bind prompt fetches to both credentials by requiringprojectApiKeyand addingtoken=<projectApiKey>to prompt API reads. (2026-02-17) - Updated dependencies [
e962f01]:- @posthog/core@1.23.0
- posthog-node@5.24.16
7.8.11
Patch Changes
- #3083
3cff372Thanks @richardsolomou! - Remove static Buffer imports for edge runtime compatibility (2026-02-12)
7.8.10
Patch Changes
- #3075
72b2bc7Thanks @dependabot! - dependencies updates: - Updated dependency@anthropic-ai/sdk@^0.74.0↗︎ (from^0.72.1, independencies) (2026-02-11)
7.8.9
Patch Changes
- #3069
c81ee34Thanks @dependabot! - dependencies updates: - Updated dependency@google/genai@^1.40.0↗︎ (from^1.38.0, independencies) (2026-02-10) - Updated dependencies [
0acf16f]:- @posthog/core@1.22.0
- posthog-node@5.24.15
7.8.8
Patch Changes
- Updated dependencies [
d578824]:- @posthog/core@1.21.0
- posthog-node@5.24.14
7.8.7
Patch Changes
- Updated dependencies [
e055f9a]:- @posthog/core@1.20.2
- posthog-node@5.24.12
7.8.6
Patch Changes
- Updated dependencies [
8f75dae]:- @posthog/core@1.20.1
- posthog-node@5.24.11
7.8.5
Patch Changes
-
#3021
e7ceae5Thanks @Radu-Raicea! - fix(llma): small prompt management fixes (2026-02-04) -
#3030
98d6274Thanks @Radu-Raicea! - Changes prompts default URL. (2026-02-04) -
Updated dependencies [
bb62809]:- @posthog/core@1.20.0
- posthog-node@5.24.10
7.8.4
Patch Changes
- Updated dependencies [
c99e5fe]:- @posthog/core@1.19.0
- posthog-node@5.24.9
7.8.3
Patch Changes
- #3008
26adbc8Thanks @dependabot! - dependencies updates: - Updated dependency@anthropic-ai/sdk@^0.72.1↗︎ (from^0.71.2, independencies) - Updated dependencyopenai@^6.17.0↗︎ (from^6.16.0, independencies) (2026-02-03) - Updated dependencies [
7768010]:- @posthog/core@1.18.0
- posthog-node@5.24.8
7.8.2
Patch Changes
- Updated dependencies [
727536c]:- @posthog/core@1.17.0
- posthog-node@5.24.7
7.8.1
Patch Changes
- Updated dependencies [
cbe84c1]:- @posthog/core@1.16.0
- posthog-node@5.24.6
7.8.0
Minor Changes
- #2915
e105fd0Thanks @richardsolomou! - feat(llma): add time to first token reporting (2026-01-29)
7.7.0
Minor Changes
- #2982
ce9b4dbThanks @Radu-Raicea! - Add prompt management functions. (2026-01-28)
7.6.1
Patch Changes
- Updated dependencies [
8c0c495]:- @posthog/core@1.15.0
- posthog-node@5.24.4
7.6.0
Minor Changes
- #2955
6db4b48Thanks @richardsolomou! - AddrawUsagefield to capture raw provider usage metadata for backend cost calculations (2026-01-27)
Patch Changes
-
#2974
93da719Thanks @dependabot! - dependencies updates: - Updated dependency@google/genai@^1.38.0↗︎ (from^1.34.0, independencies) - Updated dependency@langchain/core@^1.1.17↗︎ (from^1.1.8, independencies) (2026-01-27) -
#2977
5544606Thanks @andrewm4894! - fix: sanitize base64 images before formatting in Responses API to prevent 413 payload-too-large errors (2026-01-27) -
Updated dependencies [
f51560c]:- @posthog/core@1.14.1
- posthog-node@5.24.3
7.5.4
Patch Changes
- Updated dependencies [
933c763]:- @posthog/core@1.14.0
- posthog-node@5.24.2
7.5.3
Patch Changes
- Updated dependencies [
8a5a3d5]:- @posthog/core@1.13.0
- posthog-node@5.24.1
7.5.2
Patch Changes
- Updated dependencies [
b7fa003,f0cbc0d]:- @posthog/core@1.12.0
- posthog-node@5.24.0
7.5.1
Patch Changes
- Updated dependencies [
23770e9]:- @posthog/core@1.11.0
- posthog-node@5.23.0
7.5.0
Minor Changes
- #2930
c9b773aThanks @marandaneto! - chore: Bump node min. ^20.20.0 || >=22.22.0 due to https://nodejs.org/en/blog/vulnerability/january-2026-dos-mitigation-async-hooks (2026-01-19)
Patch Changes
- Updated dependencies [
c9b773a]:
7.4.3
Patch Changes
- Updated dependencies [
d37e570]:- @posthog/core@1.10.0
- posthog-node@5.21.1
7.4.2
Patch Changes
- #2852
308daf0Thanks @andrewm4894! - fix(vercel): preserve prototype getter properties when wrapping models (2026-01-12)
7.4.1
Patch Changes
- #2859
636e25fThanks @carlos-marchal-ph! - Fixes cache creation cost for Vercel V3 with Anthropic (2026-01-08)
7.4.0
Minor Changes
- #2593
fba9fb2Thanks @daibhin! - track LLMA trace_id on exceptions and exception_id on traces (2026-01-08)
Patch Changes
- Updated dependencies [
fba9fb2,c1ed63b]:- posthog-node@5.20.0
- @posthog/core@1.9.1
7.3.2
Patch Changes
-
#2838
c64a15dThanks @carlos-marchal-ph! - Fixes cache creation cost for Langchain with Anthropic (2026-01-07) -
#2842
0f508e9Thanks @carlos-marchal-ph! - Fixes an error with certain AI imports when using CJS (TypeError: Class extends value undefined is not a constructor or null) (2026-01-07)
7.3.1
Patch Changes
-
#2850
b5dbf56Thanks @andrewm4894! - fix(gemini): expose all GoogleGenAI constructor parameters in wrapperThe
MonitoringGeminiConfiginterface now extendsGoogleGenAIOptionsfrom@google/genai, allowing users to pass all available constructor parameters likegoogleAuthOptionsandhttpOptionswithout TypeScript errors. (2026-01-06)
7.3.0
Minor Changes
-
#2711
8c3a21eThanks @andrewm4894! - Add support for both Vercel AI SDK 5 and 6Changes:
- Runtime version detection via
model.specificationVersion - Support both
LanguageModelV2(SDK 5) andLanguageModelV3(SDK 6) @ai-sdk/provideris now an optional peer dependency (supports both v2 and v3)- Removed unused
aipeer dependency (only type imports from@ai-sdk/providerare used) - No breaking changes - existing SDK 5 users can continue without modification (2025-12-22)
- Runtime version detection via
Patch Changes
-
#2789
6b415a0Thanks @andrewm4894! - fix: extract model from response for OpenAI stored promptsWhen using OpenAI stored prompts, the model is defined in the OpenAI dashboard rather than passed in the API request. This change adds a fallback to extract the model from the response object when not provided in kwargs. (2025-12-22)
-
Updated dependencies [
04065b9]:
7.2.2
Patch Changes
- #2761
6f5db7cThanks @dependabot! - dependencies updates: - Updated dependency@anthropic-ai/sdk@^0.71.2↗︎ (from^0.67.1, independencies) - Updated dependency@google/genai@^1.33.0↗︎ (from^1.31.0, independencies) - Updated dependency@langchain/core@^1.1.5↗︎ (from^1.1.4, independencies) - Updated dependencyai@^5.0.113↗︎ (from^5.0.107, independencies) - Updated dependencylangchain@^1.2.0↗︎ (from^1.1.5, independencies) (2025-12-16)
7.2.1
Patch Changes
-
#2690
e9c00fdThanks @robbie-c! - Related to https://www.wiz.io/blog/critical-vulnerability-in-react-cve-2025-55182We didn't include any of the vulnerable deps in any of our packages, however we did have them as dev / test / example project dependencies.
There was no way that any of these vulnerable packages were included in any of our published packages.
We've now patched out those dependencies.
Out of an abundance of caution, let's create a new release of all of our packages. (2025-12-04)
-
Updated dependencies [
e9c00fd]:
7.2.0
Minor Changes
- #2619
86dab38Thanks @hpouillot! - package deprecation (2025-11-24)
Patch Changes
- Updated dependencies [
86dab38]:
7.1.2
Patch Changes
- #2618
3eed1a4Thanks @marandaneto! - last version was compromised (2025-11-24) - Updated dependencies [
3eed1a4]:
7.1.1
Patch Changes
- #2591
3dbf325Thanks @carlos-marchal-ph! - Fixes a bug that incorrectly calculated cache costs for non-Anthropic Langchain providers (2025-11-21)
7.1.0
Minor Changes
- #2498
aa9f637Thanks @Tehnix! - Added support for OpenAI audio transcriptions API. You can now track and monitor OpenAI Whisper transcription requests through the @posthog/ai SDK, with support for both streaming and non-streaming transcriptions, verbose JSON responses, and all standard transcription parameters (language, response_format, timestamp_granularities).
7.0.0
Major Changes
- #2554
8e8d2f5Thanks @carlos-marchal-ph! - Update LLM provider SDKs to latest versionsopenai: 5.20.1 → 6.8.1@anthropic-ai/sdk: 0.63.1 → 0.67.0@google/genai: 1.19.0 → 1.29.0langchain: 0.3.33 → 1.0.0@langchain/core: 0.3.75 → 1.0.0ai: 5.0.42 → 5.0.87zod: 4.1.5 → 4.1.8
6.6.0
Minor Changes
- #2518
aca2775Thanks @Radu-Raicea! - feat(llma): send number of web searches calls
6.5.1
Patch Changes
- #2537
fb2fa06Thanks @Radu-Raicea! - fix(llma): cache cost calculation in the LangChain callback
6.5.0
Minor Changes
-
#2496
7253bb3Thanks @andrewm4894! - feat: add $ai_framework property for framework integrationsAdds a simple
$ai_frameworkproperty to AI events when using framework layers (LangChain, Vercel AI SDK). Direct provider calls (OpenAI, Anthropic, Gemini) do not include this property, eliminating redundant data where framework would duplicate the provider name.Example with framework:
1{ 2 "$ai_framework": "langchain", 3 "$ai_provider": "openai", 4 "$ai_model": "gpt-4" 5}Example without framework:
1{ 2 "$ai_provider": "openai", 3 "$ai_model": "gpt-4" 4}
6.4.4
Patch Changes
- #2468
873538bThanks @andrewm4894! - fix: prevent [object Object] in content serialization - structured content is now properly JSON-stringified instead of being converted to "[object Object]"
6.4.3
Patch Changes
- #2364
d91fef6Thanks @dependabot! - Update Anthropic SDK
6.4.2
Patch Changes
- #2354
1118d4dThanks @carlos-marchal-ph! - Ensure consistent hadling of system prompts
6.4.1
Patch Changes
6.4.0
Minor Changes
- #2317
14bb69eThanks @carlos-marchal-ph! - Dependencies updated to support latest APIs from provider SDKs
6.3.3
Patch Changes
- #2324
0b7ec25Thanks @carlos-marchal-ph! - Ensure Posthog parameters are not passed to any provider
6.3.2
Patch Changes
- #2272
9eccea4Thanks @carlos-marchal-ph! - Don't send Posthog specific params to OpenAI
6.3.1
Patch Changes
- #2264
cb5dd15Thanks @carlos-marchal-ph! - Fixes noisy truncation function
6.3.0
Minor Changes
- #2253
6461420Thanks @carlos-marchal-ph! - Adds support for embeddings for OpenAI and Azure OpenAI
6.2.0
Minor Changes
- #2252
a806e49Thanks @Radu-Raicea! - send ai library version in events
6.1.2
Patch Changes
- #2230
8ed50beThanks @Radu-Raicea! - Fixes tool calls for streaming providers
6.1.1
Patch Changes
- #2217
fdfceebThanks @Radu-Raicea! - add base64 inline image sanitization
6.1.0
Minor Changes
- #2216
57752f4Thanks @k11kirky! - Add support for reasoning and cache tokens in gemini + fix token calc in vercel
6.0.1
Patch Changes
6.0.0
Major Changes
Patch Changes
- #2195
f6fdd8eThanks @Radu-Raicea! - Fix tool calls for all non-streaming providers
5.2.3
Patch Changes
- #2173
d4204f4Thanks @Radu-Raicea! - Fix bug where tool calls were not sent in LangChain
5.2.2
- Add support for parsing tool calls from reasoning models in LangChain by converting the tool call format to the expected shape
5.2.1
- Fix crash when importing @posthog/ai with OpenAI SDK v5.x by deferring access to Chat, Completions, and Responses classes until runtime
5.2.0
- Fix anonymous events
5.1.0
- Add responses + parse
5.0.1
- Bump posthog-node to v5.0.0
5.0.0
- Major bump for breaking change:
- Require node engine >20
- support for @google/genai
4.4.0
- Make
posthog-nodea peer dependency to avoid bundling implementation code
4.3.2
- Fix exported file extensions to work with older Node versions
4.3.1
- Remove fullDebug mode
- Add posthogCaptureImmediate to await a promise for each capture (for serverless environments)
- Fix openai test
4.2.1
- Add fullDebug mode and limit full size of event input
4.1.0
- add truncation to vercel ai sdk inputs and outputs
4.0.1
- add new util to sanitize inputs, outputs and errors
4.0.0
- feat: separate out packages as separate exports so you can import { OpenAI } from @posthog/ai/openai and reduce import size
3.3.2 - 2025-03-25
- fix: langchain name mapping
3.3.1 - 2025-03-13
- fix: fix vercel output mapping and token caching
3.3.0 - 2025-03-08
- feat: add reasoning and cache tokens to openai and anthropic
- feat: add tool support for vercel
- feat: add support for other media types vercel
3.2.1 - 2025-02-11
- fix: add experimental_wrapLanguageModel to vercel middleware supporting older versions of ai
3.2.0 - 2025-02-11
- feat: change how we handle streaming support for openai and anthropic
3.1.1 - 2025-02-07
- fix: bump ai to 4.1.0
3.1.0 - 2025-02-07
- feat: add posthogCostOverride, posthogModelOverride, and posthogProviderOverride to sendEventToPosthog for vercel
2.4.0 - 2025-02-03
- feat: add anthropic support for sdk