Guides

Build guides

Step-by-step walkthroughs for shipping real features with @buildbase/sdk.

51 posts · page 4 of 5

Build guide

A 429 when the quota should not be exhausted

A 429 on the usage endpoint is almost never the quota. Quota rejection returns 400. Here is how to reconcile the counter you read with the counter being enforced.

8 min read
Build guide

Stripe webhook signature verification failed in Next.js

One error string covers two different bugs. Five causes for a failed Stripe webhook signature in Next.js, ranked by how often each is actually it, each with its one-line test.

10 min read
Build guide

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.

7 min read
Build guide

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.

8 min read
Build guide

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.

5 min read
Build guide

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.

10 min read
Build guide

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.

10 min read
Build guide

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.

8 min read
Build guide

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.

9 min read
Build guide

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.

8 min read
Build guide

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.

8 min read
Build guide

Charge per seat in Next.js, and handle the moment seats run out

Per-seat billing in Next.js: read seat state, gate the invite button, and branch on why invites are blocked. The three block reasons need three different answers.

4 min read

Follow a guide with your own project

Every guide starts with one install. Create a project and build along.

7-day free trialNo credit card requiredCancel anytime