Live data from Hacker News

Show HN: Tier.run – Terraform for Stripe

github.com

41–49 of 49 posts

Re: Show HN: Tier.run – Terraform for Stripe

#41
post #35

If I'm thinking about pricing, I'm likely also highly interested in a nice UI/Design for my page. IMHO Your https://priceops.org/ needs some major design TLC. Personally, when I see a gray background, or a especially a serif font on a web page trying to sell me something I'll be pretty skeptical. It doesn't need to be wizz-bang amazing, but something cleaner is in order. I'd just grab something from one of the many b…

I completely agree. Whoever[1] made that page should probably not be allowed to make web pages without the assistance of a real designer.

[1]: me. I'm talking about me.

Re: Show HN: Tier.run – Terraform for Stripe

#42
post #19

Very interesting approach, and nice to see someone tackling that problem area! You see a hundred blog posts of "why you should experiment with your pricing", but actually doing that is often such a pain that nobody ends up doing that (and admittedly the reason why I would have shied away from such projects in the past). Two things that come to mind: - What are your plans like regarding the integration of entitlement…

> You see a hundred blog posts of "why you should experiment with your pricing", but actually doing that is often such a pain that nobody ends up doing that (and admittedly the reason why I would have shied away from such projects in the past).

Yes, exactly. Especially when those same blog posts tell you to plan to basically have your whole team focus on it for 3 months, as if you have nothing else to do!

> - What are your plans like regarding the integration of entitlement checking in the service and SDK? As far as I can tell, that's still a missing piece? I really love how oso[0] has managed to separate the authorization checking from the authorization definition via their DSL and SDKs. Ever since I saw that, I was wondering if a very similar system could work for entitlement checking.

The SDK does expose a `tier.limit(org, feature)` method[1]. This is reasonably fast, but if it's uncached, it is an API call to Stripe, so it can be beneficial to have that drive a proper feature-flagging system like Launch Darkly, or whatever else you use to manage authorization and feature availability.

> - I think where your system could provide a lot of benefit would be in help tracking usage metrics that can be harder to calculate (and with that more of a pain to use). It's already nice not having to implement a simpler "number of action N taken the last billing period" metric. However something like a "N number of active users last billing period", where you now would also have to keep track of which users you have already seen before to prevent double-counting them becomes increasingly annoying to implement.

For seats you could use an `"aggregate": "perpetual"` setting on the feature. See: https://www.tier.run/docs/recipes/#simple-per-seat-pricing (that page also has some other examples that might be helpful.) With that, you'd just report the increase or decrease every time the seat count changes, and the counter would never be reset. (There's a few other ways to approach it, but that's what I'd do, as it's probably the simplest.)

You're right, though, if you want to charge based on active users, then it gets a bit more tricky, because you do have to avoid double-counting. And the precise definition of "active" becomes really important. I'd probably approach it by putting a "lastSeen" timestamp on each user account, and then periodically calling `tier.report(org, "feature:activeusers", numberActiveSinceFirstOfMonth, Date.now(), true)` to clobber any previous value. (`clobber` is not the default, since usually you want Tier to count it for you.) I'll add an "active users" example to that recipes page.

[1]: https://www.npmjs.com/package/tier#user-content-limitsorg

Re: Show HN: Tier.run – Terraform for Stripe

#43
post #36

Hey, Tier team, this looks promising! Is it possible to run Tier in NextJs API routes?

I am not super familiar with NextJS, but I'll take a look.

The Node SDK is a pretty standard Node library (not clientside JS, for probably obvious reasons). It does spawn a child process if it isn't given a TIER_SIDECAR environment variable, though, which is going to be pretty slow if you have stateless route handlers at the edge.

I'll poke at it today, but I think the way to go is to spin up a sidecar running somewhere with `tier serve`, and then give your NextJS API handlers an environment variable to know where to hit it.

Re: Show HN: Tier.run – Terraform for Stripe

#44

This looks very cool! Stripe is very hard in 2022. We just integrated such for our VS Code extension. With our current architecture (a very simple one) a simple thing such as iterating on the price of our product requires changing an env var on Vercel. Not complicated, but feels cumbersome for changing a price. Iterating this on a pricing.json file feels easier. Things get more complex if we decide to do something li…

Hi! Tier co-founder here.

