Stripe-To-Postgres Sync Engine as standalone Library
Supabase's stripe-sync-engine, a webhook listener that normalizes Stripe events into relational Postgres tables, is now published as the npm package @supabase/stripe-sync-engine instead of only a Docker image. It can run in Node.js, Express or Supabase Edge Functions via a StripeSync class whose processWebhook method takes the raw body and signature. Schema migrations should be run separately with runMigrations or folded into the regular migration workflow, after which incoming webhooks populate a stripe schema. Keeping Stripe data local avoids API round-trips and enables joins for billing dashboards, fraud checks and dunning workflows.
Related posts
- Sync Stripe Data to Your Supabase Database in One Click
Supabase mediumAdeptSupabase now offers a one-click Stripe Sync Engine integration that copies Stripe customers, subscriptions, invoices and payments into real Postgres tables, kept current via webhooks plus scheduled backfills run through pgmq-based Supabase Queues and Edge Functions with retries. Unlike the existing Stripe Foreign Data Wrapper, which translates each query into Stripe API calls and slows down or hits rate limits on joins and aggregations, the sync engine lets queries run against local indexed data. Example SQL shows finding unconverted signups, computing MRR by plan, and spotting inactive paying accounts. Stripe contributed JSONB storage with generated columns, cursor-based incremental sync, Connect multi-account support and a CLI to the open-source engine.
- Building with Stripe Data Pipeline and the Neon backend
Neon mediumAdept
Stripe Data Pipeline's real-time sync streams Stripe objects into Postgres tables within seconds, which lets apps drop webhooks entirely: they write to Stripe's API and read charges, prices and promotion codes from synced stripe.* tables. Two example apps compute credit balances as a SQL view (purchased minus spent), so refunds, disputes and duplicate deliveries are handled without handler code. Double spending is prevented by a per-user advisory lock plus a conditional UPDATE that claims a job only if the view shows enough balance. Neon point-in-time branches copy Stripe data, app data, object storage and disabled triggers, so billing bugs can be reproduced and fixed locally without touching production.
- Offline-first React Native Apps with Expo, WatermelonDB, and Supabase
Supabase mediumAdeptAn offline-first React Native/Expo app can use WatermelonDB (SQLite-based, last-write-wins sync) as its local store and sync to Supabase Postgres through two RPC calls: a `push` function that applies client changesets and a `pull` function that returns all changes since the last sync timestamp. The walkthrough covers adding simdjson via expo-build-properties, defining WatermelonDB models, and writing the PL/pgSQL push/pull and epoch-conversion functions, with soft deletes tracked via deleted_at/last_modified_at. The main tradeoff is friction when changing the data model, since the Postgres schema, the local WatermelonDB schema and the sync functions must all be kept in step. That makes the approach best suited to apps with a stable schema where snappy interactions matter.
- Supabase Wrappers, a Postgres FDW framework written in Rust
Supabase mediumAdeptSupabase Wrappers is an alpha Rust framework, built on pgx, for writing Postgres Foreign Data Wrappers that expose external systems such as Stripe and Firebase as queryable foreign tables. A worked example connects a Stripe account, maps products to a foreign table and queries it with SQL or the Supabase JS client. Wrappers also support a "QETL" (query, extract, transform, load) pattern: query warehouses like Snowflake on demand, join remote data with local tables, and materialize results with pg_cron. The framework adds async support for REST-API-backed FDWs and early push-down support, with ClickHouse, BigQuery and Airtable wrappers in development.
- Migrating from the MongoDB Data API to Supabase
Supabase mediumAdeptWith MongoDB's Data API and HTTPS Endpoints reaching end-of-life on September 30, 2025, Supabase's auto-generated PostgREST API is offered as a near drop-in REST replacement. The migration path is to export collections with mongoexport, load documents into a Postgres table with a JSONB column via a supabase-js script, then normalize them into relational tables using Postgres JSON functions and LATERAL jsonb_array_elements. Client code then queries the generated REST endpoints, including embedded related rows. Tradeoffs include less schema flexibility than MongoDB, the need for document transformation scripts, and rethinking query patterns and indexes for relational joins.