I've spent two weeks on a small open source module that keeps a Postgres copy of Stripe subscription state in sync. It handles duplicate events, out of order events, workers that crash halfway, and a scheduled reconcile for missed events. MIT license, TypeScript, plain Postgres or Supabase.
I'm not writing this to ask for stars. I want to learn what makes a developer comfortable depending on someone else's code for billing, because billing bugs cost real money.
Here's what I did to make it easier to trust:
- A demo that runs on a fake Stripe, no account needed.
npm run demotakes about a minute. - Tests for the ugly cases, like a late update after a delete, and two deliveries at once.
- A KNOWN_LIMITATIONS file that lists what it doesn't handle, including thin events.
What I don't know is whether any of that is what you look for. So, a few questions:
- What would you check first in a library like this: the tests, the demo, how recently it was committed, who maintains it, something else?
- Would you rather copy the code into your project or install it as a package? Why?
- What billing edge case worries you that you haven't seen a library handle?
- What would make you say "no, I'll write it myself"?
I'll reply to every comment, and good answers will become issues or changes in the repo.
Repo: https://github.com/navalpro8-lgtm/stripe-subscription-sync
