integration-javascript_node

Instrument Node.js applications with PostHog to capture events and identify users.

58|5|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/PostHog/skills --skill integration-javascript-node
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: integration-javascript_node
Source: https://github.com/PostHog/skills/tree/main/skills/posthog/integration/skills/javascript_node
Command: npx skills add https://github.com/PostHog/skills --skill integration-javascript-node

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps backend Node.js apps instrument and send analytics data to PostHog using the posthog-node SDK, enabling reliable event capture and user identification in server environments.

Core Features & Use Cases

  • Instrument server-side Node.js apps with PostHog using the posthog-node SDK for capturing events and identifying users.
  • Follow server-side best practices to ensure secure, non-intrusive analytics and error tracking in production.
  • Use case: add event tracking to critical backend endpoints (auth, payments, API routes) and correlate with frontend events.

Quick Start

Install the posthog-node package, initialize the client with your project token and host, and start sending events.

Frequently Asked Questions about integration-javascript_node

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I track user events in a Node.js backend with PostHog?

Track user events in Node.js by installing the posthog-node SDK, initializing the client with your project token and host, and calling the capture method to send server-side analytics data.

What is the best way to identify users server-side in Node.js analytics?

Identify users server-side by using the posthog-node SDK's identify method within your Node.js application, which links backend events to specific user profiles for reliable analytics tracking.

Can I use PostHog instrumentation for critical API routes in production?

Yes, you can instrument critical production API routes like auth and payments in Node.js, adhering to non-intrusive instrumentation and environment-based configuration best practices for secure analytics.

How do I configure environment variables for PostHog Node.js integration?

Configure environment variables for PostHog Node.js integration by storing your project token and host in environment files, ensuring secure, non-intrusive analytics initialization in production environments.

Why should I instrument backend Node.js events instead of only tracking frontend clicks?

Instrumenting backend Node.js events allows you to capture critical server-side actions like payments and auth, and correlate them with frontend events for comprehensive analytics coverage.

Does the posthog-node SDK support error tracking in Node.js production apps?

Yes, the posthog-node SDK supports error tracking in production Node.js apps, enabling you to capture and monitor server-side exceptions alongside standard user analytics events.