Skip to content

docs: explain that the sdk-info header sets $lib on 1.0 - #280

Open
eli-r-ph wants to merge 3 commits into
v1from
v1-sdk-identity-docs
Open

eli-r-ph wants to merge 3 commits into
v1from
v1-sdk-identity-docs

Conversation

@eli-r-ph

@eli-r-ph eli-r-ph commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

The 1.0 migration guide doesn't say how $lib and $lib_version change. On the V1 path, capture sets both from the posthog-sdk-info header (always posthog-rs/<version>) and overwrites any value in the event. In 0.x, prepare_for_v0 filled them only when missing, so a value set by the caller was kept.

This PR adds an "SDK identity" section to docs/migration-0.x-to-1.0.md. No code change. The SDK still sends a caller-set $lib, and PostHog overwrites it.

The AI events paragraph and the capture-ai-lane changeset now say the immediate AI variants also drop an event over 8 MiB locally, which #286 implements.

posthog-python 8.0 (PostHog/posthog-python#1034) and posthog-go v2 (PostHog/posthog-go#361) document the same rule: one SDK identity per client, set from the header.

💚 How did you test it?

Docs only. I checked the behavior in the source: prepare_for_v0 on main keeps an existing $lib, and on v1 nothing in src/ adds or removes $lib (build_headers_sdk_info_is_canonical_lib_slash_version covers the header).

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran sampo add to generate a changeset file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

@eli-r-ph
eli-r-ph requested a review from a team as a code owner October 8, 2026 00:09
@eli-r-ph eli-r-ph self-assigned this Oct 8, 2026
Covers the event ID rules, the $lib strip and the removed $lib_version
parts, AI lane size limits, the C compiler need, retryable statuses and
the no-hook log line, newly non-exhaustive types, and $debug_images.
Adds changesets for capture_ai, the TLS features, the non-exhaustive
types and the SDK identity header, and uses real per-event quota tags in
test fixtures.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant