posthog-core-workflow-b

Featured

Implement PostHog feature flags, A/B experiments, and cohort management. Use when rolling out features with flags, running A/B tests, creating cohorts, or evaluating multivariate experiments with PostHog. Trigger: "posthog feature flag", "posthog experiment", "posthog A/B test", "posthog cohort", "feature rollout posthog", "posthog multivariate".

AI & Automation 2,940 stars 439 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 Core Workflow B — Feature Flags & Experiments ## Overview Feature flag management, A/B experiment evaluation, and cohort analysis with PostHog. Covers boolean and multivariate flags, local evaluation for performance, experiment setup and statistical significance, and cohort creation via the API. ## Prerequisites - Completed `posthog-install-auth` setup - Familiarity with `posthog-core-workflow-a` (event capture) - Personal API key (`phx_...`) for flag management API ## Instructions ### Step 1: Evaluate Feature Flags (Browser) ```typescript import posthog from 'posthog-js'; // Boolean flag if (posthog.isFeatureEnabled('new-checkout-flow')) { renderNewCheckout(); } else { renderLegacyCheckout(); } // Multivariate flag (returns string variant name) const variant = posthog.getFeatureFlag('pricing-page-experiment'); switch (variant) { case 'control': renderOriginalPricing(); break; case 'annual-first': renderAnnualFirstPricing(); break; case 'social-proof': renderSocialProofPricing(); break; default: renderOriginalPricing(); // Fallback if flag not loaded yet } // Get flag payload (JSON data attached to a flag variant) const payload = posthog.getFeatureFlagPayload('banner-config'); // payload: { text: "Spring sale!", color: "#ff6b35", discount: 20 } // React: Wait for flags to load before rendering posthog.onFeatureFlags(() => { // Flags are now loaded and ready const enabled = posthog.isFeatureEnabled('new-feature')...

Details

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

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category