---
title: "@supertokens-plugins/user-banning-react"
description: "Public root exports for @supertokens-plugins/user-banning-react 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%2Fuser-banning-react%400.2.1/packages/user-banning-react/src/index.ts).

:::caution
This release's declaration graph imports unpublished workspace modules (`@shared/react`). 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 |
| `usePluginContext` | Constant |

## `default`

Published from the emitted `_default` declaration.

Root export:

```ts check=false reason="Generated API signature"
export default _default;
```

Resolved declaration:

```ts check=false reason="Generated API signature"
declare const _default: {
    init: (config?: (import('./types').SuperTokensPluginUserBanningPluginConfig & {
        override?: ((oI: undefined) => undefined) | undefined;
    }) | undefined) => import('supertokens-auth-react').SuperTokensPlugin;
};
```

## `init`

Root export:

```ts check=false reason="Generated API signature"
import { init, usePluginContext } from './plugin';
import { PLUGIN_ID } from './constants';
export { init, PLUGIN_ID, usePluginContext };
```

Resolved declaration:

```ts check=false reason="Generated API signature"
import { SuperTokensPluginUserBanningPluginConfig, TranslationKeys, SuperTokensPluginUserBanningPluginNormalisedConfig } from './types';
import { SuperTokensPlugin } from 'supertokens-auth-react/lib/build/types';
export declare const init: (config?: (SuperTokensPluginUserBanningPluginConfig & {
    override?: ((oI: undefined) => undefined) | undefined;
}) | undefined) => SuperTokensPlugin;
```

## `PLUGIN_ID`

Root export:

```ts check=false reason="Generated API signature"
import { init, usePluginContext } from './plugin';
import { PLUGIN_ID } from './constants';
export { init, PLUGIN_ID, usePluginContext };
```

Resolved declaration:

```ts check=false reason="Generated API signature"
export declare const PLUGIN_ID = "supertokens-plugin-user-banning";
```

## `usePluginContext`

Root export:

```ts check=false reason="Generated API signature"
import { init, usePluginContext } from './plugin';
import { PLUGIN_ID } from './constants';
export { init, PLUGIN_ID, usePluginContext };
```

Resolved declaration:

```ts check=false reason="Generated API signature"
import { SuperTokensPublicConfig, SuperTokensPublicPlugin } from 'supertokens-auth-react';
import { SuperTokensPluginUserBanningPluginConfig, TranslationKeys, SuperTokensPluginUserBanningPluginNormalisedConfig } from './types';
import { getQuerier } from '@shared/react';
import { getApi } from './api';
declare const usePluginContext: () => {
    plugins: SuperTokensPublicPlugin[];
    sdkVersion: string;
    appConfig: SuperTokensPublicConfig;
    pluginConfig: SuperTokensPluginUserBanningPluginNormalisedConfig;
    querier: ReturnType<typeof getQuerier>;
    api: ReturnType<typeof getApi>;
    t: (key: TranslationKeys) => string;
};
```

## Required signature types

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

### `defaultTranslationsUserBanning`

```ts check=false reason="Generated API signature"
export declare const defaultTranslationsUserBanning: {
    readonly en: {
        readonly PL_UB_BAN_PAGE_TITLE: "Ban User";
        readonly PL_UB_BAN_PAGE_DESCRIPTION: "This page is used to ban and unban users. It is useful for preventing users from accessing your application.";
        readonly PL_UB_BAN_PAGE_CHECK_STATUS_BUTTON: "Check Status";
        readonly PL_UB_BAN_PAGE_BAN_BUTTON: "Ban";
        readonly PL_UB_BAN_PAGE_UNBAN_BUTTON: "Unban";
        readonly PL_UB_BAN_PAGE_EMAIL_LABEL: "Email";
        readonly PL_UB_BAN_PAGE_EMAIL_PLACEHOLDER: "Enter email";
        readonly PL_UB_BAN_PAGE_TENANT_ID_LABEL: "Tenant";
        readonly PL_UB_BAN_PAGE_TENANT_ID_PLACEHOLDER: "Enter tenant ID";
        readonly PL_UB_BAN_PAGE_BANNED_STATUS: "Banned";
        readonly PL_UB_BAN_PAGE_NOT_BANNED_STATUS: "Not Banned";
        readonly PL_UB_BAN_PAGE_GENERAL_ERROR: "An error occurred while checking the status of the user";
        readonly PL_UB_BAN_PAGE_UNKNOWN_ERROR: "An unknown error occurred";
        readonly PL_UB_BAN_PAGE_UNKNOWN_ERROR_MESSAGE: "An unknown error occurred while checking the status of the user";
        readonly PL_UB_BAN_PAGE_UNKNOWN_ERROR_MESSAGE_MESSAGE: "An unknown error occurred while checking the status of the user";
    };
};
```

### `getApi`

```ts check=false reason="Generated API signature"
import { getQuerier } from '@shared/react';
export declare const getApi: (querier: ReturnType<typeof getQuerier>) => {
    getBanStatus: (tenantId: string, email: string) => Promise<{
        status: "OK";
        banned: boolean;
    } | {
        status: "ERROR";
        message: string;
    }>;
    updateBanStatus: (tenantId: string, email: string, isBanned: boolean) => Promise<{
        status: "OK";
    } | {
        status: "ERROR";
        message: string;
    }>;
};
```

### `SuperTokensPluginUserBanningPluginConfig`

```ts check=false reason="Generated API signature"
export type SuperTokensPluginUserBanningPluginConfig = {
    userBanningPermission?: string;
    bannedUserRole?: string;
    onPermissionFailureRedirectPath?: string;
};
```

### `SuperTokensPluginUserBanningPluginNormalisedConfig`

```ts check=false reason="Generated API signature"
export type SuperTokensPluginUserBanningPluginNormalisedConfig = {
    userBanningPermission: string;
    bannedUserRole: string;
    onPermissionFailureRedirectPath: string;
};
```

### `TranslationKeys`

```ts check=false reason="Generated API signature"
import { defaultTranslationsUserBanning } from './translations';
export type TranslationKeys = keyof typeof defaultTranslationsUserBanning["en"];
```
