---
title: supertokens-node/recipe/jwt/types
description: References documentation for the supertokens-node/recipe/jwt/types package
sidebar:
  order: 180
---

## Type Aliases

### APIInterface

```ts check=false reason="Generated API signature"
type APIInterface = object;
```

Defined in: [recipe/jwt/types.ts:82](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L82)

#### Properties

| Property | Type | Defined in |
| ------ | ------ | ------ |
| <a id="getjwksget"></a> `getJWKSGET` | \| `undefined` \| (`input`) => `Promise`\< \| \{ `keys`: [`JsonWebKey`](#jsonwebkey)[]; \} \| [`GeneralErrorResponse`](types#generalerrorresponse)\> | [recipe/jwt/types.ts:83](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L83) |

***

### APIOptions

```ts check=false reason="Generated API signature"
type APIOptions = object;
```

Defined in: [recipe/jwt/types.ts:51](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L51)

#### Properties

| Property | Type | Defined in |
| ------ | ------ | ------ |
| <a id="config"></a> `config` | [`TypeNormalisedInput`](#typenormalisedinput) | [recipe/jwt/types.ts:53](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L53) |
| <a id="isinserverlessenv"></a> `isInServerlessEnv` | `boolean` | [recipe/jwt/types.ts:55](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L55) |
| <a id="recipeid"></a> `recipeId` | `string` | [recipe/jwt/types.ts:54](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L54) |
| <a id="recipeimplementation"></a> `recipeImplementation` | [`RecipeInterface`](#recipeinterface) | [recipe/jwt/types.ts:52](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L52) |
| <a id="req"></a> `req` | `BaseRequest` | [recipe/jwt/types.ts:56](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L56) |
| <a id="res"></a> `res` | `BaseResponse` | [recipe/jwt/types.ts:57](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L57) |

***

### JsonWebKey

```ts check=false reason="Generated API signature"
type JsonWebKey = object;
```

Defined in: [recipe/jwt/types.ts:20](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L20)

#### Properties

| Property | Type | Defined in |
| ------ | ------ | ------ |
| <a id="alg"></a> `alg` | `string` | [recipe/jwt/types.ts:25](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L25) |
| <a id="e"></a> `e` | `string` | [recipe/jwt/types.ts:24](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L24) |
| <a id="kid"></a> `kid` | `string` | [recipe/jwt/types.ts:22](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L22) |
| <a id="kty"></a> `kty` | `string` | [recipe/jwt/types.ts:21](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L21) |
| <a id="n"></a> `n` | `string` | [recipe/jwt/types.ts:23](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L23) |
| <a id="use"></a> `use` | `string` | [recipe/jwt/types.ts:26](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L26) |

***

### RecipeInterface

```ts check=false reason="Generated API signature"
type RecipeInterface = object;
```

Defined in: [recipe/jwt/types.ts:60](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L60)

#### Methods

##### createJWT()

```ts check=false reason="Generated API signature"
createJWT(input): Promise<
  | {
  jwt: string;
  status: "OK";
}
  | {
  status: "UNSUPPORTED_ALGORITHM_ERROR";
}>;
```

Defined in: [recipe/jwt/types.ts:61](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L61)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `payload?`: `any`; `userContext`: [`UserContext`](types#usercontext); `useStaticSigningKey?`: `boolean`; `validitySeconds?`: `number`; \} |
| `input.payload?` | `any` |
| `input.userContext` | [`UserContext`](types#usercontext) |
| `input.useStaticSigningKey?` | `boolean` |
| `input.validitySeconds?` | `number` |

###### Returns

`Promise`\<
  \| \{
  `jwt`: `string`;
  `status`: `"OK"`;
\}
  \| \{
  `status`: `"UNSUPPORTED_ALGORITHM_ERROR"`;
\}\>

##### getJWKS()

```ts check=false reason="Generated API signature"
getJWKS(input): Promise<{
  keys: JsonWebKey[];
  validityInSeconds?: number;
}>;
```

Defined in: [recipe/jwt/types.ts:76](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L76)

###### Parameters

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

###### Returns

`Promise`\<\{
  `keys`: [`JsonWebKey`](#jsonwebkey)[];
  `validityInSeconds?`: `number`;
\}\>

***

### TypeInput

```ts check=false reason="Generated API signature"
type TypeInput = object;
```

Defined in: [recipe/jwt/types.ts:29](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L29)

#### Properties

| Property | Type | Defined in |
| ------ | ------ | ------ |
| <a id="jwtvalidityseconds"></a> `jwtValiditySeconds?` | `number` | [recipe/jwt/types.ts:30](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L30) |
| <a id="override"></a> `override?` | `object` | [recipe/jwt/types.ts:31](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L31) |
| `override.apis?` | (`originalImplementation`, `builder`) => [`APIInterface`](#apiinterface) | [recipe/jwt/types.ts:36](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L36) |
| `override.functions?` | (`originalImplementation`, `builder`) => [`RecipeInterface`](#recipeinterface) | [recipe/jwt/types.ts:32](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L32) |

***

### TypeNormalisedInput

```ts check=false reason="Generated API signature"
type TypeNormalisedInput = object;
```

Defined in: [recipe/jwt/types.ts:40](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L40)

#### Properties

| Property | Type | Defined in |
| ------ | ------ | ------ |
| <a id="jwtvalidityseconds-1"></a> `jwtValiditySeconds` | `number` | [recipe/jwt/types.ts:41](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L41) |
| <a id="override-1"></a> `override` | `object` | [recipe/jwt/types.ts:42](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L42) |
| `override.apis` | (`originalImplementation`, `builder`) => [`APIInterface`](#apiinterface) | [recipe/jwt/types.ts:47](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L47) |
| `override.functions` | (`originalImplementation`, `builder`) => [`RecipeInterface`](#recipeinterface) | [recipe/jwt/types.ts:43](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/types.ts#L43) |
