Subscription lifecycle via webhooks
Payments run through Lemon Squeezy. Checkout sessions are created server-side and redirect users to a hosted payment page. After purchase, subscription management happens entirely through the Lemon Squeezy Customer Portal — signed URLs are generated on demand and remain valid for 24 hours. No custom billing UI to maintain.
Ten webhook events cover the complete subscription lifecycle. Every incoming webhook is verified using SVIX signature verification before processing. Events flow through a single endpoint that maps each event type to the corresponding database update, ensuring subscription state stays consistent without polling.
const WEBHOOK_EVENTS = [
'subscription_created',
'subscription_updated',
'subscription_cancelled',
'subscription_resumed',
'subscription_expired',
'subscription_paused',
'subscription_unpaused',
'subscription_payment_failed',
'subscription_payment_success',
'subscription_payment_recovered',
] as const
Tier-based pricing
Three tiers — Basic, Pro, and Enterprise — each available in monthly and yearly billing intervals. Tier configuration maps Lemon Squeezy variant IDs to internal plan identifiers, so pricing changes on the Lemon Squeezy dashboard propagate without code changes.