---
title: supertokens-auth-react/recipe/session
description: References documentation for the supertokens-auth-react/recipe/session package
sidebar:
  order: 150
---

## Classes

### BooleanClaim

Defined in: [claims/booleanClaim.ts:6](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/claims/booleanClaim.ts#L6)

#### Extends

- [`SuperTokensWrapper`](index#supertokenswrapper-1)

#### Constructors

##### Constructor

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

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

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `config` | `any` |

###### Returns

[`BooleanClaim`](#booleanclaim)

###### Overrides

```ts check=false reason="Generated API signature"
BooleanClaimWebJS.constructor
```

***

### default

Defined in: [recipe/session/index.ts:34](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L34)

#### Constructors

##### Constructor

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

###### Returns

[`default`](#default)

#### Properties

| Property | Modifier | Type | Default value | Defined in |
| ------ | ------ | ------ | ------ | ------ |
| `ComponentsOverrideProvider` | `static` | `any` | `RecipeComponentsOverrideContextProvider` | [recipe/session/index.ts:112](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L112) |
| `SessionAuth` | `static` | `any` | `SessionAuthWrapper` | [recipe/session/index.ts:38](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L38) |
| `useClaimValue` | `static` | \<`T`\>(`claim`) => \| \{ `loading`: `true`; \} \| \{ `doesSessionExist`: `boolean`; `loading`: `false`; `value`: `T`; \} | `useClaimValueFunc` | [recipe/session/index.ts:36](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L36) |
| `useSessionContext` | `static` | () => [`SessionContextType`](recipe-session-types#sessioncontexttype) | `useSessionContextFunc` | [recipe/session/index.ts:35](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L35) |

#### Methods

##### ~~addAxiosInterceptors()~~

```ts check=false reason="Generated API signature"
static addAxiosInterceptors(axiosInstance, userContext?): void;
```

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

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `axiosInstance` | `any` |
| `userContext?` | [`UserContext`](types#usercontext) |

###### Returns

`void`

###### Deprecated

##### attemptRefreshingSession()

```ts check=false reason="Generated API signature"
static attemptRefreshingSession(): Promise<boolean>;
```

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

###### Returns

`Promise`\<`boolean`\>

##### doesSessionExist()

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

Defined in: [recipe/session/index.ts:66](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L66)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: [`UserContext`](types#usercontext); \} |
| `input.userContext?` | [`UserContext`](types#usercontext) |

###### Returns

`Promise`\<`boolean`\>

##### getAccessToken()

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

Defined in: [recipe/session/index.ts:50](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L50)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: [`UserContext`](types#usercontext); \} |
| `input.userContext?` | [`UserContext`](types#usercontext) |

###### Returns

`Promise`\<`string`\>

##### getAccessTokenPayloadSecurely()

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

Defined in: [recipe/session/index.ts:56](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L56)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: [`UserContext`](types#usercontext); \} |
| `input.userContext?` | [`UserContext`](types#usercontext) |

###### Returns

`Promise`\<`any`\>

##### getClaimValue()

```ts check=false reason="Generated API signature"
static getClaimValue<T>(input): Promise<T>;
```

Defined in: [recipe/session/index.ts:105](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L105)

###### Type Parameters

| Type Parameter |
| ------ |
| `T` |

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `claim`: `SessionClaim`\<`T`\>; `userContext?`: [`UserContext`](types#usercontext); \} |
| `input.claim` | `SessionClaim`\<`T`\> |
| `input.userContext?` | [`UserContext`](types#usercontext) |

###### Returns

`Promise`\<`T`\>

##### getInvalidClaimsFromResponse()

```ts check=false reason="Generated API signature"
static getInvalidClaimsFromResponse(input): Promise<ClaimValidationError[]>;
```

Defined in: [recipe/session/index.ts:98](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L98)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `response`: \| `Response` \| \{ `data`: `any`; \}; `userContext`: [`UserContext`](types#usercontext); \} |
| `input.response` | \| `Response` \| \{ `data`: `any`; \} |
| `input.userContext` | [`UserContext`](types#usercontext) |

###### Returns

`Promise`\<`ClaimValidationError`[]\>

##### getUserId()

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

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

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: [`UserContext`](types#usercontext); \} |
| `input.userContext?` | [`UserContext`](types#usercontext) |

###### Returns

`Promise`\<`string`\>

##### init()

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

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

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `config?` | `any` |

###### Returns

`any`

##### signOut()

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

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

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: [`UserContext`](types#usercontext); \} |
| `input.userContext?` | [`UserContext`](types#usercontext) |

###### Returns

`Promise`\<`void`\>

##### validateClaims()

```ts check=false reason="Generated API signature"
static validateClaims(input?): ClaimValidationError[] | Promise<ClaimValidationError[]>;
```

Defined in: [recipe/session/index.ts:85](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L85)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `overrideGlobalClaimValidators?`: (`globalClaimValidators`, `userContext`) => `SessionClaimValidator`[]; `userContext?`: [`UserContext`](types#usercontext); \} |
| `input.overrideGlobalClaimValidators?` | (`globalClaimValidators`, `userContext`) => `SessionClaimValidator`[] |
| `input.userContext?` | [`UserContext`](types#usercontext) |

###### Returns

`ClaimValidationError`[] \| `Promise`\<`ClaimValidationError`[]\>

***

### PrimitiveArrayClaim\<T\>

Defined in: [claims/primitiveArrayClaim.ts:6](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/claims/primitiveArrayClaim.ts#L6)

#### Extends

- [`SuperTokensWrapper`](index#supertokenswrapper-1)\<`T`\>

#### Type Parameters

| Type Parameter |
| ------ |
| `T` |

#### Constructors

##### Constructor

```ts check=false reason="Generated API signature"
new PrimitiveArrayClaim<T>(config): PrimitiveArrayClaim<T>;
```

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

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `config` | `any` |

###### Returns

[`PrimitiveArrayClaim`](#primitivearrayclaim)\<`T`\>

###### Overrides

```ts check=false reason="Generated API signature"
PrimitiveArrayClaimWebJS<T>.constructor
```

***

### PrimitiveClaim\<T\>

Defined in: [claims/primitiveClaim.ts:6](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/claims/primitiveClaim.ts#L6)

#### Extends

- [`SuperTokensWrapper`](index#supertokenswrapper-1)\<`T`\>

#### Type Parameters

| Type Parameter |
| ------ |
| `T` |

#### Constructors

##### Constructor

```ts check=false reason="Generated API signature"
new PrimitiveClaim<T>(config): PrimitiveClaim<T>;
```

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

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `config` | `any` |

###### Returns

[`PrimitiveClaim`](#primitiveclaim)\<`T`\>

###### Overrides

```ts check=false reason="Generated API signature"
PrimitiveClaimWebJS<T>.constructor
```

## Variables

### ~~addAxiosInterceptors()~~

```ts check=false reason="Generated API signature"
const addAxiosInterceptors: (axiosInstance, userContext?) => void = SessionAPIWrapper.addAxiosInterceptors;
```

Defined in: [recipe/session/index.ts:127](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L127)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `axiosInstance` | `any` |
| `userContext?` | [`UserContext`](types#usercontext) |

#### Returns

`void`

#### Deprecated

#### Deprecated

***

### attemptRefreshingSession()

```ts check=false reason="Generated API signature"
const attemptRefreshingSession: () => Promise<boolean> = SessionAPIWrapper.attemptRefreshingSession;
```

Defined in: [recipe/session/index.ts:122](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L122)

#### Returns

`Promise`\<`boolean`\>

***

### doesSessionExist()

```ts check=false reason="Generated API signature"
const doesSessionExist: (input?) => Promise<boolean> = SessionAPIWrapper.doesSessionExist;
```

Defined in: [recipe/session/index.ts:123](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L123)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: [`UserContext`](types#usercontext); \} |
| `input.userContext?` | [`UserContext`](types#usercontext) |

#### Returns

`Promise`\<`boolean`\>

***

### getAccessToken()

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

Defined in: [recipe/session/index.ts:120](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L120)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: [`UserContext`](types#usercontext); \} |
| `input.userContext?` | [`UserContext`](types#usercontext) |

#### Returns

`Promise`\<`string`\>

***

### getAccessTokenPayloadSecurely()

```ts check=false reason="Generated API signature"
const getAccessTokenPayloadSecurely: (input?) => Promise<any> = SessionAPIWrapper.getAccessTokenPayloadSecurely;
```

Defined in: [recipe/session/index.ts:121](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L121)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: [`UserContext`](types#usercontext); \} |
| `input.userContext?` | [`UserContext`](types#usercontext) |

#### Returns

`Promise`\<`any`\>

***

### getClaimValue()

```ts check=false reason="Generated API signature"
const getClaimValue: <T>(input) => Promise<T> = SessionAPIWrapper.getClaimValue;
```

Defined in: [recipe/session/index.ts:131](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L131)

#### Type Parameters

| Type Parameter |
| ------ |
| `T` |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `claim`: `SessionClaim`\<`T`\>; `userContext?`: [`UserContext`](types#usercontext); \} |
| `input.claim` | `SessionClaim`\<`T`\> |
| `input.userContext?` | [`UserContext`](types#usercontext) |

#### Returns

`Promise`\<`T`\>

***

### getInvalidClaimsFromResponse()

```ts check=false reason="Generated API signature"
const getInvalidClaimsFromResponse: (input) => Promise<ClaimValidationError[]> = SessionAPIWrapper.getInvalidClaimsFromResponse;
```

Defined in: [recipe/session/index.ts:130](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L130)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `response`: \| `Response` \| \{ `data`: `any`; \}; `userContext`: [`UserContext`](types#usercontext); \} |
| `input.response` | \| `Response` \| \{ `data`: `any`; \} |
| `input.userContext` | [`UserContext`](types#usercontext) |

#### Returns

`Promise`\<`ClaimValidationError`[]\>

***

### getUserId()

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

Defined in: [recipe/session/index.ts:119](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L119)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: [`UserContext`](types#usercontext); \} |
| `input.userContext?` | [`UserContext`](types#usercontext) |

#### Returns

`Promise`\<`string`\>

***

### init()

```ts check=false reason="Generated API signature"
const init: (config?) => any = SessionAPIWrapper.init;
```

Defined in: [recipe/session/index.ts:118](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L118)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `config?` | `any` |

#### Returns

`any`

***

### SessionAuth

```ts check=false reason="Generated API signature"
const SessionAuth: any = SessionAPIWrapper.SessionAuth;
```

Defined in: [recipe/session/index.ts:117](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L117)

***

### SessionComponentsOverrideProvider

```ts check=false reason="Generated API signature"
const SessionComponentsOverrideProvider: any = SessionAPIWrapper.ComponentsOverrideProvider;
```

Defined in: [recipe/session/index.ts:132](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L132)

***

### SessionContext

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

Defined in: [recipe/session/sessionContext.ts:5](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/sessionContext.ts#L5)

***

### signOut()

```ts check=false reason="Generated API signature"
const signOut: (input?) => Promise<void> = SessionAPIWrapper.signOut;
```

Defined in: [recipe/session/index.ts:128](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L128)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: [`UserContext`](types#usercontext); \} |
| `input.userContext?` | [`UserContext`](types#usercontext) |

#### Returns

`Promise`\<`void`\>

***

### useClaimValue()

```ts check=false reason="Generated API signature"
const useClaimValue: <T>(claim) => 
  | {
  loading: true;
}
  | {
  doesSessionExist: boolean;
  loading: false;
  value: T;
} = SessionAPIWrapper.useClaimValue;
```

Defined in: [recipe/session/index.ts:116](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L116)

#### Type Parameters

| Type Parameter |
| ------ |
| `T` |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `claim` | `SessionClaim`\<`T`\> |

#### Returns

  \| \{
  `loading`: `true`;
\}
  \| \{
  `doesSessionExist`: `boolean`;
  `loading`: `false`;
  `value`: `T`;
\}

***

### useSessionContext()

```ts check=false reason="Generated API signature"
const useSessionContext: () => SessionContextType = SessionAPIWrapper.useSessionContext;
```

Defined in: [recipe/session/index.ts:115](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L115)

#### Returns

[`SessionContextType`](recipe-session-types#sessioncontexttype)

***

### validateClaims()

```ts check=false reason="Generated API signature"
const validateClaims: (input?) => ClaimValidationError[] | Promise<ClaimValidationError[]> = SessionAPIWrapper.validateClaims;
```

Defined in: [recipe/session/index.ts:129](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/session/index.ts#L129)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `overrideGlobalClaimValidators?`: (`globalClaimValidators`, `userContext`) => `SessionClaimValidator`[]; `userContext?`: [`UserContext`](types#usercontext); \} |
| `input.overrideGlobalClaimValidators?` | (`globalClaimValidators`, `userContext`) => `SessionClaimValidator`[] |
| `input.userContext?` | [`UserContext`](types#usercontext) |

#### Returns

`ClaimValidationError`[] \| `Promise`\<`ClaimValidationError`[]\>

## References

### ClaimValidationError

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

***

### ClaimValidationResult

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

***

### InputType

Re-exports [InputType](recipe-session-types#inputtype)

***

### RecipeInterface

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

***

### SessionClaim

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

***

### SessionClaimValidator

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

***

### SessionContextType

Re-exports [SessionContextType](recipe-session-types#sessioncontexttype)
