Webhook

This guide will help you integrate Stripe and Lemonsqueezy webhooks to keep subscription and payment data updated in real-time. It explains key webhook events and how to customize them for your Next.js Supabase AI template.

Overview

We use webhooks from Stripe and Lemonsqueezy to stay updated on key events from both the Checkout and Customer Portal. These webhooks enable real-time synchronization between your billing provider and Supabase, ensuring that your subscription data is always accurate and up to date.

Key Webhook Events:

Stripe

By default, we listen to the following Stripe events:

  • checkout.session.completed
  • customer.subscription.created
  • customer.subscription.updated
  • customer.subscription.deleted

Lemonsqueezy

By default, we listen to the following Lemonsqueezy events:

  • subscription_created
  • subscription_updated
  • subscription_cancelled
  • subscription_resumed
  • subscription_expired

Each of these events triggers a webhook that resyncs the necessary data in Supabase, keeping your app's subscription information accurate.

Customizing Webhooks

You can customize the webhooks to listen to additional events based on your needs. Refer to the local setup or production deployment documentation for further customization options.

Resources

For more information on webhooks, check out:

On this page