Module: PostHog::MCP::TransportIdentity Private

Defined in:
lib/posthog/mcp/intent.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Raw transport headers stamped per event (HTTP only, never cached).

Constant Summary collapse

CLIENT_USER_AGENT_HEADER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

'user-agent'
VENDOR_CLIENT_HEADER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

'x-anthropic-client'

Class Method Summary collapse

Class Method Details

.stamp(event, headers) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



90
91
92
93
94
95
96
97
98
# File 'lib/posthog/mcp/intent.rb', line 90

def stamp(event, headers)
  return event unless headers.is_a?(Hash)

  user_agent = headers[CLIENT_USER_AGENT_HEADER]
  vendor = headers[VENDOR_CLIENT_HEADER]
  event['client_user_agent'] = user_agent if user_agent.is_a?(String) && !user_agent.empty?
  event['vendor_client'] = vendor if vendor.is_a?(String) && !vendor.empty?
  event
end