React react router 7 framework

From PostHog/skills · View interactive version

React react router 7 framework is an AI agent skill from the GitHub repository PostHog/skills. PostHog integration for React Router v7 - Framework mode applications

How to use this skill

Skill file

PostHog integration for React Router v7 - Framework mode

This skill helps you add PostHog analytics to React Router v7 - Framework mode applications.

Workflow

Follow these steps in order to complete the integration:

  1. basic-integration-1.0-begin.md - PostHog Setup - Begin ← Start here
  2. basic-integration-1.1-edit.md - PostHog Setup - Edit
  3. basic-integration-1.2-revise.md - PostHog Setup - Revise
  4. basic-integration-1.3-conclude.md - PostHog Setup - Conclusion

Reference files

The example project shows the target implementation pattern. Consult the documentation for API details.

Key principles

Framework guidelines

Identifying users

Identify users during login and signup events. Refer to the example code and documentation for the correct identify pattern for this framework. If both frontend and backend code exist, pass the client-side session and distinct ID using X-POSTHOG-DISTINCT-ID and X-POSTHOG-SESSION-ID headers to maintain correlation.

Error tracking

Add PostHog error tracking to relevant files, particularly around critical user flows and API boundaries.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.