feature-flags-web

Evaluate PostHog feature flags in Web JavaScript applications.

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/FrekiManagarm/dunlo --skill feature-flags-web-frekimanagarm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: feature-flags-web
Source: https://github.com/FrekiManagarm/dunlo/tree/main/.agents/skills/feature-flags-web
Command: npx skills add https://github.com/FrekiManagarm/dunlo --skill feature-flags-web-frekimanagarm

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you integrate PostHog feature flags into Web (JavaScript) apps so you can control user-visible behavior without redeploying.

Core Features & Use Cases

  • Feature flag evaluation patterns: Check boolean flags and multivariate variants using the PostHog JavaScript SDK methods.
  • Reliable flag loading: Use the onFeatureFlags callback to avoid running logic before flags are fetched for first-time visits.
  • Operational best practices: Prefer environment variables for keys, keep flag code changes minimal, and evaluate server-side when possible to reduce UI flicker.

Use case example: You want to progressively enable a new pricing page for a subset of users; use a boolean flag to gate the UI and (optionally) read the payload for rollout configuration.

Quick Start

Add PostHog feature flag checks in your Web (JavaScript) app using environment-provided configuration, and use onFeatureFlags when you need the flag values available immediately on first load.

Frequently Asked Questions about feature-flags-web

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

FAQPage Schema
How do I integrate PostHog feature flags into a React application?

To integrate PostHog feature flags in React, initialize the PostHog JavaScript SDK using environment variables and evaluate boolean or multivariate flags via client-side hooks to gate UI components without requiring application redeployment.

Why are my PostHog feature flag values undefined on first page load?

PostHog feature flag values are undefined on first load because the SDK has not fetched them yet. Use the onFeatureFlags callback to ensure flags are fully loaded before executing evaluation logic to prevent undefined values.

How do I check multivariate flag variants in JavaScript?

To check multivariate flag variants in JavaScript, use the PostHog SDK methods to evaluate multivariate flags and read the specific flag payloads, allowing you to control granular rollout configurations like custom user percentages.

Does PostHog feature flag evaluation work for general frontend JavaScript outside React?

PostHog feature flag evaluation works for general frontend JavaScript. The SDK supports evaluating boolean and multivariate flag logic across any web JavaScript application, not just React components, using standard initialization methods.

What's the best way to prevent UI flicker during client-side feature flag rollout?

To prevent UI flicker during client-side feature flag rollout, evaluate flags server-side when possible. If evaluating client-side, use the onFeatureFlags callback to delay rendering until cached values are reliably loaded.