Feature Flags
LaunchDarkly is wired through frontend/src/contexts/LDAuthBridge.tsx and read via frontend/src/hooks/useFlag.ts. Every flag we consume gets a typed wrapper in frontend/src/lib/flags.ts so call sites are self-documenting and removal is a single grep.
Active flags
streamer-marketplace-enabled
| Default | false |
| Type | boolean |
| Targeting | per-streamer (LD context kind=user, key streamer:<id>) |
| Wrapper | useMarketplaceEnabled() |
Gates the marketplace surface for streamer accounts during the pre-launch "Streamers Onboarding" phase. When off, streamers can sign up via Kick OAuth, fill out their profile (Personal, Wallet, KYC), and see their trust score — but the Inbox / Offers / Negotiations / Deals pages are hidden from the sidebar and direct URL access bounces to the dashboard. The public /campaigns landing shows a "Marketplace launching soon" splash to anonymous visitors and unauthenticated streamers.
Operators are unaffected — they continue creating campaigns and may queue invites. Those invites become visible to streamers the moment the flag flips on.
Where it's read
pages/streamer/ProfileLayout.tsx— sidebar items filter + path-based redirect for direct URL access to marketplace pagespages/Home2.tsx— splash variant on the public/campaignspage
Rollout strategy
- Ship the flag, default off, no targeting rules.
- Internal testing: target on for specific streamer IDs (the test accounts on stage) via LD targeting.
- Beta cohort (optional): target a small list of streamer IDs for early-access UX feedback.
- Flip global rollout to 100 % when ready. No code change, no deploy.
- Removal cleanup PR — delete the wrapper + the
Navigateguards once 100 % rollout is stable. Treat the flag as a deployment vehicle, not a permanent runtime knob.
Server-side enforcement
Currently none. During pre-launch there is no offer / deal data flowing yet, so the worst case for an unauthorised API call is "got an empty list". Layer in if/when the LD Node SDK gets adopted on the backend.
Adding a new flag
- Create the flag in the LaunchDarkly dashboard. Default to
false(fail-closed) unless there's a strong reason otherwise. - Add a typed wrapper in
frontend/src/lib/flags.tsnext to the existing ones. Document the purpose, the surfaces it gates, and the removal plan inline. - Consume via the wrapper, never via raw
useFlag(key, ...). - When the feature graduates, delete the wrapper and any
if (!flag) return <Navigate …>guards. The flag becomes implicitly true for all callers; LD dashboard entry can be archived after.