Feature Flags
Overview
Feature flags allow shipping code to production without immediately exposing features. For MVP, flags are implemented as environment variables — no external service needed until Phase 2.
Current Flags
| Flag | Default | Description |
|---|---|---|
NEXT_PUBLIC_FEATURE_PODCAST | false | Podcast section on home + /podcast page |
NEXT_PUBLIC_FEATURE_MEDIA_KIT | false | Email-gated media kit download |
NEXT_PUBLIC_FEATURE_CALENDLY | false | Calendly embed on contact page |
NEXT_PUBLIC_FEATURE_HUBSPOT_SYNC | false | Sync leads to HubSpot CRM |
NEXT_PUBLIC_FEATURE_PLAUSIBLE | false | Plausible analytics script |
NEXT_PUBLIC_FEATURE_SENTRY | false | Sentry error tracking |
Usage
export const flags = { podcast: process.env.NEXT_PUBLIC_FEATURE_PODCAST === 'true', mediaKit: process.env.NEXT_PUBLIC_FEATURE_MEDIA_KIT === 'true', calendly: process.env.NEXT_PUBLIC_FEATURE_CALENDLY === 'true', hubspotSync: process.env.NEXT_PUBLIC_FEATURE_HUBSPOT_SYNC === 'true', plausible: process.env.NEXT_PUBLIC_FEATURE_PLAUSIBLE === 'true', sentry: process.env.NEXT_PUBLIC_FEATURE_SENTRY === 'true',} as const;
// In a componentimport { flags } from '@/lib/flags';
export function PodcastSection() { if (!flags.podcast) return null; return <section>...</section>;}Environment Matrix
| Environment | Podcast | Media Kit | Calendly | HubSpot |
|---|---|---|---|---|
| Development | true | true | false | false |
| Staging | true | true | true | true |
| Production (pre-launch) | false | false | false | false |
| Production (post-launch) | true | true | true | true |
Milestone Gates
| Milestone | Flags Enabled |
|---|---|
| M4 — Booking | None (booking form is in main flow) |
| M5 — Media Kit | FEATURE_MEDIA_KIT |
| M6 — Podcast | FEATURE_PODCAST |
| M7 — SEO | FEATURE_PLAUSIBLE, FEATURE_SENTRY |
| M8 — Launch | All flags enabled in production |
Adding a Flag
- Add to
.env.examplewith description and default value - Add to
lib/flags.ts - Update this document
- Set in Vercel Environment Variables per environment