posthog-multi-env-setup

Featured

Configure PostHog across development, staging, and production environments. Separate PostHog projects per environment, environment-specific SDK config, feature flag rollout per env, and session recording controls. Trigger: "posthog environments", "posthog staging", "posthog dev prod", "posthog environment setup", "posthog project per env".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# PostHog Multi-Environment Setup ## Overview Use separate PostHog projects for each environment (dev, staging, production). This prevents dev/test events from polluting production analytics, allows different feature flag rollout percentages per environment, and lets you disable session recordings in non-production. ## Prerequisites - PostHog Cloud account or self-hosted instance - Admin access to create multiple projects - Deployment platform with environment variable support ## Environment Strategy | Environment | PostHog Project | Session Recording | Autocapture | Feature Flags | |-------------|----------------|-------------------|-------------|---------------| | Development | `myapp-dev` | Disabled | Enabled | 100% rollout (test all) | | Staging | `myapp-staging` | Disabled | Enabled | 100% rollout (QA all) | | Production | `myapp-prod` | 10% sampled | Tuned | Gradual rollout | ## Instructions ### Step 1: Create Separate PostHog Projects In PostHog Cloud (app.posthog.com), create three projects: 1. `myapp-development` — copy the `phc_...` project API key 2. `myapp-staging` — copy the `phc_...` project API key 3. `myapp-production` — copy the `phc_...` project API key ### Step 2: Environment Variables ```bash # .env.local (development — git-ignored) NEXT_PUBLIC_POSTHOG_KEY=phc_dev_key_here NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com POSTHOG_PERSONAL_API_KEY=phx_your_key POSTHOG_PROJECT_ID=11111 # .env.staging (CI/CD secrets or secret manager) NEXT_PUBLIC_...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

posthog-install-auth

Install and configure PostHog SDKs with authentication. Use when setting up posthog-js (browser), posthog-node (server), or configuring API keys for a new PostHog integration. Trigger: "install posthog", "setup posthog", "posthog auth", "configure posthog API key", "posthog init".

2,266 Updated today
jeremylongshore
AI & Automation Featured

posthog-prod-checklist

Production readiness checklist for PostHog integrations: SDK configuration, graceful degradation, health checks, shutdown hooks, and rollback procedures. Trigger: "posthog production", "deploy posthog", "posthog go-live", "posthog launch checklist", "posthog production ready".

2,266 Updated today
jeremylongshore
AI & Automation Featured

posthog-local-dev-loop

Configure PostHog local development with mocking, debug mode, and testing. Use when setting up a development environment, mocking PostHog for tests, or establishing a fast iteration cycle with posthog-js or posthog-node. Trigger: "posthog dev setup", "posthog local development", "posthog dev environment", "mock posthog", "test posthog".

2,266 Updated today
jeremylongshore
AI & Automation Featured

posthog-security-basics

Secure PostHog integration: API key management, project key vs personal key separation, secret rotation, scoped keys, and git-leak prevention. Trigger: "posthog security", "posthog secrets", "secure posthog", "posthog API key security", "posthog key rotation".

2,266 Updated today
jeremylongshore
AI & Automation Featured

hubspot-multi-env-setup

Configure HubSpot across development, staging, and production environments. Use when setting up per-environment HubSpot portals, configuring separate access tokens, or implementing environment isolation for HubSpot integrations. Trigger with phrases like "hubspot environments", "hubspot staging", "hubspot dev prod", "hubspot test account", "hubspot config by env".

2,266 Updated today
jeremylongshore