feature-flags-api

Evaluate PostHog feature flags per user in Node.js, Python, and REST APIs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It helps you add PostHog feature flags to API applications so you can enable, test, and gradually roll out behavior without shipping separate deployments for every variation.

Core Features & Use Cases

  • PostHog flag evaluation for APIs: Evaluate boolean or variant-based feature flags per user (optionally using group targeting) to control backend behavior.
  • Production-safe integration guidance: Use environment variables for PostHog keys, keep changes minimal, prefer server-side evaluation, and fall back to stable logic when flags are missing or fail to load.
  • Analytics-ready implementation: Track flag exposure with $feature_flag_called and include flag attribution on captured events so insights can segment results by the active variant.

Quick Start

Install PostHog for your API and check your boolean flag state on the server for each request, using environment variables for the project token and logging $feature_flag_called (and event properties) when the flag is evaluated.

Frequently Asked Questions about feature-flags-api

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

FAQPage Schema
How do I add PostHog feature flags to a Node.js or Python API?

To add PostHog feature flags to an API, you evaluate boolean or variant flags server-side per user using environment variables for keys, capturing $feature_flag_called events for analytics attribution.

What is server-side feature flag evaluation for APIs?

Server-side feature flag evaluation controls API behavior per user or group without repeated deployments, allowing phased experiments and rollouts by checking flag states directly in the backend service.

How do I track feature flag exposure in PostHog for API events?

You track feature flag exposure by capturing $feature_flag_called events and appending flag attribution properties to subsequent analytics events, enabling segmentation of results by the active variant.

Can I use PostHog feature flags for backend API rollouts without redeploying?

Yes, PostHog feature flags enable backend API rollouts without redeploying by evaluating flag states server-side per request, allowing you to toggle behavior dynamically using environment variable configurations.

What is the best way to handle missing or failed PostHog feature flags in an API?

The best way to handle missing or failed PostHog feature flags is to implement production-safe fallback logic, ensuring the API defaults to stable behavior when flag evaluation fails or returns no data.

Do I need environment variables to configure PostHog feature flags in an API?

Yes, you need environment variables to securely configure PostHog project tokens and keys in your API, ensuring minimal code changes and safe server-side flag evaluation across deployments.