logfire-frontend — Claude Code skill: what it does, how to install
logfire-frontend sets up browser observability and session replays for Pydantic Logfire in JavaScript and TypeScript applications.
MIT 237 installs ★ 156 updated 2026-10-16
npx skills add pydantic/skills --skill logfire-frontend -a claude-codeWhat logfire-frontend does
The skill integrates @pydantic/logfire-browser and @pydantic/logfire-session-replay to capture browser errors, Web Vitals, and user sessions in React, Vite, and Next.js client code. The agent inspects the entrypoint, selects a capture profile, and applies data masking rules before recording.
A restricted frontend token and regional URL from the Logfire dashboard are required since server credentials are incompatible with browser execution. Session replays are in Early Access, so availability depends on the organization settings.
What it helps with
- set up browser error tracking
- configure session replays and RUM
- reduce client telemetry volume
- verify exported spans
Example prompts for the agent
- Set up logfire-frontend for our React app
- Check telemetry and session playback with logfire-frontend
- Configure minimal error capture in Next.js client code
How to install logfire-frontend
1Skills CLI (Vercel)
npx skills add pydantic/skills --skill logfire-frontend -a claude-code2Manually: put the files in place
~/.claude/skills/logfire-frontend/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/logfire-frontend/
1Skills CLI (Vercel)
npx skills add pydantic/skills --skill logfire-frontend -a codex2Manually: put the files in place
.agents/skills/logfire-frontend/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add pydantic/skills --skill logfire-frontend -a cursor2Manually: put the files in place
.cursor/skills/logfire-frontend/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install pydantic/skills skills/logfire-frontend2Manually: put the files in place
.github/skills/logfire-frontend/SKILL.md1Skills CLI (Vercel)
npx skills add pydantic/skills --skill logfire-frontend -a gemini-cli2Platform CLI
gemini skills install https://github.com/pydantic/skills --path skills/logfire-frontendManually: put the files in place
.devin/skills/logfire-frontend/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add pydantic/skills --skill logfire-frontend -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about logfire-frontend
How to install logfire-frontend in Claude Code?
Run npx skills add pydantic/skills --skill logfire-frontend -a claude-code followed by ~/.claude/skills/logfire-frontend/SKILL.md.
What does logfire-frontend do?
It guides the AI agent through setting up frontend observability and session replays for Pydantic Logfire in browser applications.
What is needed to use logfire-frontend?
A frontend application created in the Logfire UI with its regional URL and a restricted frontend token.
Source text
SKILL.md · MIT
--- name: logfire-frontend description: 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. --- # 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](./references/setup.md), then the applicable section of [capture profiles](./references/capture-profiles.md): - **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](./references/verification.md) 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](../logfire-instrumentation/SKILL.md).
© pydantic · MIT · pydantic/skills