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.
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!
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.
A related, generalized idea: https://github.com/webhookdb/webhookdb
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...
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!
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!
This is really cool. How do you handle changes of pricing with something like this?
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.