Configure Stripe payments in your PocketStarter app to accept subscriptions and one-time payments. This guide covers setup, configuration, and production deployment.
Note that the webhook points to localhost:8090 (PocketBase) and not localhost:3000 (frontend).
Copy the webhook secret to STRIPE_WEBHOOK_SECRET in .env.local
You don't need STRIPE_PUBLIC_KEY for this setup. PocketStarter uses Stripe's hosted checkout pages, which handle payment processing securely on Stripe's servers without requiring client-side integration.
The boilerplate includes a customer portal for subscription management. Users can access it from their account dashboard to update payment methods, view invoices, and cancel subscriptions.
Make sure your webhook endpoint points to your PocketBase domain (e.g., https://pb.yourdomain.com/api/stripe/webhook) and not just your frontend domain. The webhook needs to reach PocketBase directly to process payments.
The app automatically handles subscription lifecycle through webhooks. When a user subscribes, their subscription status is set to active or trialing. When they cancel or payment fails, it's updated accordingly.
You can add custom logic to the webhook handler for things like sending welcome emails or adding user credits.