Recipes
Next.js — B2B SaaS (multi-tenant)
← All recipes · First time? Set up your app (60 seconds — keys + redirect URI)
A Next.js app where each customer is a tenant, users may belong to multiple tenants, and roles are scoped per tenant. Builds on the single-tenant recipe — read that first; this page only shows the deltas.
1. What you'll build#
A Next.js B2B SaaS app where the user signs in, picks a tenant (Authaz Sign-In handles this UI), and your /dashboard reads tenant_id from the access token to scope every query.
2. Application setup#
Create the app as multi-tenant, shared pool:
POST https://your-app.authaz.io/api/v1/applications
X-API-Key: mgmt_01h...
Content-Type: application/json