Modules / Identity and access
Stripe configuration and webhooks
Connect web subscriptions to server-owned entitlements.
Setup and configuration
Use Stripe sandbox credentials while integrating. Configure BILLING_PROVIDER=stripe, STRIPE_SECRET_KEY, STRIPE_PRICE_ID, and STRIPE_WEBHOOK_SECRET on the server. The price must represent the intended recurring subscription.
Webhook endpoint: /api/billing/webhook
Checkout endpoint: /api/billing/checkout
Portal endpoint: /api/billing/portalImplementation workflow
Follow the lifecycle event list in docs/real-provider-smoke.md when configuring the webhook endpoint. Signature verification requires the endpoint's matching webhook secret. A checkout redirect alone must never grant access.
The entitlement at the server action boundary decides whether paid work is permitted. Process repeated events safely and scope customer/subscription records to the correct workspace. Web checkout remains separate from native purchases.
Verification and troubleshooting
Test activation, updates, cancellation, invalid signatures, and repeated events in the sandbox. Inspect persisted access state after processing. Creating an unconsumed checkout session proves connectivity only, not lifecycle fulfillment.