Billing is for running Laneshot as a hosted service. Without STRIPE_SECRET_KEY, billing is off: every organization has unlimited members, storage, retention, and AI features, which is what a self-hosted server usually wants.
Plans and seats
| Plan | Members | Video retention | Storage | Automations | Transcripts and AI |
|---|---|---|---|---|---|
| Free | Up to 2 | 30 days | 5 GB | No | No |
| Pro | Unlimited | 1 year | 100 GB | Yes | No |
| Business | Unlimited | 2 years | 500 GB | Yes | Yes |
| Enterprise | Set by a platform admin | Custom | Custom | Yes | Yes |
- Seats: owners, admins, and members each take one. Guests are free and unlimited: they view, comment, and record bugs.
- Adding a member is charged right away, prorated for the rest of the period. Removing one credits the next invoice.
- New organizations start on Free. Owners upgrade from Settings > Billing, which opens Stripe Checkout.
- Manage billing opens Stripe's Customer Portal to change the payment method, see invoices, switch plans, or cancel. A cancelled plan stays active until the end of the period, then the organization returns to Free.
When a payment fails
The organization keeps full access for 14 days, with a banner for owners and admins. After that, it becomes read-only until the payment goes through: everyone can still see everything, and owners can still open billing.
Owners and admins get an email for each failed invoice, with the date the grace period ends, and another one when the organization becomes read-only.
An organization with more members than its plan allows (for example after cancelling Pro with 15 members) is also read-only, until an owner upgrades or turns some members into guests.
Set up Stripe
1. Create the products
In the Stripe dashboard (start in test mode):
- Create a product Pro with two recurring prices per unit: one monthly, one yearly, such as $9 and $90.
- Create a product Business the same way, such as $15 and $150.
- Copy the four price IDs (
price_…).
A plan can have one price only; the billing page then shows that period only.
2. Configure the Customer Portal
Under Settings > Billing > Customer portal, allow customers to update payment methods, view invoices, and cancel. To let them switch plans there, add both products to the portal's product catalog.
3. Add the webhook
Under Developers > Webhooks, add an endpoint at <APP_URL>/api/billing/webhook with these events:
checkout.session.completedcustomer.subscription.created,customer.subscription.updated,customer.subscription.deletedinvoice.paid,invoice.payment_failed
Copy its signing secret (whsec_…).
4. Set the variables
STRIPE_SECRET_KEY=sk_test_…
STRIPE_WEBHOOK_SECRET=whsec_…
STRIPE_PRICE_PRO_MONTHLY=price_…
STRIPE_PRICE_PRO_YEARLY=price_…
STRIPE_PRICE_BUSINESS_MONTHLY=price_…
STRIPE_PRICE_BUSINESS_YEARLY=price_…
# Optional: a free trial on the first paid plan.
STRIPE_TRIAL_DAYS=14
Restart the server. Existing organizations start on Free.
Test locally
Use test mode and the Stripe CLI to forward webhooks to your machine:
stripe listen --forward-to localhost:3100/api/billing/webhook
Use the whsec_… secret it prints as STRIPE_WEBHOOK_SECRET. Pay with the test card 4242 4242 4242 4242, any future date, and any CVC. To try a failed payment, use 4000 0000 0000 0341, then advance time with a test clock.
How it stays in sync
- Webhooks update the plan, status, and seat count. Each event is handled once, so Stripe's retries are harmless. If handling fails, the endpoint answers 500 and Stripe retries.
- Membership changes update the subscription's quantity right away.
- Once a day, the server re-reads every paid subscription from Stripe and fixes any drift.
Plans without Stripe
Platform admins can set an organization's plan and custom limits from the platform page, for example for an Enterprise contract invoiced outside Stripe. That plan applies even when billing is off.