If you’re on tech twitter you may have noticed an increasing dissent with Stripe and it’s DX. t3.gg (Theo) summarizes it best:
“IMO, the biggest issue with Stripe is the "split brain" it inherently introduces to your code base. When a customer checks out, the "state of the purchase" is in Stripe. You're then expected to track the purchase in your own database via webhooks. There are over 258 event types. It's far too easy to have a payment be failed in stripe and "subscribed" in your app.”
We've built an OSS abstraction to build any pricing model 1 line of code. The idea is a layer over Stripe in which we control what features can be accessed. Here's how it works:
In our UI:
1. Define your app's features (eg ‘Pro Analytics’ and ‘Number of Seats’).
2. Package the features into plans (eg Free tier has 1 seat, Pro tier has Pro Analytics + 5 Seats). Then set the pricing.
From your application:
1. Call the attachProduct() function and specify the product name and customer. If the customer needs to make a payment, a checkout link is returned. Otherwise, all subscription and upgrade/downgrade logic is taken care of.
2. In your codebase, use entitled() to determine whether a user has access to the feature or not
We’re currently in open-beta and are working with some awesome YC companies.
Next on the roadmap are embeddable UI components to handle pricing pages and paywalls out-of-the-box. Would love for you to check out the tool/docs and give us your feedback!
(Also thoughts on our branding? You'll either love it or think it's cringe af)