Session 8: Extension Add-on & Tiered Active Periods
Date: 2026-01-30 Focus: Implementing tiered active periods and $10 extension add-on at checkout
Summary
Implemented tiered active periods for each pricing tier and a $10/year extension add-on that customers can purchase at checkout. Added expiration tracking to the database and owner dashboard.
Completed
Tiered Active Periods
- Basic tier: 1 year active
- Standard tier: 2 years active
- Premium tier: 3 years active
- Added
activeYearsproperty toPRICING_TIERSinsrc/lib/stripe.ts
$10 Extension Add-on at Checkout
- Added checkbox in Step 4 of book creation flow (
src/pages/create.astro) - Order summary dynamically updates to show extension line item when checked
- Extension added as separate Stripe line item in checkout session
extension_yearsstored in Stripe metadata and database
Database Changes
- Migration
20260130100000_add_extension_years.sql- Tracks pre-purchased extensions (useful for upsell analysis) - Migration
20260130110000_add_expires_at.sql- Stores actual expiration date
Expiration Tracking
expires_atcalculated from: tier base years + extension years- Owner dashboard (
src/pages/dashboard/[bookId].astro) shows expiration with color-coded warnings:- Normal text: >30 days remaining
- Amber warning: ≤30 days remaining
- Red text: Expired
Pricing Page Updates (src/pages/pricing.astro)
- Changed header from "keep it forever" to "One-time payment, no subscriptions"
- Each tier now shows active period: "1 year active", "2 years active", "3 years active"
- Updated FAQ to explain tiered periods, extension options, and archive/reactivation policy
Bug Fix
- Fixed double tier selection when coming from pricing page with
?tier=parameter
Files Modified
src/lib/stripe.ts- AddedactiveYears,EXTENSION_PRICE, extension line item logicsrc/pages/create.astro- Extension checkbox UI, order summary updatessrc/pages/api/create-checkout.ts- AcceptextensionYears, calculateexpires_atsrc/pages/api/stripe-webhook.ts- Readextension_yearsfrom metadata, setexpires_atsrc/pages/dashboard/[bookId].astro- Display expiration date with color warningssrc/pages/pricing.astro- Updated features and FAQSTATE.md- Updated with session notes
Migrations Applied
20260130100000_add_extension_years.sql20260130110000_add_expires_at.sql
Decisions Made
| Decision | Rationale |
|---|---|
Keep both extension_years and expires_at |
extension_years tracks purchase history for upsell; expires_at is the actual date |
| $10/year extension price | Reasonable for extending access, matches common SaaS patterns |
| 2-year data retention policy | Matches Google, Microsoft, Amazon industry standard |
| Archive vs delete | Archived books can be reactivated for $10; deleted after 2yr inactivity with 90-day notice |
Still Pending (Sheri Response Needed)
- Refund policy: Recommended 7-10 day full refund
- Word count limit: Recommended 500-750 words / 3000-4000 chars
- Premium print credit details
Next Steps (Phase 2)
- Email notification system (Azure Communication Services)
- Expiration reminder emails at 30/10/2 days before expiry
- Reactivation flow for archived books