Allow evaluating feature flags with groups
Open
Nobody has claimed this yet.
enhancement
feature/flags
team/feature-flags
web
- Dominant language
- TypeScript
- Stars
- 609
- Forks
- 344
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 312
Description
We don't want to call group() in a global scope, instead in each feature flag evaluation context send whatever groups we think are necessary to be included. Other SDKs (go and posthog-js-lite) allow to send them per feature flag evaluation, but posthog-js doesn't.
useFeatureFlagEnabled(flag, { groups: { organization });
posthog.getFeatureFlag(flag, { groups: { organization });
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the implementations of useFeatureFlagEnabled and posthog.getFeatureFlag, then trace how each feature flag evaluation receives its options. The work is done when both entry points accept per-evaluation groups consistently with the requested examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- analytics
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100