Catalog
pydantic/logfire-frontend

pydantic

logfire-frontend

Set up and troubleshoot Pydantic Logfire frontend observability and session replays in JavaScript/TypeScript browser applications. Use for browser errors, RUM, Web Vitals, replay recording, privacy controls, or reducing browser telemetry volume. Supports browser entrypoints, React/Vite, and the client side of Next.js; use logfire-instrumentation for server-side telemetry.

v1.0LATEST
NewUpdated Oct 17, 2026

Set Up Frontend Observability and Session Replays

The application uses @pydantic/logfire-browser and, when replay is requested, @pydantic/logfire-session-replay. Configure one browser provider; preserve an existing OpenTelemetry provider, proxy, and application initialization pattern.

Confirm the browser application

Read repository instructions, the application manifest, browser entrypoint, router, and existing instrumentation. For Next.js, distinguish client code from server instrumentation before changing either. Respect dependency constraints; check the installed SDK's types before using a capture or sampling option.

Preserve the exact origin, organization, and project supplied by the user or setup handoff. Browser-only setup does not require a CLI login, a local SDK credential, or an ordinary project write token. Use existing native MCP access for verification when available; otherwise use the Logfire UI.

Create or select the frontend application under Frontend → Applications and use its generated regional URL and restricted frontend token. A normal project write token, server environment variable, or .logfire credential is unsuitable for browser code. The frontend application owns service identity. If no supported public API/tool can manage it, use the UI; do not invent a private endpoint.

Match capture to the request

Read browser setup, then the applicable section of capture profiles:

  • Full frontend observability: automatic page/request/interaction spans and Web Vitals. Add replay only when requested.
  • Errors and replays with automatic instrumentation: retain traces with Logfire error-level events or OpenTelemetry error status, while keeping replay independently enabled. This also retains other spans in a qualifying trace.
  • Minimal errors and replays: disable automatic spans and Web Vitals and explicitly report application errors. Use when the user requires lower browser instrumentation overhead or strictly limits the signals collected.

Preserve existing approved replay rates and masking. Trace sampling, replay sampling, and metric capture are separate decisions. Do not promise that minLevel filters automatic spans, that a trace sampler retains an entire browser session, or that every handled application failure is captured automatically.

Session replay is Early Access; check availability for the target organization and keep an existing application rollout flag. Mask text and inputs, leave console capture off, and block sensitive regions before recording them. Review attributes and URLs separately from visible-text masking. Add normalized route templates and opaque user IDs only when useful; names and emails are optional personal data.

Verify the selected behavior

Use verification and troubleshooting to exercise the real browser application, check the signals retained and omitted, query fresh errors in the exact project, and play the matching recording. For a sampling profile, test successful requests and the failure types the user cares about; inspect actual exported spans rather than assuming how HTTP status maps to error severity.

Run the application's normal typecheck/build and focused tests. Report browser execution, telemetry ingestion, and replay playback separately. A successful build, flush, upload response, or generated link does not prove all three. Return the verified project/application, capture policy, and a clean relevant UI link. If account reads or browser playback are unavailable, mark those parts unverified and state what evidence is missing.

For server-side Node.js or Next.js setup, use application instrumentation.

Files4
4 files · 21.5 KB

Select a file to preview

Overall Score

88/100

Grade

A

Excellent

Grades are signals, not a certification. Always review a skill yourself before use.

Safety

92

Quality

88

Clarity

86

Completeness

83

Summary

This skill provides comprehensive guidance for configuring Pydantic Logfire frontend observability, session replays, and browser telemetry in JavaScript/TypeScript applications. It covers setup, capture profile selection, verification, troubleshooting, and privacy controls across multiple deployment contexts (browser entrypoints, React, Vite, Next.js). The skill is designed to work with restricted frontend tokens rather than server credentials, emphasizing security boundaries and clear scope.

Detected Capabilities

file readpackage installation guidance (npm install)environment configurationtelemetry verification via UI/APIbrowser application testing and validationTypeScript/JavaScript code examplesdocumentation and reference following

Trigger Keywords

Phrases that agents use to match this skill to user intent.

browser error trackingsession replay setupfrontend observabilityrum configurationlogfire browserjavascript telemetryweb vitalsbrowser masking privacy

Risk Signals

INFO

No security-relevant patterns detected by static pre-pass

entire skill content

Referenced Domains

External domains referenced in skill content, detected by static analysis.

nextjs.orgpydantic.devreact.devwww.npmjs.com

Use Cases

  • Set up browser error tracking and RUM in new frontend applications
  • Configure session replay recording with privacy masking
  • Troubleshoot missing telemetry signals or replay data
  • Migrate existing frontend instrumentation to Logfire
  • Implement route normalization and user identity tracking in SPAs
  • Validate telemetry ingestion and replay playback in staging
  • Reduce browser instrumentation overhead with minimal profiles
  • Add error-conditional trace sampling to frontend applications

Quality Notes

  • Excellent scope clarity: skill explicitly distinguishes browser-side setup from server-side instrumentation (logfire-instrumentation) and defers appropriately
  • Strong security guidance: repeated emphasis on using restricted frontend tokens only, not server credentials; explains why (.env, write tokens unsuitable for browser code)
  • Comprehensive reference structure: three supporting files (setup.md, capture-profiles.md, verification.md) are well-organized and internally consistent
  • Practical capture profiles: three concrete options (full observability, errors+replay+automatic, minimal) with clear tradeoffs and example configurations
  • Verification methodology is rigorous: requires exercising actual failures, inspecting network requests, querying fresh telemetry, testing replay playback separately
  • Strong error handling guidance: explicitly warns against false assumptions (e.g., build success ≠ ingestion success, HTTP status ≠ span error status) and provides troubleshooting section
  • Privacy-first approach: default masking ON, console OFF, block selectors provided, explicit note about masking not covering URLs/attributes
  • Router support is well-documented with specific imports and configuration examples for React Router, TanStack, Vue
  • Good framework-specific guidance for React Strict Mode, Next.js client vs. server, dynamic imports
  • Completeness: supporting files cover all major decision points and include real SQL queries for verification
Model: claude-haiku-4-5-20251001Analyzed: Oct 17, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Use pydantic/logfire-frontend in your dev environment

Command Palette

Search for a command to run...