Show HN: A simple pricing and resource limit library

(github.com)

5 points | by cj-cummings 5 hours ago ago

4 comments

  • lswhiteh 5 hours ago ago

    Nice! Definitely have encountered issues with metered pricing through stripe, especially when sales wants to do custom pricing for larger contracts.

    How does this handle transitions when a customer changes plans mid-billing cycle e.g.they downgrade from paid to free but their current usage already exceeds the free plan's limits? Is it immediately enforced or is there some sort of reconciliation mechanism?

    • cj-cummings 2 hours ago ago

      Custom pricing contracts are always where things get messy!

      The default behavior for a downgrade is to start denying usage if a hard limit has been set and the usage is over the new plan's limit.

      Limitr is entirely event-driven though, so adding a handler with custom downgrade logic is straightforward.

      A lot of use cases can be implemented with soft limits also, which allow overage and emit overage events that you can charge for or handle gracefully (user notifications, model downgrades, etc).

      In these cases, what is the desired behavior for you?

  • rob2244 5 hours ago ago

    Awesome project, looking forward to using this in the future, I think it's really going to simplify our billing setup/tracking!

    • cj_cummings 2 hours ago ago

      Thank you! Would love to hear about your experience when you give it a try!