---
title: supertokens-web-js/recipe/multitenancy
description: References documentation for the supertokens-web-js/recipe/multitenancy package
sidebar:
  order: 90
---

## Classes

### default

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/multitenancy/index.ts:22](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/multitenancy/index.ts#L22)

#### Constructors

##### Constructor

```ts check=false reason="Generated API signature"
new default(): default;
```

###### Returns

[`default`](#default)

#### Properties

| Property | Modifier | Type | Default value | Defined in |
| ------ | ------ | ------ | ------ | ------ |
| <a id="member-default-alloweddomainsclaim"></a> `AllowedDomainsClaim` | `static` | `AllowedDomainsClaimClass` | `AllowedDomainsClaim` | [tmp/supertokens-web-js/lib/ts/recipe/multitenancy/index.ts:70](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/multitenancy/index.ts#L70) |

#### Methods

##### getLoginMethods()

```ts check=false reason="Generated API signature"
static getLoginMethods(input?): Promise<{
  fetchResponse: Response;
  firstFactors: string[];
  status: "OK";
  thirdParty: {
     providers: object[];
  };
}>;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/multitenancy/index.ts:40](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/multitenancy/index.ts#L40)

Gets enabled login methods and their configuration from the backend

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `tenantId?`: `string`; `userContext?`: `any`; \} |
| `input.options?` | [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions) |
| `input.tenantId?` | `string` |
| `input.userContext?` | `any` |

###### Returns

`Promise`\<\{
  `fetchResponse`: `Response`;
  `firstFactors`: `string`[];
  `status`: `"OK"`;
  `thirdParty`: \{
     `providers`: `object`[];
  \};
\}\>

`{status: OK, emailpassword, passwordless, thirdParty}` if successful

###### Throws

STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`

##### getTenantId()

```ts check=false reason="Generated API signature"
static getTenantId(input?): string | Promise<string>;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/multitenancy/index.ts:64](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/multitenancy/index.ts#L64)

Gets enabled login methods and their configuration from the backend

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: `any`; \} |
| `input.userContext?` | `any` |

###### Returns

`string` \| `Promise`\<`string`\>

`Promise<string | undefined> | string | undefined`

##### init()

```ts check=false reason="Generated API signature"
static init(config?): CreateRecipeFunction<"GET_LOGIN_METHODS">;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/multitenancy/index.ts:23](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/multitenancy/index.ts#L23)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `config?` | [`UserInput`](recipe-multitenancy-types#userinput) |

###### Returns

[`CreateRecipeFunction`](types#createrecipefunction)\<`"GET_LOGIN_METHODS"`\>

## Variables

### AllowedDomainsClaim

```ts check=false reason="Generated API signature"
const AllowedDomainsClaim: AllowedDomainsClaimClass;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/multitenancy/allowedDomainsClaim.ts:40](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/multitenancy/allowedDomainsClaim.ts#L40)

***

### getLoginMethods()

```ts check=false reason="Generated API signature"
const getLoginMethods: (input?) => Promise<{
  fetchResponse: Response;
  firstFactors: string[];
  status: "OK";
  thirdParty: {
     providers: object[];
  };
}> = RecipeWrapper.getLoginMethods;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/multitenancy/index.ts:74](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/multitenancy/index.ts#L74)

Gets enabled login methods and their configuration from the backend

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `tenantId?`: `string`; `userContext?`: `any`; \} |
| `input.options?` | [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions) |
| `input.tenantId?` | `string` |
| `input.userContext?` | `any` |

#### Returns

`Promise`\<\{
  `fetchResponse`: `Response`;
  `firstFactors`: `string`[];
  `status`: `"OK"`;
  `thirdParty`: \{
     `providers`: `object`[];
  \};
\}\>

`{status: OK, emailpassword, passwordless, thirdParty}` if successful

#### Throws

STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`

***

### getTenantId()

```ts check=false reason="Generated API signature"
const getTenantId: (input?) => string | Promise<string> = RecipeWrapper.getTenantId;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/multitenancy/index.ts:75](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/multitenancy/index.ts#L75)

Gets enabled login methods and their configuration from the backend

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: `any`; \} |
| `input.userContext?` | `any` |

#### Returns

`string` \| `Promise`\<`string`\>

`Promise<string | undefined> | string | undefined`

***

### init()

```ts check=false reason="Generated API signature"
const init: (config?) => CreateRecipeFunction<"GET_LOGIN_METHODS"> = RecipeWrapper.init;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/multitenancy/index.ts:73](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/multitenancy/index.ts#L73)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `config?` | [`UserInput`](recipe-multitenancy-types#userinput) |

#### Returns

[`CreateRecipeFunction`](types#createrecipefunction)\<`"GET_LOGIN_METHODS"`\>

## References

### PostAPIHookContext

Re-exports [PostAPIHookContext](recipe-multitenancy-types#postapihookcontext)

***

### PreAndPostAPIHookAction

Re-exports [PreAndPostAPIHookAction](recipe-multitenancy-types#preandpostapihookaction)

***

### PreAPIHookContext

Re-exports [PreAPIHookContext](recipe-multitenancy-types#preapihookcontext)

***

### RecipeInterface

Re-exports [RecipeInterface](recipe-multitenancy-types#recipeinterface)

***

### UserInput

Re-exports [UserInput](recipe-multitenancy-types#userinput)
