This monorepo contains two packages for synchronizing your Stripe account with a Postgres database:
@supabase/stripe-sync-engine
: A TypeScript library for syncing Stripe data to Postgres, designed for integration into your own Node.js backend or serverless environment.stripe-sync-fastify
: A Fastify-based server and Docker image that exposes a/webhooks
endpoint for Stripe, providing a ready-to-run service for real-time Stripe-to-Postgres sync.
Sometimes you want to analyze your billing data using SQL. Even more importantly, you want to join your billing data to your product/business data.
This project synchronizes your Stripe account to a Postgres database. It can be a new database, or an existing Postgres database.
- Creates a new schema
stripe
in a Postgres database, with tables & columns matching Stripe. - Exposes a
/webhooks
endpoint that listens to any Stripe webhooks (via the Fastify app). - Inserts/updates/deletes changes into the tables whenever there is a change to Stripe.
Each package has its own README with installation, configuration, and usage instructions.
To deploy the sync-engine to a Supabase edge function, follow this guide.
-
balance.available
-
charge.captured
π’ -
charge.expired
π’ -
charge.failed
π’ -
charge.pending
π’ -
charge.refunded
π’ -
charge.refund.updated
π‘ - For updates on all refunds, listen torefund.updated
instead -
charge.succeeded
π’ -
charge.updated
π’ -
charge.dispute.closed
π’ -
charge.dispute.created
π’ -
charge.dispute.funds_reinstated
π’ -
charge.dispute.funds_withdrawn
π’ -
charge.dispute.updated
π’ -
checkout.session.async_payment_failed
-
checkout.session.async_payment_succeeded
-
checkout.session.completed
-
credit_note.created
π’ -
credit_note.updated
π’ -
credit_note.voided
π’ -
customer.created
π’ -
customer.deleted
π’ -
customer.source.created
-
customer.source.updated
-
customer.subscription.created
π’ -
customer.subscription.deleted
π’ -
customer.subscription.paused
π’ -
customer.subscription.pending_update_applied
π’ -
customer.subscription.pending_update_expired
π’ -
customer.subscription.resumed
π’ -
customer.subscription.trial_will_end
π’ -
customer.subscription.updated
π’ -
customer.tax_id.created
π’ -
customer.tax_id.deleted
π’ -
customer.tax_id.updated
π’ -
customer.updated
π’ -
invoice.created
π’ -
invoice.deleted
π’ -
invoice.finalized
π’ -
invoice.finalization_failed
π’ -
invoice.marked_uncollectible
π’ -
invoice.paid
π’ -
invoice.payment_action_required
π’ -
invoice.payment_failed
π’ -
invoice.payment_succeeded
π’ -
invoice.sent
π’ -
invoice.upcoming
π΄ - Event has no id and cannot be processed -
invoice.updated
π’ -
invoice.overdue
π’ -
invoice.overpaid
π’ -
invoice.will_be_due
π’ -
invoice.voided
π’ -
issuing_authorization.request
-
issuing_card.created
-
issuing_cardholder.created
-
payment_intent.amount_capturable_updated
π’ -
payment_intent.canceled
π’ -
payment_intent.created
π’ -
payment_intent.partially_refunded
π’ -
payment_intent.payment_failed
π’ -
payment_intent.processing
π’ -
payment_intent.requires_action
π’ -
payment_intent.succeeded
π’ -
payment_method.attached
π’ -
payment_method.automatically_updated
π’ -
payment_method.detached
π’ -
payment_method.updated
π’ -
plan.created
π’ -
plan.deleted
π’ -
plan.updated
π’ -
price.created
π’ -
price.deleted
π’ -
price.updated
π’ -
product.created
π’ -
product.deleted
π’ -
product.updated
π’ -
radar.early_fraud_warning.created
π’ -
radar.early_fraud_warning.updated
π’ -
refund.created
π’ -
refund.failed
π’ -
refund.updated
π’ -
review.opened
π’ -
review.closed
π’ -
setup_intent.canceled
π’ -
setup_intent.created
π’ -
setup_intent.requires_action
π’ -
setup_intent.setup_failed
π’ -
setup_intent.succeeded
π’ -
subscription_schedule.aborted
π’ -
subscription_schedule.canceled
π’ -
subscription_schedule.completed
π’ -
subscription_schedule.created
π’ -
subscription_schedule.expiring
π’ -
subscription_schedule.released
π’ -
subscription_schedule.updated
π’