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

## Classes

### default

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

#### 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-init"></a> `init` | `static` | (`config?`) => [`RecipeListFunction`](types#recipelistfunction) | `Recipe.init` | [recipe/jwt/index.ts:21](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/index.ts#L21) |

#### Methods

##### createJWT()

```ts check=false reason="Generated API signature"
static createJWT(
   payload, 
   validitySeconds?, 
   useStaticSigningKey?, 
   userContext?): Promise<
  | {
  jwt: string;
  status: "OK";
}
  | {
  status: "UNSUPPORTED_ALGORITHM_ERROR";
}>;
```

Defined in: [recipe/jwt/index.ts:23](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/index.ts#L23)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `payload` | `any` |
| `validitySeconds?` | `number` |
| `useStaticSigningKey?` | `boolean` |
| `userContext?` | `Record`\<`string`, `any`\> |

###### Returns

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

##### getJWKS()

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

Defined in: [recipe/jwt/index.ts:37](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/index.ts#L37)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `userContext?` | `Record`\<`string`, `any`\> |

###### Returns

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

## Variables

### createJWT()

```ts check=false reason="Generated API signature"
createJWT: (payload, validitySeconds?, useStaticSigningKey?, userContext?) => Promise<
  | {
  jwt: string;
  status: "OK";
}
  | {
  status: "UNSUPPORTED_ALGORITHM_ERROR";
}> = Wrapper.createJWT;
```

Defined in: [recipe/jwt/index.ts:45](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/index.ts#L45)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `payload` | `any` |
| `validitySeconds?` | `number` |
| `useStaticSigningKey?` | `boolean` |
| `userContext?` | `Record`\<`string`, `any`\> |

#### Returns

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

***

### getJWKS()

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

Defined in: [recipe/jwt/index.ts:46](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/index.ts#L46)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `userContext?` | `Record`\<`string`, `any`\> |

#### Returns

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

***

### init()

```ts check=false reason="Generated API signature"
init: (config?) => RecipeListFunction = Wrapper.init;
```

Defined in: [recipe/jwt/index.ts:44](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/jwt/index.ts#L44)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `config?` | [`TypeInput`](recipe-jwt-types#typeinput) |

#### Returns

[`RecipeListFunction`](types#recipelistfunction)

## References

### APIInterface

Re-exports [APIInterface](recipe-jwt-types#apiinterface)

***

### APIOptions

Re-exports [APIOptions](recipe-jwt-types#apioptions)

***

### JsonWebKey

Re-exports [JsonWebKey](recipe-jwt-types#jsonwebkey)

***

### RecipeInterface

Re-exports [RecipeInterface](recipe-jwt-types#recipeinterface)
