MVP Feature Flags
This document describes the PostHog feature flag system that gates non-MVP admin surfaces for the Legacy Launch.
Overview
All flags default to OFF in PostHog. This ensures a clean, focused admin experience for MVP launch. Non-MVP features remain hidden unless explicitly enabled in the PostHog dashboard.
Feature Flag Registry
Flags are defined in apps/web/src/lib/features.ts:
| Flag Key | Purpose | Surfaces Gated |
|---|---|---|
studio | Print studio access | /admin/print-studio, Print studio sidebar item |
label_portal | Label portal access | /label/*, Labels desk in admin |
demo_portals | Designer demos | /demo/* |
new_checkout | Future checkout flow | (future) |
admin_white_glove | White glove managed services | /admin/white-glove desk |
admin_card_generation | Card generation pipeline | /admin/card-generation desk |
admin_stage | Entire Slapp Stage section (Phase 2) | All /admin/stage/* routes and sidebar section |
admin_labs | Non-MVP admin desks | Campaigns, site content, gift cards, inventory, shipping, redemptions (ComingSoon), finance revenue/refunds placeholders, feature-flags desk, integrations, ops tools, audit log |
MVP Admin Navigation Allowlist
When flags are OFF (default), only these sidebar items appear:
Command
- Command center (
/admin) - Alerts (
/admin/notifications)
Fulfillment (MVP items only)
- Fulfillment overview
- Orders
- Batches and codes
- Slap codes
- Mint batch
Catalog (MVP items only)
- Catalog overview
- Pack SKUs
- Legacy (slugs + audio)
Artists
- All artists
Analytics
- Overview (
/admin/analytics) - Engagement
- Conversion
- Artists (leaderboard)
- Revenue
Marketing & Sales (MVP items only)
- Lead pipeline
Customer Care
- Support tickets
- Mailing list
Finance
- Commissions (real MVP desk)
Growth & Risk
- Affiliates
- Abuse radar
Users & Access
- Staff accounts
- Artist accounts
Site Admin
- Business settings
- Env / setup
Hidden by Default (ComingSoon Scaffolds + Phase 2)
These items do NOT appear in the sidebar when flags are off:
- Print studio — requires
studioflag - Card generation — requires
admin_card_generationflag - White glove — requires
admin_white_gloveflag - Labels desk — requires
label_portalflag - Campaigns — requires
admin_labsflag - Site content — requires
admin_labsflag - Gift cards — requires
admin_labsflag - Card designs/templates — requires
admin_labsflag - Inventory — requires
admin_labsflag - Shipping — requires
admin_labsflag - Redemptions (ComingSoon) — requires
admin_labsflag - Revenue overview — requires
admin_labsflag - Refunds & disputes — requires
admin_labsflag - Feature flags desk — requires
admin_labsflag - Integrations — requires
admin_labsflag - Ops tools — requires
admin_labsflag - Audit log — requires
admin_labsflag - Entire "Slapp Stage · Phase 2" section — requires
admin_stageflag
Implementation
Navigation Filtering
apps/web/src/lib/dashboardNav.ts contains:
- MVP_ALLOWLIST — Set of nav item IDs that always appear when flags are off
- FEATURE_FLAG_GATES — Map of item IDs to required flag keys
- shouldShowNavItem() — Filter function applied to all nav items
- adminNavSections() — Accepts
enabledFeatureFlagsarray and filters sections/items
Feature Flag Hook
apps/web/src/hooks/useFeatureFlag.ts provides:
- useFeatureFlag(flag) — Returns boolean for single flag
- useFeatureFlags(flags) — Returns map of flag states
- Fail-closed behavior — Returns false when PostHog unavailable or flag not found
Route Protection
apps/web/src/components/FeatureGate.tsx provides:
- FeatureGate — Wraps content with flag check, shows fallback when disabled
- FeatureGateInline — Simple inline gate with no fallback UI
AdminPortal Integration
apps/web/src/views/portals/AdminPortal.tsx:
- Calls
useFeatureFlags()for all admin flags - Maps enabled flags to PostHog flag keys
- Passes
enabledFeatureFlagstoadminNavSections() - Wraps non-MVP desks with
<FeatureGate>components
Enabling Flags in PostHog
For Staging QA
- Open PostHog dashboard for staging environment
- Navigate to Feature Flags
- Create or enable the flag (e.g.,
admin_labs,admin_stage) - Set rollout to 100% for staging
- Refresh admin portal — gated items now appear
For Production
Only enable flags after thorough testing in staging:
- Open PostHog dashboard for production
- Enable flag with appropriate rollout percentage
- Monitor for issues
- Gradually increase rollout if stable
Testing
Verify Navigation Filtering
-
With all flags OFF (default):
- Sidebar should show only MVP allowlist items
- ComingSoon scaffolds and Phase 2 items should be hidden
- Direct URL access to gated routes shows "not enabled" page
-
Enable
admin_labsflag:- Campaigns, site content, etc. should appear in sidebar
- Direct access to those routes works
-
Enable
admin_stageflag:- "Slapp Stage · Phase 2" section appears in sidebar
- Stage routes accessible
Verify Route Guards
- Disable all flags in PostHog
- Attempt direct navigation to
/admin/card-generation - Should show FeatureGate fallback with instructions
- Enable
admin_card_generationflag - Refresh — desk should now load
Code Locations
- Flag registry:
apps/web/src/lib/features.ts - Hook:
apps/web/src/hooks/useFeatureFlag.ts - Gate component:
apps/web/src/components/FeatureGate.tsx - Navigation filter:
apps/web/src/lib/dashboardNav.ts - AdminPortal integration:
apps/web/src/views/portals/AdminPortal.tsx
Notes for Agents
- Never change flag defaults to
truein code — flags default OFF by design - PostHog enablement is environment-specific — staging and prod are independent
- MVP allowlist is authoritative — do not add ComingSoon items to allowlist
- Prefer allowlist over individual flags — use
admin_labscatch-all for misc Phase 2 desks - Test with flags OFF first — that's the default prod state for MVP launch