---
title: "@supertokens-plugins/tenant-discovery-nodejs"
description: "Public root exports for @supertokens-plugins/tenant-discovery-nodejs 0.2.1."
---

**Package version:** `0.2.1`

Generated from the packed release's root declaration, `./dist/index.d.ts`. Only exports reachable from that root are
listed. See the [immutable release source](https://github.com/supertokens/supertokens-plugins/blob/%40supertokens-plugins%2Ftenant-discovery-nodejs%400.2.1/packages/tenant-discovery-nodejs/src/index.ts).

:::caution
This release's declaration graph imports unpublished workspace modules (`@shared/js`). The generator detected these imports from the packed declaration graph and strict compiler diagnostics. This upstream packaging defect cannot be fixed by the reference generator; do not enable `skipLibCheck` to hide it.
:::

## Public root exports

| Export | Kind |
| --- | --- |
| `default` | Constant |
| `init` | Constant |
| `PLUGIN_ID` | Constant |

## `default`

Published from the emitted `_default` declaration.

Root export:

```ts check=false reason="Generated API signature"
export { PLUGIN_ID, _default as default, init };
```

Resolved declaration:

```ts check=false reason="Generated API signature"
import * as _shared_js from '@shared/js';
import * as supertokens_node_types from 'supertokens-node/types';
declare const _default: {
    init: (config?: (SuperTokensPluginTenantDiscoveryPluginConfig & {
        override?: ((oI: _shared_js.OverridableFunctions<OverrideableTenantFunctionImplementation>) => _shared_js.OverridableFunctions<OverrideableTenantFunctionImplementation>) | undefined;
    }) | undefined) => supertokens_node_types.SuperTokensPlugin;
};
```

## `init`

Root export:

```ts check=false reason="Generated API signature"
export { PLUGIN_ID, _default as default, init };
```

Resolved declaration:

```ts check=false reason="Generated API signature"
import * as _shared_js from '@shared/js';
import { UserContext, SuperTokensPlugin } from 'supertokens-node/types';
declare const init: (config?: (SuperTokensPluginTenantDiscoveryPluginConfig & {
    override?: ((oI: _shared_js.OverridableFunctions<OverrideableTenantFunctionImplementation>) => _shared_js.OverridableFunctions<OverrideableTenantFunctionImplementation>) | undefined;
}) | undefined) => SuperTokensPlugin;
```

## `PLUGIN_ID`

Root export:

```ts check=false reason="Generated API signature"
export { PLUGIN_ID, _default as default, init };
```

Resolved declaration:

```ts check=false reason="Generated API signature"
declare const PLUGIN_ID = "supertokens-plugin-tenant-discovery";
```

## Required signature types

These declarations are not additional package-root exports. They are included because the public signatures above depend on them.

### `MinimalTenantDetails`

```ts check=false reason="Generated API signature"
type MinimalTenantDetails = {
    tenantId: string;
    displayName: string;
};
```

### `OverrideableTenantFunctionImplementation`

```ts check=false reason="Generated API signature"
import { UserContext, SuperTokensPlugin } from 'supertokens-node/types';
type OverrideableTenantFunctionImplementation = {
    getTenantIdFromEmail: (email: string) => Promise<string>;
    getTenants: (userContext?: UserContext) => Promise<MinimalTenantDetails[]>;
    isValidTenant: (tenantId: string, userContext?: UserContext) => Promise<boolean>;
    isRestrictedEmailDomain: (emailDomain: string) => boolean;
    isTenantAllowedForEmail: (email: string, tenantId: string) => boolean;
};
```

### `SuperTokensPluginTenantDiscoveryPluginConfig`

```ts check=false reason="Generated API signature"
type SuperTokensPluginTenantDiscoveryPluginConfig = {
    enableTenantListAPI?: boolean;
};
```
