PostHogofficial

logs-nextjs

PostHog/skills · updated Apr 10, 2026

$npx skills add https://github.com/PostHog/skills --skill logs-nextjs
summary

### PostHog Logging for Next.js

  • Integrate PostHog log ingestion into Next.js applications using the OpenTelemetry protocol and OTLP exporters.
  • Utilize environment variables for all PostHog keys and endpoints to ensure security and avoid hardcoding sensitive data.
  • Implement structured logging with key-value properties and initialize via instrumentation.ts for optimal framework compatibility.
skill.md

PostHog logs for Next.js

This skill helps you add PostHog log ingestion to Next.js applications.

Reference files

  • references/nextjs.md - Next.js logs installation - docs
  • references/start-here.md - Getting started with logs - docs
  • references/search.md - Search logs - docs
  • references/best-practices.md - Logging best practices - docs
  • references/troubleshooting.md - Logs troubleshooting - docs
  • references/link-session-replay.md - Link session replay - docs
  • references/debug-logs-mcp.md - Debug logs with mcp - docs

Consult the documentation for API details and framework-specific patterns.

Key principles

  • Environment variables: Always use environment variables for PostHog keys and OpenTelemetry endpoints. Never hardcode them.
  • Minimal changes: Add log export alongside existing logging. Don't replace or restructure existing logging code.
  • OpenTelemetry: PostHog logs use the OpenTelemetry protocol. Configure an OTLP exporter pointed at PostHog's ingest endpoint.
  • Structured logging: Prefer structured log formats with key-value properties over plain text messages.

Framework guidelines

  • For Next.js 15.3+, initialize PostHog in instrumentation-client.ts for the simplest setup
general reviews

Ratings

4.751 reviews
  • Zara Harris· Dec 28, 2024

    logs-nextjs reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Zara Martin· Dec 24, 2024

    Useful defaults in logs-nextjs — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Ganesh Mohane· Dec 20, 2024

    logs-nextjs has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Noah Park· Dec 20, 2024

    logs-nextjs has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Tariq Singh· Nov 19, 2024

    logs-nextjs has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Kaira Haddad· Nov 15, 2024

    I recommend logs-nextjs for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Sakshi Patil· Nov 11, 2024

    logs-nextjs reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Noah Agarwal· Nov 11, 2024

    logs-nextjs reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Zara Khan· Oct 10, 2024

    logs-nextjs fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Kaira Lopez· Oct 6, 2024

    Keeps context tight: logs-nextjs is the kind of skill you can hand to a new teammate without a long onboarding doc.

showing 1-10 of 51

1 / 6