Skip to main content
Paid Feature

This is a paid feature.

For self hosted users, Sign up to get a license key and follow the instructions sent to you by email. Creation of tenants is free on the dev license key.

This feature is already enabled for managed service users. Creation of additional tenant is free on the provided development environment.

Multitenant login

Multitenant login is a feature that lets you customize the login experience for each of your customers. For example, a customer customer1 hosted on can have passwordless login (using this recipe), and another customer customer2 hosted on can have login with Active Directory and Facebook (using the thirdparty recipe).

Step 1: Create and configure a new tenant in SuperTokens core#

You can create a new tenant using our backend SDKs or via a cURL command to the core.

import Multitenancy from "supertokens-node/recipe/multitenancy";
import { FactorIds } from "supertokens-node/recipe/multifactorauth"

async function createNewTenant() {

let resp = await Multitenancy.createOrUpdateTenant("customer1", {
firstFactors: [FactorIds.OTP_PHONE, FactorIds.OTP_EMAIL, FactorIds.LINK_PHONE, FactorIds.LINK_EMAIL]

if (resp.createdNew) {
// new tenant was created
} else {
// existing tenant's config was modified.

In the example above, we have added all factor IDs related to the passwordless recipe. However, you can choose to use a subset of them. The factor IDs are described below:

  • Passwordless:
    • With email OTP: FactorIds.OTP_EMAIL
    • With SMS OTP: FactorIds.OTP_PHONE
    • With email magic link: FactorIds.LINK_EMAIL
    • With SMS magic link: FactorIds.LINK_PHONE

Step 2: Build your multi tenant a UX flow#

The most common multi tenant flows are:

  • Tenants use a common domain to login: All tenants login using the same page (for example, and are optionally redirected to their sub domain post login. At the start of the login flow, the customer will have to input their tenantId / workspace URL / identifier - as defined by you, and the login methods shown would be based on their tenantId.
  • Tenants use their sub domain to login: Here, each tenant has a sub domain assigned to them (for example,, ...), and they would visit their sub domain to login and access their app. Each sub domain's login experience may be different (as defined by you or the tenant).

SuperTokens is flexible enough to allow other forms of UX as well, but since the above two flow are most common, we provide dedicated docs for them (see the links above).

See also#

Looking for older versions of the documentation?
Which UI do you use?
Custom UI
Pre built UI