Stripe MRR Supabase Sync

Sync Stripe MRR into Supabase

A production-grade pipeline that syncs Stripe payment data into Supabase via webhooks and nightly reconciliation, keeping the MRR card live and the payments table consistent. Built around idempotent webhooks (event.id as primary key), currency snapshotting, cohort retention, and a 3 AM reconciliation cron, it makes silent payment-data loss impossible.

$15 one-time
Add to a kit →

Prices include 20% VAT. · Forged on real agency work · one-time, no lock-in

  • Type Skill
  • Category E-commerce & Payments
  • Delivery Email · instant
  • License One-time
Run preview
forgehouse, stripe-mrr-supabase-sync

Inside the run · no black box

See the actual work before you buy it.

Can you trust the MRR number on your dashboard? This pipeline makes it provable: idempotent webhook ingestion, frozen exchange-rate snapshots, a daily materialized view, realtime updates, and a nightly reconciliation that flags every missing or phantom row.

  1. Receives each Stripe event on an edge handler: HMAC signature verified, then the event ID inserted as a primary key, so a replayed event is silently swallowed and never counted twice.
  2. Writes the payment row with an exchange-rate snapshot frozen at payment date, so revenue history never drifts when the currency moves later.
  3. Refreshes a materialized MRR view daily: active subscriptions summed, annual plans divided by 12, one-time purchases kept out of MRR as a separate KPI.
  4. Streams the result to the dashboard over a realtime subscription: the MRR card updates the moment a payment lands, no polling.
  5. Builds the cohort retention matrix (signup month by month offset), so churn patterns show up as a heatmap instead of an anecdote.
  6. Runs a nightly reconciliation cron: Stripe's charge list for the last 24 hours diffed against the database; any gap fires a mail and an alert listing the missing or phantom rows.
Use cases · what happens when you plug it in

One power source. 6 lines out.

stripe-mrr-supabase-sync · core

core active · 6 lines

  1. Inserting a payment row on every Stripe subscription or invoice webhook

    ✓ inserting a payment row
  2. Rendering a live monthly-recurring-revenue card on an admin panel

    ✓ rendering a live monthly…
  3. Running a nightly reconciliation diff between Stripe and the database

    ✓ running a nightly reconc…
  4. Building cohort retention matrices by signup month and offset

    ✓ building cohort retention
  5. Snapshotting the exchange rate at payment time for accurate historical MRR

    ✓ snapshotting the exchange
  6. Replaying failed webhooks safely with idempotency protection

    ✓ replaying failed webhooks
Benefits · what you walk away with

Yours to keep.

Drag time forward. Watch what stays.

Forever

That's what owning means.

The rented stack

ai writing tool: subscription

expired · access lost

analytics suite: subscription

expired · access lost

design platform: subscription

expired · access lost

(nothing left)

Your forge

  1. Prevent duplicate inserts and revenue inflation with event.id primary-key idempotency

    license: perpetual
  2. Catch webhook failures within 24 hours via an automated reconciliation alarm

    license: perpetual
  3. Keep historical MRR accurate even when exchange rates move using stored snapshots

    license: perpetual
  4. Render the revenue card in real time with Supabase subscriptions instead of polling

    license: perpetual

subscriptions expire · deeds don't

What's included · the full manifest

Everything in the box.

Pick a piece up. Watch it work.

Next.js Edge webhook handler with HMAC signature verify and idempotency check

part 01 of 06 · in the box

6 parts · one working system · ships instantly by email

From the field · a real case

This wasn’t written at a desk.

The problem

The fix

The result

Who it's for

This wasn't forged for everyone.

  • Not for you if you'd rather rent a tool than own one.
  • Not for you if you want someone else to run your stack.
  • Not for you if you're happy guessing.
Still here? Good.

Engineering and finance teams running Stripe-based subscriptions who need accurate, idempotent revenue data in their database and a live MRR view that never silently drifts.

then this was forged for you.

Works with

Universal by design: these run in any AI. Delivered in the open Agent Skills + MCP format (native in Claude); ChatGPT, Gemini, Cursor and Copilot adapt the same files their own way.

  • Claude Native format
  • ChatGPT Adapts via open standards
  • Gemini Adapts via open standards
  • Cursor Adapts via open standards
  • Copilot Adapts via open standards
Questions · still in the air

Catch what's on your mind.

the air is clear. nothing between you and the forge.
catch a spark: the forge will answer

  1. We run plain Postgres, not Supabase. How much of this ports over?

    The core patterns port: event.id as primary key for idempotency, currency snapshotting at payment time, and the nightly Python reconciliation cron work on any Postgres. What assumes Supabase specifically is the migration SQL, the realtime-driven MRR card component, and the subscription-based rendering instead of polling.

  2. I already have a Stripe webhook handler writing to my database. Why is that not enough?

    Because webhooks fail silently: a missed event means quietly wrong revenue numbers with no error anywhere. This pipeline adds the second leg, a 3 AM reconciliation cron that diffs Stripe charges against your table and alarms within 24 hours, plus event.id idempotency so replaying a failed webhook can never double-insert.

  3. Does it set up my Stripe payments or checkout flow?

    No. It assumes payments already flow through Stripe and only solves what happens after: syncing that data into Supabase, keeping it consistent, and rendering a live MRR card. Building the checkout itself is the stripe-integration package's territory.

  4. How is it delivered?

    By email right after purchase: ready to run, downloaded instantly, no setup wait.

  5. One-time or subscription?

    A one-time purchase; no subscription or hidden fees. VAT (20%) is included.

  6. Can I get a refund?

    As a digital product, it can’t be refunded once downloaded. That’s why we show exactly what’s inside and who it’s for, right here.