Skip to content

docs: centralize SDK examples in official docs#661

Open
marandaneto wants to merge 5 commits into
mainfrom
docs/centralize-sdk-docs
Open

docs: centralize SDK examples in official docs#661
marandaneto wants to merge 5 commits into
mainfrom
docs/centralize-sdk-docs

Conversation

@marandaneto

@marandaneto marandaneto commented Jun 12, 2026

Copy link
Copy Markdown
Member

💡 Motivation and Context

SDK README and usage markdown files duplicated code snippets that can drift from the official documentation. This keeps public SDK usage examples in the official docs as the single source of truth while preserving local repository information like badges, Questions/community links, and example setup instructions.

💚 How did you test it?

  • Ran git diff --check.
  • Verified stale USAGE.md/old integration-doc links were removed or updated.
  • Verified existing badges and Questions/community sections are preserved.

📝 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 pnpm changeset to generate a changeset file

@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Comments Outside Diff (1)

  1. playgrounds/fastapi-exception-capture/USAGE.md

    P2 Playground left with no documentation

    After this deletion, playgrounds/fastapi-exception-capture/ contains only app.py, pyproject.toml, and uv.lock — there is no README or USAGE file of any kind. The official docs URL added to the other READMEs points to the general AI observability installation guide, which does not describe how to start this specific playground or hit its test endpoint. A developer landing in this directory has no discoverable way to run it.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: playgrounds/fastapi-exception-capture/USAGE.md
    Line: 1-18
    
    Comment:
    **Playground left with no documentation**
    
    After this deletion, `playgrounds/fastapi-exception-capture/` contains only `app.py`, `pyproject.toml`, and `uv.lock` — there is no README or USAGE file of any kind. The official docs URL added to the other READMEs points to the general AI observability installation guide, which does not describe how to start this specific playground or hit its test endpoint. A developer landing in this directory has no discoverable way to run it.
    
    How can I resolve this? If you propose a fix, please make it concise.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
README_ANALYTICS.md:1-9
**"Do not use this package" warning removed from PyPI description**

`README_ANALYTICS.md` is used verbatim as the long description for the `posthoganalytics` PyPI package (see `setup_analytics.py` line 26: `config["project"]["readme"] = "README_ANALYTICS.md"`). The original content explicitly told PyPI visitors that this package is internal-only and that they should install `posthog` instead. The replacement content is entirely generic — nothing on the PyPI page will now warn a new user away from accidentally installing `posthoganalytics` thinking it is the right package.

### Issue 2 of 3
playgrounds/fastapi-exception-capture/USAGE.md:1-18
**Playground left with no documentation**

After this deletion, `playgrounds/fastapi-exception-capture/` contains only `app.py`, `pyproject.toml`, and `uv.lock` — there is no README or USAGE file of any kind. The official docs URL added to the other READMEs points to the general AI observability installation guide, which does not describe how to start this specific playground or hit its test endpoint. A developer landing in this directory has no discoverable way to run it.

### Issue 3 of 3
examples/example-ai-openai/README.md:1-10
**Per-example setup and run instructions removed with no equivalent in docs**

Every example README previously contained the `cp .env.example .env` / `uv sync` / `source .env` / `uv run python <script>.py` steps needed to actually execute the example. The linked docs URL (`https://posthog.com/docs/ai-observability/installation`) is a general SDK installation guide and does not describe how to clone and run these individual example scripts. This same pattern applies to all 35+ example READMEs changed in this PR.

Reviews (1): Last reviewed commit: "docs: centralize SDK examples in officia..." | Re-trigger Greptile

Comment thread README_ANALYTICS.md Outdated
Comment thread examples/example-ai-openai/README.md Outdated
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

posthog-python Compliance Report

Date: 2026-06-12 12:31:08 UTC
Duration: 176085ms

✅ All Tests Passed!

45/45 tests passed


Capture Tests

29/29 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 516ms
Format Validation.Event Has Uuid 1506ms
Format Validation.Event Has Lib Properties 1506ms
Format Validation.Distinct Id Is String 1506ms
Format Validation.Token Is Present 1506ms
Format Validation.Custom Properties Preserved 1506ms
Format Validation.Event Has Timestamp 1505ms
Retry Behavior.Retries On 503 9517ms
Retry Behavior.Does Not Retry On 400 3504ms
Retry Behavior.Does Not Retry On 401 3506ms
Retry Behavior.Respects Retry After Header 9513ms
Retry Behavior.Implements Backoff 23527ms
Retry Behavior.Retries On 500 7503ms
Retry Behavior.Retries On 502 7510ms
Retry Behavior.Retries On 504 7509ms
Retry Behavior.Max Retries Respected 23527ms
Deduplication.Generates Unique Uuids 1495ms
Deduplication.Preserves Uuid On Retry 7514ms
Deduplication.Preserves Uuid And Timestamp On Retry 14519ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 7507ms
Deduplication.No Duplicate Events In Batch 1502ms
Deduplication.Different Events Have Different Uuids 1505ms
Compression.Sends Gzip When Enabled 1505ms
Batch Format.Uses Proper Batch Structure 1506ms
Batch Format.Flush With No Events Sends Nothing 1005ms
Batch Format.Multiple Events Batched Together 1504ms
Error Handling.Does Not Retry On 403 3507ms
Error Handling.Does Not Retry On 413 3507ms
Error Handling.Retries On 408 7508ms

Feature_Flags Tests

16/16 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id 1007ms
Request Payload.Flags Request Uses V2 Query Param 1005ms
Request Payload.Flags Request Hits Flags Path Not Decide 1006ms
Request Payload.Flags Request Omits Authorization Header 1006ms
Request Payload.Token In Flags Body Matches Init 1006ms
Request Payload.Groups Round Trip 1005ms
Request Payload.Groups Default To Empty Object 1005ms
Request Payload.Person Properties Distinct Id Auto Populated When Caller Omits It 1006ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False 1005ms
Request Payload.Disable Geoip Omitted Defaults To False 1005ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key 1005ms
Request Lifecycle.No Flags Request On Init Alone 503ms
Request Lifecycle.No Flags Request On Normal Capture 1507ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests 1009ms
Request Lifecycle.Mock Response Value Is Returned To Caller 1001ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event 1508ms

@marandaneto marandaneto force-pushed the docs/centralize-sdk-docs branch from bd4764d to e752a60 Compare June 12, 2026 11:48
@marandaneto marandaneto force-pushed the docs/centralize-sdk-docs branch from e752a60 to 7c71063 Compare June 12, 2026 12:14
Comment thread BEFORE_SEND.md Outdated
Comment thread README_ANALYTICS.md
Comment thread README.md
@marandaneto

Copy link
Copy Markdown
Member Author

Addressed the review feedback: restored README_ANALYTICS.md and README.md content in f2cd8a8, restored the FastAPI playground usage docs in f88b480, and the per-example README feedback is stale because the current PR no longer changes those files.

Comment thread README.md Outdated
@marandaneto marandaneto marked this pull request as ready for review June 12, 2026 12:28
@marandaneto marandaneto requested a review from a team as a code owner June 12, 2026 12:28
@marandaneto marandaneto enabled auto-merge (squash) June 12, 2026 12:28
@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Reviews (2): Last reviewed commit: "update readme framework doc links" | Re-trigger Greptile

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