Skip to content

docs: add documentation for experimental browser proxy handler#1742

Merged
alexmojaki merged 10 commits intopydantic:mainfrom
AlanPonnachan:docs/browser-proxy-handler
Mar 23, 2026
Merged

docs: add documentation for experimental browser proxy handler#1742
alexmojaki merged 10 commits intopydantic:mainfrom
AlanPonnachan:docs/browser-proxy-handler

Conversation

@AlanPonnachan
Copy link
Copy Markdown
Contributor

Summary

This PR adds the documentation for the newly merged experimental browser proxy handler (logfire.experimental.forwarding.logfire_proxy) introduced in #1697.

It bridges the gap between frontend browser telemetry and Python backends by explaining how to securely route OTLP payloads to Logfire without exposing the Write Token in the client-side code.

Changes Made

  • docs/integrations/javascript/browser.md:
    • Updated the "Securely Sending Traces" admonition to explicitly mention the new Python built-in handler.
    • Added cross-reference links to the FastAPI and Starlette documentation.
    • Updated the TS example to show url.pathname = "/logfire-proxy/v1/traces".
  • docs/integrations/web-frameworks/fastapi.md:
    • Added a "Proxying Browser Telemetry" section.
    • Provided idiomatic FastAPI examples showing how to mount the handler using @app.post while injecting the Request object.
    • Included an example demonstrating how to protect the unauthenticated endpoint using FastAPI's Depends (addressing security considerations discussed in the previous PR).
  • docs/integrations/web-frameworks/starlette.md:
    • Added a "Proxying Browser Telemetry" section.
    • Provided an example of mounting the handler directly as a Starlette Route.
    • Added a security admonition regarding authentication and rate-limiting for production use.

devin-ai-integration[bot]

This comment was marked as resolved.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment thread docs/integrations/javascript/browser.md Outdated
Comment thread docs/integrations/javascript/browser.md Outdated
Comment thread docs/integrations/web-frameworks/fastapi.md
cubic-dev-ai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@alexmojaki
Copy link
Copy Markdown
Collaborator

Thanks!

@alexmojaki alexmojaki merged commit 00f4d1c into pydantic:main Mar 23, 2026
16 checks passed
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.

2 participants