Integration javascript node

From PostHog/skills · View interactive version

Integration javascript node is an AI agent skill from the GitHub repository PostHog/skills. PostHog integration for server-side Node.js applications using posthog-node

How to use this skill

Skill file

PostHog integration for JavaScript Node

This skill helps you add PostHog analytics to JavaScript Node 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.