> Iterating this on a pricing.json file feels easier.

Agreed. :)

> if we decide to do something like giving the user the possibility of choosing between a monthly or a yearly subscription (with a variable quantity, because we charge per seat). That would imply a code refactor. Would tier.run help us with that????

Currently, plans that are similar but with different billing intervals can best be expressed as two plans like: `plan:pro:annual@0` and `plan:pro:monthly@0`. We're very open to feedback on this approach though.

> Do I set up which features belong to every plan on the pricing.json file, and then consume your SDK on the frontend to only show the tier to a certain category of paying user?

This is correct, limits (if any) are defined in the pricing.json using tiers. These limits may be reported to a browser session via a backend that proxies the limits from the sidecar back out.

> I also saw you want to build your product as an Auth0 action. Would that be used for this use case?

It seems possible. How do you envision the Auth0 action behaving with Tier?

Re: Show HN: Tier.run – Terraform for Stripe

#45
post #36

Hey, Tier team, this looks promising! Is it possible to run Tier in NextJs API routes?

I just played around with the NextJS starter demo app, and it seems like you can `import tier from 'tier'` and call `tier.subscribe()`, `tier.report()`, and `tier.limits()` without any issue in a NextJS API route.

Re: Show HN: Tier.run – Terraform for Stripe

#46
post #19

Very interesting approach, and nice to see someone tackling that problem area! You see a hundred blog posts of "why you should experiment with your pricing", but actually doing that is often such a pain that nobody ends up doing that (and admittedly the reason why I would have shied away from such projects in the past). Two things that come to mind: - What are your plans like regarding the integration of entitlement…

> You see a hundred blog posts of "why you should experiment with your pricing", but actually doing that is often such a pain that nobody ends up doing that (and admittedly the reason why I would have shied away from such projects in the past). Yes, exactly. Especially when those same blog posts tell you to plan to basically have your whole team focus on it for 3 months, as if you have nothing else to do! > - What ar…

Just to clarify:

> This is reasonably fast, but if it's uncached, it is an API call to Stripe

It will be cached after the first request you make with the sidecar/SDK, and unless you have a truly impressive number of users, it'll be able to fit your entire data set in local cache and update only when needed, even on a pretty tiny VM.

I just tend to be probably over-cautious when relying on caches to be fast. Fast 99% of the time is slow 1% of the time. Still good to do it, of course, but always a good idea to at least consider what your worst-case will be.

Re: Show HN: Tier.run – Terraform for Stripe

#47

This looks very cool! Stripe is very hard in 2022. We just integrated such for our VS Code extension. With our current architecture (a very simple one) a simple thing such as iterating on the price of our product requires changing an env var on Vercel. Not complicated, but feels cumbersome for changing a price. Iterating this on a pricing.json file feels easier. Things get more complex if we decide to do something li…

Hi! Tier co-founder here. > Iterating this on a pricing.json file feels easier. Agreed. :) > if we decide to do something like giving the user the possibility of choosing between a monthly or a yearly subscription (with a variable quantity, because we charge per seat). That would imply a code refactor. Would tier.run help us with that???? Currently, plans that are similar but with different billing intervals can best…

> Currently, plans that are similar but with different billing intervals can best be expressed as two plans like: `plan:pro:annual@0` and `plan:pro:monthly@0`. We're very open to feedback on this approach though.

I think this makes sense because switching between them can be done very easily, just change the string from `plan:pro:annual@0` to `plan:pro:monthly@0`. As long as I can write some client side code that allows me to change if the end user is getting access to `plan:pro:annual@0` or `plan:pro:monthly@0` based on what they select on a UI.

> It seems possible. How do you envision the Auth0 action behaving with Tier?

Sorry, I'm not familiar with Auth0 actions. It was just an open-ended question because I saw someone proposed this on your Slack group.

Re: Show HN: Tier.run – Terraform for Stripe

#48

not sure why this needs to be a product... stripe already facilitates price versioning. shouldn't be too hard to sync with my app. my app is tiny right now so I'm doing it by hand but building a little sync command wouldn't take me more than a day.

That’s exactly why this is needed

Ehh.. I'm weary of bringing in extra deps (especially paid deps) to solve iddy bitty problems. They just add complexity and new places to break.
Post reply on HN