Skip to content

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

Defaultfalse
Typeboolean
Targetingper-streamer (LD context kind=user, key streamer:<id>)
WrapperuseMarketplaceEnabled()

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 pages
  • pages/Home2.tsx — splash variant on the public /campaigns page

Rollout strategy

  1. Ship the flag, default off, no targeting rules.
  2. Internal testing: target on for specific streamer IDs (the test accounts on stage) via LD targeting.
  3. Beta cohort (optional): target a small list of streamer IDs for early-access UX feedback.
  4. Flip global rollout to 100 % when ready. No code change, no deploy.
  5. Removal cleanup PR — delete the wrapper + the Navigate guards 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

  1. Create the flag in the LaunchDarkly dashboard. Default to false (fail-closed) unless there's a strong reason otherwise.
  2. Add a typed wrapper in frontend/src/lib/flags.ts next to the existing ones. Document the purpose, the surfaces it gates, and the removal plan inline.
  3. Consume via the wrapper, never via raw useFlag(key, ...).
  4. 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.

Verifluence Documentation