Stripe

Seamlessly integrate Stripe payments, subscriptions, and webhooks into Convex apps with type-safe mutations and real-time sync.

Installation

npm install @convex-dev/stripe

About Stripe

A Convex component for integrating Stripe payments, subscriptions, and billing into your Convex application.

Features
🛒 Checkout Sessions - Create one-time payment and subscription checkouts
📦 Subscription Management - Create, update, cancel subscriptions
👥 Customer Management - Automatic customer creation and linking
💳 Customer Portal - Let users manage their billing
🪑 Seat-Based Pricing - Update subscription quantities for team billing
🔗 User/Org Linking - Link payments and subscriptions to users or organizations
🔔 Webhook Handling - Automatic sync of Stripe data to your Convex database
📊 Real-time Data - Query payments, subscriptions, invoices in real-time

Benefits

Use cases

how to add Stripe payments to Convex app

The @convex-dev/stripe component provides mutations and webhook handlers that connect Stripe's payment processing directly to your Convex database. You can process payments, update user records, and handle subscription changes with automatic type safety and real-time updates.

Stripe webhook handling in Convex

This component automatically verifies Stripe webhook signatures and provides handlers for common events like payment success, subscription updates, and customer changes. Webhook data syncs directly to your Convex database with proper error handling and retry logic.

Convex subscription billing integration

The component includes pre-built functions for managing Stripe subscriptions, tracking billing cycles, and updating user access based on payment status. All subscription changes automatically sync to your Convex database in real-time.

Frequently asked questions

Does this component handle Stripe webhook verification?

Yes, the @convex-dev/stripe component automatically verifies webhook signatures using your Stripe webhook secret. It validates all incoming webhooks and rejects unauthorized requests, ensuring secure payment processing in your Convex application.

Can I customize which Stripe events are processed?

The @convex-dev/stripe component allows you to configure which Stripe events trigger database updates. You can enable or disable specific event handlers and add custom logic for processing payments, subscriptions, and customer data according to your application needs.

How does this integrate with Convex's real-time features?

When Stripe webhooks update your database through @convex-dev/stripe, all connected clients receive real-time updates via Convex's reactive queries. This means payment confirmations, subscription changes, and billing updates instantly reflect across your application without manual polling.

What Stripe data gets stored in my Convex database?

The @convex-dev/stripe component stores essential payment and subscription data in your Convex database, including customer IDs, payment statuses, subscription tiers, and billing cycles. You control which fields are saved and can extend the schema to include additional Stripe metadata for your application.

Links