Agent skill · software engineering · jeremylongshore

posthog-install-auth

Install an official PostHog SDK and configure the correct project token, regional host, and server-only credentials. Use when bootstrapping or repairing SDK authentication. Trigger with "install PostHog", "configure PostHog", or "PostHog API key".

Why this skill is useful

Adds installation scripts and configuration patterns for PostHog SDKs that are not commonly known or documented.

What it needs

Requires node, python installed locally. Requires posthog account access. About 3k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

PostHog Install & Auth Overview Install PostHog SDKs and configure authentication. PostHog uses two key types: Project API Key (phc...) for event capture (public, safe for frontend) and Personal API Key (phx...) for private API endpoints (never expose to clients). Prerequisites Node.js 20+ or Python 3.10+ PostHog account at app.posthog.com Project API key from Project Settings > Project API Key Personal API key from Settings > Personal API Keys (for server-side admin) Instructions Tool discipline Use Read to inspect the relevant configuration and implementation before proposing changes. Use Grep to locate initialization, capture, flag, and credential boundaries. Use Write only for a new, explicitly requested artifact inside the target project. Use Edit for minimal changes to existing project files after the evidence pass. Step 1: Install the SDK Step 2: Configure Environment Variables Step 3: Initialize Browser SDK (posthog-js) Step 4: Initialize Server SDK (posthog-node) Step 5: Initialize Python SDK Step 6: Verify Connection API Key Reference Key Type Prefix Use Expose to Client? ---------- -------- ----- ------------------- Project API Key phc Capture events, evaluate flags Yes (public) Personal API Key phx Private API scripts and HogQL queries Never Feature Flags Secure API Key project-specific secret Server-side local flag evaluation Never API Hosts Region Ingest Host App Host -------- ------------ ---------- US Cloud https://us.i.posthog.com https://us.posthog.com EU Cloud https://eu.i.posthog.com https://eu.posthog.com Self-hosted Your domain Your domain Error Handling Error Cause Solution ------- ------- ---------- posthog.init ignored Called server-side Guard with typeof window !== 'undefined' Events not appearing Wrong API key prefix Use phc project key for capture 401 Unauthorized on API Personal key expired/missing Generate new key in Settings > Personal API Keys ECONNREFUSED Wrong host URL Verify US vs EU region in apihost Module not found SDK not insta …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/posthog-install-auth

View the source on GitHub

Browse the @skills marketplace