integration-react-react-router-7-declarative

Official

PostHog analytics for React Router v7

AuthorPostHog
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Enables seamless PostHog analytics integration in React Router v7 Declarative mode, enabling instrumentation of client-side events across route transitions and user actions without imperative routing changes.

Core Features & Use Cases

  • Declarative integration that wires PostHog provisioning to React Router routes, enabling consistent event capture across pages.
  • Guidelines for environment setup, provider wrapping, and typical event patterns like identify, capture, and error tracking.
  • Use Case: Ship a single-page app with route transitions and capture business-critical metrics such as page navigations, button clicks, and user identifications.

Quick Start

Install posthog-js and @posthog/react, configure environment variables, and wrap your BrowserRouter with PostHogProvider to enable declarative analytics.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: integration-react-react-router-7-declarative
Download link: https://github.com/PostHog/skills/archive/main.zip#integration-react-react-router-7-declarative

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.