---
title: supertokens-auth-react
description: References documentation for the supertokens-auth-react package
sidebar:
  order: 10
---

## Classes

### default

Defined in: [index.ts:33](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/index.ts#L33)

#### 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-gettranslationfunction"></a> `getTranslationFunction` | `static` | \<`T`\>(...`stores`) => (`key`, `replacements?`) => `string` | `getTranslationFunction` | [index.ts:70](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/index.ts#L70) |
| <a id="member-default-supertokenswrapper"></a> `SuperTokensWrapper` | `static` | `any` | `SuperTokensWrapper` | [index.ts:34](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/index.ts#L34) |
| <a id="member-default-usetranslation"></a> `useTranslation` | `static` | `any` | `useTranslation` | [index.ts:68](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/index.ts#L68) |
| <a id="member-default-useusercontext"></a> `useUserContext` | `static` | `any` | `useUserContext` | [index.ts:72](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/index.ts#L72) |

#### Methods

##### changeLanguage()

```ts check=false reason="Generated API signature"
static changeLanguage(language): Promise<void>;
```

Defined in: [index.ts:40](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/index.ts#L40)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `language` | `string` |

###### Returns

`Promise`\<`void`\>

##### init()

```ts check=false reason="Generated API signature"
static init(config): void;
```

Defined in: [index.ts:36](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/index.ts#L36)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `config` | [`SuperTokensConfig`](types#supertokensconfig) |

###### Returns

`void`

##### isRecipeInitialized()

```ts check=false reason="Generated API signature"
static isRecipeInitialized(recipeId): any;
```

Defined in: [index.ts:62](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/index.ts#L62)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `recipeId` | `string` |

###### Returns

`any`

##### loadTranslation()

```ts check=false reason="Generated API signature"
static loadTranslation(store): void;
```

Defined in: [index.ts:44](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/index.ts#L44)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `store` | [`TranslationStore`](#translationstore) |

###### Returns

`void`

##### redirectToAuth()

```ts check=false reason="Generated API signature"
static redirectToAuth(options?): Promise<any>;
```

Defined in: [index.ts:48](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/index.ts#L48)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `options?` | \{ `navigate?`: [`Navigate`](types#navigate); `queryParams?`: `any`; `redirectBack?`: `boolean`; `show?`: `"signin"` \| `"signup"`; `userContext?`: [`UserContext`](types#usercontext); \} |
| `options.navigate?` | [`Navigate`](types#navigate) |
| `options.queryParams?` | `any` |
| `options.redirectBack?` | `boolean` |
| `options.show?` | `"signin"` \| `"signup"` |
| `options.userContext?` | [`UserContext`](types#usercontext) |

###### Returns

`Promise`\<`any`\>

## Type Aliases

### TranslationStore

```ts check=false reason="Generated API signature"
type TranslationStore = Record<string, Record<string, string | undefined>>;
```

Defined in: [translation/translationHelpers.ts:7](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/translation/translationHelpers.ts#L7)

## Variables

### changeLanguage()

```ts check=false reason="Generated API signature"
const changeLanguage: (language) => Promise<void> = SuperTokensAPIWrapper.changeLanguage;
```

Defined in: [index.ts:76](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/index.ts#L76)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `language` | `string` |

#### Returns

`Promise`\<`void`\>

***

### init()

```ts check=false reason="Generated API signature"
const init: (config) => void = SuperTokensAPIWrapper.init;
```

Defined in: [index.ts:75](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/index.ts#L75)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `config` | [`SuperTokensConfig`](types#supertokensconfig) |

#### Returns

`void`

***

### isRecipeInitialized()

```ts check=false reason="Generated API signature"
const isRecipeInitialized: (recipeId) => any = SuperTokensAPIWrapper.isRecipeInitialized;
```

Defined in: [index.ts:79](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/index.ts#L79)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `recipeId` | `string` |

#### Returns

`any`

***

### loadTranslation()

```ts check=false reason="Generated API signature"
const loadTranslation: (store) => void = SuperTokensAPIWrapper.loadTranslation;
```

Defined in: [index.ts:77](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/index.ts#L77)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `store` | [`TranslationStore`](#translationstore) |

#### Returns

`void`

***

### redirectToAuth()

```ts check=false reason="Generated API signature"
const redirectToAuth: (options?) => Promise<any> = SuperTokensAPIWrapper.redirectToAuth;
```

Defined in: [index.ts:78](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/index.ts#L78)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `options?` | \{ `navigate?`: [`Navigate`](types#navigate); `queryParams?`: `any`; `redirectBack?`: `boolean`; `show?`: `"signin"` \| `"signup"`; `userContext?`: [`UserContext`](types#usercontext); \} |
| `options.navigate?` | [`Navigate`](types#navigate) |
| `options.queryParams?` | `any` |
| `options.redirectBack?` | `boolean` |
| `options.show?` | `"signin"` \| `"signup"` |
| `options.userContext?` | [`UserContext`](types#usercontext) |

#### Returns

`Promise`\<`any`\>

***

### SuperTokensWrapper

```ts check=false reason="Generated API signature"
SuperTokensWrapper: any;
```

## Functions

### getTranslationFunction()

```ts check=false reason="Generated API signature"
function getTranslationFunction<T>(...stores): (key, replacements?) => string;
```

Defined in: [translation/translationHelpers.ts:77](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/translation/translationHelpers.ts#L77)

#### Type Parameters

| Type Parameter |
| ------ |
| `T` *extends* `string` |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| ...`stores` | [`TranslationStore`](#translationstore)[] |

#### Returns

```ts check=false reason="Generated API signature"
(key, replacements?): string;
```

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `key` | `T` |
| `replacements?` | `Record`\<`string`, `string`\> |

##### Returns

`string`

## References

### SuperTokensConfig

Re-exports [SuperTokensConfig](types#supertokensconfig)

***

### SuperTokensPlugin

Re-exports [SuperTokensPlugin](types#supertokensplugin)

***

### SuperTokensPublicConfig

Re-exports [SuperTokensPublicConfig](types#supertokenspublicconfig)

***

### SuperTokensPublicPlugin

Re-exports [SuperTokensPublicPlugin](types#supertokenspublicplugin)

***

### useTranslation

Renames and re-exports [SuperTokensWrapper](#supertokenswrapper)

***

### useUserContext

Renames and re-exports [SuperTokensWrapper](#supertokenswrapper)
