Dharmendra Jagodana
Founder of BuildBase. Builds the platform and the six products that run on it.
73 posts · page 3 of 7
Token expired mid-request on a long operation
A 401 halfway through an upload, while the user is still signed in for another 29 days. Two clocks, not one, and the fix is a refresh before the call rather than a retry after it.
Why your webhook is rejected after five minutes
A BuildBase delivery older than five minutes fails verification before the signature is ever compared. Why the max age exists, and the four things that trip it legitimately.
How to enforce quotas server-side in Next.js
The record call is the lock, not the if-statement after it. How quota enforcement actually behaves on hard-cap and overage plans.
How to add a credits wallet in Next.js, and why the balance is not one number
Add a credits wallet in Next.js: sell packages, show the balance, spend FIFO from dated buckets, and warn before expiry. The balance is an aggregate over buckets, not a column you decrement.
How to change pricing without affecting existing customers in Next.js
Change SaaS pricing without affecting existing customers: publish a new plan version, leave subscriptions pinned to the old one, and decide what a v1 customer sees when you ship v3.
An annual and monthly toggle in Next.js, and why it is not a boolean
How to add an annual and monthly toggle in Next.js: why the display interval is not the billing interval, what happens to plan allowances, and where the savings percentage should come from.
Proration on plan change in Next.js, and why a downgrade needs the opposite setting
Proration on plan change in Next.js: why upgrades and downgrades need opposite proration behavior, and how to read direction without mistaking a yearly plan for a bigger one.
How to add a free trial without a card in Next.js
A free trial with no credit card in Next.js: turn the card requirement off on the plan version, then handle the part Stripe cannot - what your app renders, and who the gate lets through.
Charge per credit in Next.js, and why the debit goes last
Charge per credit in Next.js: check the balance before the work, debit after it, return 402 when the balance is empty, and pass an idempotencyKey so a retry is not charged twice.
The best Clerk and Stripe combination, and when to skip it
Clerk plus Stripe is two vendors and three jobs. Which combination fits which app, what the seam between them costs you to own, and when a bundled backend is the better call.
The best way to add billing to a Next.js app depends on where entitlements live
Four ways to add billing to a Next.js app, compared on what you still have to build after checkout works: entitlements, quota enforcement and seats.
Best backend for an API product
Supabase, Firebase and Hasura are built for apps with a database behind them. An API product needs API-key auth and usage-based billing per call - here's what each actually gives you.