Guide · 7 min read
How to add customer sign-in and single sign-on to a SaaS app
Sign-in is the part of a B2B product that every customer touches on day one and that nobody buys the product for. This guide explains the standard flow, what your app must check, and how to keep each customer’s people apart.
Read the guide
Guide · 8 min read
How to add billing and usage metering to a SaaS app
Charging for a product is two problems that look like one. Billing decides what a customer owes. Entitlement decides what they may do. Most billing bugs come from letting the second be an accident of the first.
Read the guide
Concepts · 7 min read
Multi-tenant architecture patterns for SaaS, compared
Every B2B product has to answer one question early: how are one customer’s data and workload kept apart from another’s? The answer sets your cost, your support burden and your security story for years.
Read the guide
Guide · 7 min read
Webhook best practices for SaaS apps
A webhook is a public URL that changes your data when someone calls it. Treat it with the care you would give a login form: prove who is calling, expect repeats, and never let a slow handler break delivery.
Read the guide
Guide · 6 min read
How to design plans and entitlements your code can check
A pricing page is a promise in words. Your product needs the same promise as data: a list of features and limits per plan that every part of the app reads from one place.
Read the guide
Migration guide · 7 min read
Move an existing app onto TenancyEngine, one layer at a time
You do not have to swap everything at once. Accounts, plans and billing can move in separate steps, each with a way back. This guide gives the order we would use and the limits you should plan around.
Read the guide
Guide · 6 min read
Directory sync (SCIM): removing leavers automatically
Larger customers want one thing from your app that has nothing to do with features: when someone leaves their company and is switched off in the company directory, they must lose access to your product the same day.
Read the guide
Guide · 6 min read
Answering a data access or deletion request for a customer
Sooner or later a customer asks for a copy of their data, or asks you to delete it. You need a repeatable way to do both, with a record that you did, and a clear line between what the platform holds and what your own app holds.
Read the guide
Guide · 6 min read
Scoped API keys, and machine access for your customers
Two different keys are easy to mix up: the one your backend uses to call the platform, and the one your customer’s server uses to call you. Each should carry the least power that does the job.
Read the guide
Guide · 5 min read
Warn customers before they hit a usage limit
A customer who is stopped at a limit with no warning is a support ticket and sometimes a cancellation. A customer who gets an email at 80% is a possible upgrade.
Read the guide
Guide · 7 min read
The enterprise-readiness checklist for a young B2B SaaS
Your first large customer sends a security questionnaire before they send a purchase order. Most of the questions are the same few themes. Here is the list, in the order they usually come up, and how much of each you can answer without building it.
Read the guide
Guide · 6 min read
Report metered usage so a retry never counts twice
Networks fail, workers restart, queues redeliver. If every retry adds to a customer’s usage, someone is charged for work they did once. An idempotency key makes the second attempt a no-op.
Read the guide
Guide · 6 min read
Check what a customer has paid for, and fail safely when you cannot
Every paid feature rests on one question: is this customer entitled to it right now? The answer comes from another system, so you need a rule for how long it stays valid and what to do when you cannot reach it.
Read the guide
Guide · 7 min read
Give an AI agent access to your product without giving it everything
Customers will ask to connect an AI assistant to your product. The safe version is a connection the person approves, limited to what they could do themselves, and useless against any other server.
Read the guide
Guide · 5 min read
Create a customer workspace the moment someone signs up
In a B2B product the unit of onboarding is a customer organization, not a user. Your backend creates it, starts it on a plan, and remembers how it maps to your own records.
Read the guide
Concepts · 6 min read
MFA and passkeys for a B2B product: what to offer and what to say
Enterprise reviewers ask whether you support multi-factor sign-in. The useful answer is which factors, who chooses them, and how a person recovers when they lose a device.
Read the guide
Concepts · 6 min read
An audit log your customers can actually use
An audit log has two readers. Your support team uses it to explain what happened. Your customer’s admin uses it to answer their own auditor. Design for the second reader and the first is covered.
Read the guide
Guide · 5 min read
Give every backend job a key that can do one thing
One powerful key in an environment variable is the easiest setup and the worst failure. When a key leaks, the scopes it carries are the limit of the damage.
Read the guide
Guide · 6 min read
A production readiness checklist for the day you go live
Launch-day problems are often plain configuration gaps. Sign-in returns to localhost, events go to a test address, email is still switched off, and the plans exist in staging only. Each of these can be checked in advance.
Read the guide
Guide · 6 min read
Catch up on missed events without gaps or repeats
Webhooks are push: the sender calls you, and if you are down, the call is your problem. A pull feed turns that into a question you can ask later: what happened since I last looked?
Read the guide