hbcondo7144 hours ago
Thanks for sharing this! I had done a PWA that displays some revenue forecasting[1] based on Stripe Subscriptions but I found their APIs can be slow[2]. Having that data synced up in a db sounds like a good enhancement so will definitely look into this more.

[1] https://github.com/hbcondo/revenut-app

[2] https://github.com/stripe/stripe-dotnet/issues/2284#issuecom...

prasoonds4 hours ago
Yes, this is one of the bigger use-cases for this library. Lots of folks want custom analytics on their Stripe data and this provides a nice way to do just that.

Let me know how you find it! Happy to implement any fixes and PRs welcome!

lukaslukas2 hours ago
Haha "Stripe-no-webhooks library"

Library based on processing ... wait for it ... webhooks".

prasoonds2 hours ago
haha yes, it’s definitely a bit of a silly name. The idea is you the user does not have to deal with the webhooks!
prasoonds4 hours ago
Hi HN, library creator here.

I've linked a demo app linked in the post to try this out:

<https://snw-test.vercel.app>

It uses Clerk for auth and Clerk seems to be having problems:

<https://downdetector.com/status/clerk-inc/>

So if you're having any issues loading the app, you may have to wait a bit!

whiskey-one2 hours ago
It is indeed painful to figure out all the Stripe events one needs to handle. However, for me it’s worth it to do it once, and then be able to handle the interactions between my app and Stripe directly, instead of adding more layers.
prasoonds2 hours ago
That’s a fair point. But of course, this library also helps with other matters - wallets, credits and a code as config based system which can be quite useful too.

And also, if you record all the webhooks events (and a backfill), that basically gives you your whole Stripe data available locally - I’ve actually put it to good use in diagnosing payment failure issues before.

xn2 hours ago
A related, generalized idea: https://github.com/webhookdb/webhookdb
tonyx4 hours ago
This is really cool. How do you handle changes of pricing with something like this?
prasoonds4 hours ago
Great question. Basically, you would change your billing.config.ts and update the price.

Then, you run the `sync` command - it matches prices by a composite key: `productId:amount:currency:interval`. Since the amount has changed, it won't find a match for the old price. So, it will create a new price in Stripe and update the Price ID. Your new customers automatically get the new price in the Pricing Table component.

Your old subscriptions stay on the old price - which is still active in Stripe. We haven't added support for migrating these customers to the new price yet but it's in the roadmap!

I would like to add that we've tried making the porcelain / user API for the library to best fit today's commonly uses SaaS pricing models so most actions usually do what you would expect (like this price update) but, it's hard to strike a balance between customizability and the _just works_ factor.

enigma1012 hours ago
why call it no webhook when it's wait for it a webhook?
prasoonds2 hours ago
Well it’s a silly name, yes. _You_ don’t have to deal with webhooks - it happens in the background and is taken care of by the library!