Skip to content

feat: add billing waitlist mode with feature flag#71

Merged
thomasblaymire merged 1 commit into
mainfrom
feat/billing-waitlist-mode
Mar 16, 2026
Merged

feat: add billing waitlist mode with feature flag#71
thomasblaymire merged 1 commit into
mainfrom
feat/billing-waitlist-mode

Conversation

@thomasblaymire
Copy link
Copy Markdown
Owner

Summary

  • Adds NEXT_PUBLIC_BILLING_ENABLED feature flag to toggle between Stripe checkout and a waitlist flow
  • When billing is disabled (production): upgrade buttons become "Join Waitlist", submitting sends an admin notification email with user/org/plan details, and buttons change to "You're on the list!"
  • When billing is enabled (UAT/preview): existing Stripe checkout flow works unchanged

Changes

  • env.ts — new NEXT_PUBLIC_BILLING_ENABLED client env var
  • billing.ts — new joinWaitlist server action
  • email.ts — new sendWaitlistNotificationEmail function
  • waitlist-notification.tsx — admin email template (follows signup-notification.tsx pattern)
  • billing-page-client.tsx — branches on flag, extracted handleCheckout/handleWaitlist helpers
  • plan-card.tsx — new waitlistMode/onWaitlist props for button state

Test plan

  • 15 new unit tests (PlanCard waitlist props + BillingPageClient flow branching)
  • Set NEXT_PUBLIC_BILLING_ENABLED=false in Vercel production
  • Set NEXT_PUBLIC_BILLING_ENABLED=true in Vercel preview
  • Verify waitlist email arrives with correct details
  • Verify Stripe checkout still works in preview

replace upgrade buttons with "join waitlist" flow when
NEXT_PUBLIC_BILLING_ENABLED is unset or false. sends admin
notification email with user/org/plan details. stripe checkout
remains active when flag is set to true for uat/preview testing.
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
switchflag-app Ready Ready Preview, Comment Mar 16, 2026 9:17pm
switchflag-web Ready Ready Preview, Comment Mar 16, 2026 9:17pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
switchflag-docs Skipped Skipped Mar 16, 2026 9:17pm

@github-actions
Copy link
Copy Markdown

Preview Environment

Role Email Password
Owner e2e-owner@test.local TestPassword123!
Member e2e-member@test.local TestPassword123!
Admin e2e-admin@test.local TestPassword123!

Preview URL: https://switchflag-o47xqr4fe-tom-blaymires-projects-d8765916.vercel.app

Database: switchflag-pr-71

@thomasblaymire thomasblaymire merged commit ea48ec6 into main Mar 16, 2026
17 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 70.70064% with 92 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
apps/dashboard/src/actions/billing.ts 0.00% 30 Missing ⚠️
...ard/src/emails/templates/waitlist-notification.tsx 44.44% 30 Missing ⚠️
apps/dashboard/src/lib/email.ts 0.00% 30 Missing ⚠️
...ard/src/components/billing/billing-page-client.tsx 92.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant