PostHog / PostHog/posthog

Feature Request: Set flag distribution in bootstrap

Open
#35,152 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement feature/feature-flags team/feature-flags
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
7h 27m
Merged PRs (30d)
222

Description

Feature request

Is your feature request related to a problem?

The custom Fast feature flags library allows users to bootstrap flags and set distribution in the frontend, this makes it useful for use cases where users want to avoid flicker which happens when waiting for flag evaluation.

Describe the solution you'd like

A way to set flag distribution from the SDK that's similar to this:

     const assignedFeatureFlags = PFFF([
       {
         key: 'blog-post-cta',
         variants: {
           control: 0.50,
           test: 0.50,
         },
       }]);

From: https://github.com/danielbachhuber/posthog-fast-feature-flags/blob/main/src/posthog-fast-feature-flags.ts

Describe alternatives you've considered

  • Use bootstrapping, but calculate the flags on the server or a view before the one where the flag is needed immediately

Additional context

From: https://posthoghelp.zendesk.com/agent/tickets/34303 (moved to PostHog: https://us.posthog.com/project/2/support/tickets/35904)

Debug info
null

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the referenced src/posthog-fast-feature-flags.ts implementation and the bootstrapping documentation to understand the requested frontend behavior. Clarify the target PostHog SDK entry point and interface with maintainers; done should mean the distribution can be specified from the SDK without relying on server-side flag calculation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.