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.

Creating a new tenant

Create Tenant

Create a new tenant by clicking on the Add Tenant button and specify the tenant ID.

All Login Methods Enabled

Once the tenant is created, turn on the Login Methods as required for the tenant. In the above example, all the Login Methods are turned on.

Providing additional configuration per tenant#

You can also configure a tenant to have different configurations as per the core's config.yaml (or docker env) variabls. Below is how you can specify the config, when creating or modifying a tenant:

Custom tenant config

In the above example, we are setting different values for certain configs for customer1 tenant. All other configs are inherited from the base config (config.yaml file or docker env vars).

The values can be edited by clicking on the pencil icon and then specifying a new value.

caution

Database connection settings cannot be edited directly from the Dashboard and you may need to use the SDK or cURL to update them.

Once you have set the configs for a specific tenant, you can fetch the tenant info as shown below:

import Multitenancy from "supertokens-node/recipe/multitenancy";

async function getTenant(tenantId: string) {

let resp = await Multitenancy.getTenant(tenantId);

if (resp === undefined) {
// tenant does not exist
} else {
let coreConfig = resp.coreConfig;

let firstFactors = resp.firstFactors;

let configuredThirdPartyProviders = resp.thirdParty.providers;
}
}

The returned coreConfig is the same as what we had set when creating / updating the tenant. The rest of the core configurations for this tenant are inherited from the app's (or the public tenant) config. The public tenant, for the public app inherits its configs from the config.yaml / docker env var values.

Next steps#

Checkout the "Setting up login for tenants" page for next steps in integrating multi tenancy.

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