Skip to content

Max plan dev#1494

Draft
kfarr wants to merge 7 commits intomainfrom
max-plan-dev
Draft

Max plan dev#1494
kfarr wants to merge 7 commits intomainfrom
max-plan-dev

Conversation

@kfarr
Copy link
Collaborator

@kfarr kfarr commented Mar 4, 2026

No description provided.

@kfarr
Copy link
Collaborator Author

kfarr commented Mar 4, 2026

Implementation Checklist for #1482 — Max Pricing Tier

Code Implementation (Done)

  • isMax helper in src/shared/auth/api/user.js — returns isMax from cloud function, fallback to claims
  • checkUserProStatus cloud function returns isMax: plan === 'MAX' (token-management.js:326)
  • isPro returns true for Max users (Max is a superset of Pro — all isPro gates pass)
  • Stripe webhook in index.js detects Max monthly/annual price IDs, sets plan: 'MAX' custom claim
  • Token grants: Max monthly = 500, Max annual = 5,000 tokens (index.js:424-429)
  • getMonthlyAllowance() returns 500 for MAX, 140 for PRO (token-management.js:5-8)
  • Token refill logic handles MAX plan throughout token-management.js
  • PaymentModal UI — Max tier card with pricing, features, selection state (PaymentModal.component.jsx)
  • PurchaseModal UI (generator) — Max tier card with pricing, features (PurchaseModal.jsx)
  • Toolbar badge shows "MAX" for Max users (Toolbar.js:195-201)
  • ProfileHoverCard shows "MAX" badge (ProfileHoverCard.jsx)
  • Auth context includes isMax field (Auth.context.js)
  • Dev environment Stripe price IDs configured (.env.development)
  • Store includes isMax in auth state (store.js)

Upgrade / downgrade flow

  • Upgrade/Downgrade Path (Pro ↔ Max) - Currently, users with an active subscription are blocked from starting a new checkout (createStripeSession returns "You already have an active subscription"). There is no way for a Pro user to upgrade to Max or a Max user to downgrade to Pro through the app. Decision: Use integrated Stripe billing portal for users who need to change plans.
  • PaymentModal should show current plan and allow upgrade - When a subscribed user (Pro or Max) hits a feature gate or token limit and sees the PaymentModal, it currently shows a generic "Thank you for your subscription" message regardless of tier. It should: (1) indicate which plan the user is currently on (Pro or Max), (2) if the user is on Pro, show the Max tier as an upgrade option with a working checkout/upgrade flow, (3) if the user is on Max, show a message that they're on the highest tier.

Remaining Before Merge

  • Production Stripe setup — Create Max product in Stripe production, add price IDs to config/.env.production (currently empty strings)
  • Add isMax to PostHog identifyAuth.context.js:179-186 is missing isMax in the PostHog identify call (needed for analytics)
  • Stripe product/price copy — Add descriptive text for all 4 prices in Stripe dashboard (3DStreet Pro monthly, 3DStreet Pro annual, 3DStreet Max monthly, 3DStreet Max annual) so customers see clear descriptions on checkout and invoices
  • End-to-end test — Max checkout flow on dev environment (monthly + annual)
  • End-to-end test — Verify token grant after Max checkout (500 monthly, 5000 annual)
  • End-to-end test — Verify MAX badge appears after checkout
  • End-to-end test — Verify token refill works for MAX users (monthly refill of 500)
  • Visual review — PaymentModal and PurchaseModal display correctly at various viewport sizes

Post-Merge / Production Deploy

  • Add production Stripe price IDs to .env.production and deploy
  • Manual claim migration for 3 legacy Max users (lm, bv, as) (set plan claim to 'MAX')
  • Test production Max checkout flow
  • Verify webhook correctly processes production Max purchases
  • Monitor first few Max subscriptions for any issues

Open questions / add:

  • what will existing pro (monthly / annual) users see in stripe emails?
  • how is upgrade / downgrade handled?
  • as a user with an existing plan, if I hit limits or feature gate will the plan chooser show my existing plan?

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