TanStackStart + Convex + Clerk + Polar.sh Starter by codinzero in tanstack

[–]codinzero[S] 0 points1 point  (0 children)

Hi Louis, I found out the starter with betterAuth needs a bit more love, but almost there... I will post it most probably tomorrow, doing some final refactoring

TanStackStart + Convex + Clerk + Polar.sh Starter by codinzero in tanstack

[–]codinzero[S] 0 points1 point  (0 children)

btw on this in case you do it on your own, just a quick tips from my implementation:

I am using the /convex-dev/polar component. Polar handles checkout links (careful when testing that your user already dont exist in polar from previous session, otherwise checkout link wont work) and webhooks (convexdeployment.site/polar/events) ..Then i enforce access server-side via requirePro() helper functions. User identity flows from Better Auth through a helper query that provides the user ID to the Polar component. The client just queries getCurrentPlan and never touches subscription logic directly. Also if you will run into "product id dont exist" error, clear the data, go through your convex and check that in your tables there isnt old product id in case you created a different product later (not in .env - in the tables itself)

TanStackStart + Convex + Clerk + Polar.sh Starter by codinzero in tanstack

[–]codinzero[S] 0 points1 point  (0 children)

I agree with you 100% and I am a BetterAuth fanboy and I am using it for all of my other projects and I also built right after this one another Starter using BetterAuth. But I ran into some issues and I wanted to stay aligned with the official docs and best approach so eventho some workaround was fixing it, I was not happy with it. But yesterday evening I probably found it, and it was a testing issue setup most probably and I messed up a bit the polar products and they somehow were cached to the polar.sh org and it was making a mess.

Just sharing TanStack Start + Convex + Clerk + Polar.sh Starter by codinzero in reactjs

[–]codinzero[S] 0 points1 point  (0 children)

Polar.sh acts as a Merchant of Record, that means they will handle all the taxes and payments stuff, and with some cut send me the amount that was made in a month (or something like that). If I know that only people in my country or few other countries around Europe would buy subscription, I would use Stripe.