BuilderKit provides seamless integration with two popular payment gateways: Stripe and Lemon Squeezy. This allows you to easily handle subscriptions and process payments within your application.
Before you proceed, make sure the supbase setup is completely done, else you will get an error.
Payment Methods Overview
Stripe is a widely used payment gateway that offers a robust set of features for handling online payments and subscriptions.
Configuration
To enable Stripe in your BuilderKit application, you need to set the following environment variables in your .env
file:
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
Webhook Handling
BuilderKit automatically handles incoming webhook events from Stripe. The webhook route is defined in /api/webhooks/stripe/route.ts
. It processes events such as customer.subscription.created
and customer.subscription.updated
to keep your application's subscription data in sync with Stripe.
Payment Button
BuilderKit provides a reusable payment button component (ButtonPayment
) that handles the payment flow for different subscription plans and frequencies.
For more detailed information on Stripe integration, please refer to the Builderkit Stripe Documentation.
By leveraging the payment gateway integrations provided by BuilderKit, you can easily implement subscription-based functionality in your application without the hassle of setting up the payment infrastructure from scratch.