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

## Classes

### default

Defined in: [index.ts:33](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/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-error"></a> `Error` | `static` | *typeof* `default` | `SuperTokensError` | [index.ts:36](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L36) |
| <a id="member-default-init"></a> `init` | `static` | (`config`) => `void` | `SuperTokens.init` | [index.ts:34](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L34) |
| <a id="member-default-recipeuserid"></a> `RecipeUserId` | `static` | *typeof* [`RecipeUserId`](#recipeuserid) | `RecipeUserId` | [index.ts:37](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L37) |
| <a id="member-default-user"></a> `User` | `static` | *typeof* [`User`](#user) | `User` | [index.ts:38](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L38) |

#### Methods

##### convertToRecipeUserId()

```ts check=false reason="Generated API signature"
static convertToRecipeUserId(recipeUserId): RecipeUserId;
```

Defined in: [index.ts:167](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L167)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `recipeUserId` | `string` |

###### Returns

[`RecipeUserId`](#recipeuserid)

##### createUserIdMapping()

```ts check=false reason="Generated API signature"
static createUserIdMapping(input): Promise<
  | {
  status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR";
}
  | {
  doesExternalUserIdExist: boolean;
  doesSuperTokensUserIdExist: boolean;
  status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR";
}>;
```

Defined in: [index.ts:88](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L88)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `externalUserId`: `string`; `externalUserIdInfo?`: `string`; `force?`: `boolean`; `superTokensUserId`: `string`; `userContext?`: `Record`\<`string`, `any`\>; \} |
| `input.externalUserId` | `string` |
| `input.externalUserIdInfo?` | `string` |
| `input.force?` | `boolean` |
| `input.superTokensUserId` | `string` |
| `input.userContext?` | `Record`\<`string`, `any`\> |

###### Returns

`Promise`\<
  \| \{
  `status`: `"OK"` \| `"UNKNOWN_SUPERTOKENS_USER_ID_ERROR"`;
\}
  \| \{
  `doesExternalUserIdExist`: `boolean`;
  `doesSuperTokensUserIdExist`: `boolean`;
  `status`: `"USER_ID_MAPPING_ALREADY_EXISTS_ERROR"`;
\}\>

##### deleteUser()

```ts check=false reason="Generated API signature"
static deleteUser(
   userId, 
   removeAllLinkedAccounts, 
   userContext?): Promise<{
  status: "OK";
}>;
```

Defined in: [index.ts:156](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L156)

###### Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `userId` | `string` | `undefined` |
| `removeAllLinkedAccounts` | `boolean` | `true` |
| `userContext?` | `Record`\<`string`, `any`\> | `undefined` |

###### Returns

`Promise`\<\{
  `status`: `"OK"`;
\}\>

##### deleteUserIdMapping()

```ts check=false reason="Generated API signature"
static deleteUserIdMapping(input): Promise<{
  didMappingExist: boolean;
  status: "OK";
}>;
```

Defined in: [index.ts:112](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L112)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `force?`: `boolean`; `userContext?`: `Record`\<`string`, `any`\>; `userId`: `string`; `userIdType?`: `"SUPERTOKENS"` \| `"EXTERNAL"` \| `"ANY"`; \} |
| `input.force?` | `boolean` |
| `input.userContext?` | `Record`\<`string`, `any`\> |
| `input.userId` | `string` |
| `input.userIdType?` | `"SUPERTOKENS"` \| `"EXTERNAL"` \| `"ANY"` |

###### Returns

`Promise`\<\{
  `didMappingExist`: `boolean`;
  `status`: `"OK"`;
\}\>

##### getAllCORSHeaders()

```ts check=false reason="Generated API signature"
static getAllCORSHeaders(): string[];
```

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

###### Returns

`string`[]

##### getRequestFromUserContext()

```ts check=false reason="Generated API signature"
static getRequestFromUserContext(userContext): BaseRequest;
```

Defined in: [index.ts:171](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L171)

###### Parameters

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

###### Returns

`BaseRequest`

##### getUser()

```ts check=false reason="Generated API signature"
static getUser(userId, userContext?): Promise<User>;
```

Defined in: [index.ts:136](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L136)

###### Parameters

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

###### Returns

`Promise`\<[`User`](types#user)\>

##### getUserCount()

```ts check=false reason="Generated API signature"
static getUserCount(
   includeRecipeIds?, 
   tenantId?, 
userContext?): Promise<number>;
```

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

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `includeRecipeIds?` | `string`[] |
| `tenantId?` | `string` |
| `userContext?` | `Record`\<`string`, `any`\> |

###### Returns

`Promise`\<`number`\>

##### getUserIdMapping()

```ts check=false reason="Generated API signature"
static getUserIdMapping(input): Promise<
  | {
  externalUserId: string;
  externalUserIdInfo: string;
  status: "OK";
  superTokensUserId: string;
}
  | {
  status: "UNKNOWN_MAPPING_ERROR";
}>;
```

Defined in: [index.ts:101](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L101)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `userContext?`: `Record`\<`string`, `any`\>; `userId`: `string`; `userIdType?`: `"SUPERTOKENS"` \| `"EXTERNAL"` \| `"ANY"`; \} |
| `input.userContext?` | `Record`\<`string`, `any`\> |
| `input.userId` | `string` |
| `input.userIdType?` | `"SUPERTOKENS"` \| `"EXTERNAL"` \| `"ANY"` |

###### Returns

`Promise`\<
  \| \{
  `externalUserId`: `string`;
  `externalUserIdInfo`: `string`;
  `status`: `"OK"`;
  `superTokensUserId`: `string`;
\}
  \| \{
  `status`: `"UNKNOWN_MAPPING_ERROR"`;
\}\>

##### getUsersNewestFirst()

```ts check=false reason="Generated API signature"
static getUsersNewestFirst(input): Promise<{
  nextPaginationToken?: string;
  users: User[];
}>;
```

Defined in: [index.ts:70](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L70)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `includeRecipeIds?`: `string`[]; `limit?`: `number`; `paginationToken?`: `string`; `query?`: \{ \[`key`: `string`\]: `string`; \}; `tenantId`: `string`; `userContext?`: `Record`\<`string`, `any`\>; \} |
| `input.includeRecipeIds?` | `string`[] |
| `input.limit?` | `number` |
| `input.paginationToken?` | `string` |
| `input.query?` | \{ \[`key`: `string`\]: `string`; \} |
| `input.tenantId` | `string` |
| `input.userContext?` | `Record`\<`string`, `any`\> |

###### Returns

`Promise`\<\{
  `nextPaginationToken?`: `string`;
  `users`: [`User`](types#user)[];
\}\>

##### getUsersOldestFirst()

```ts check=false reason="Generated API signature"
static getUsersOldestFirst(input): Promise<{
  nextPaginationToken?: string;
  users: User[];
}>;
```

Defined in: [index.ts:52](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L52)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `includeRecipeIds?`: `string`[]; `limit?`: `number`; `paginationToken?`: `string`; `query?`: \{ \[`key`: `string`\]: `string`; \}; `tenantId`: `string`; `userContext?`: `Record`\<`string`, `any`\>; \} |
| `input.includeRecipeIds?` | `string`[] |
| `input.limit?` | `number` |
| `input.paginationToken?` | `string` |
| `input.query?` | \{ \[`key`: `string`\]: `string`; \} |
| `input.tenantId` | `string` |
| `input.userContext?` | `Record`\<`string`, `any`\> |

###### Returns

`Promise`\<\{
  `nextPaginationToken?`: `string`;
  `users`: [`User`](types#user)[];
\}\>

##### isRecipeInitialized()

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

Defined in: [index.ts:175](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L175)

###### Parameters

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

###### Returns

`boolean`

##### listUsersByAccountInfo()

```ts check=false reason="Generated API signature"
static listUsersByAccountInfo(
   tenantId, 
   accountInfo, 
   doUnionOfAccountInfo, 
userContext?): Promise<User[]>;
```

Defined in: [index.ts:143](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L143)

###### Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `tenantId` | `string` | `undefined` |
| `accountInfo` | [`AccountInfoInput`](recipe-accountlinking-types#accountinfoinput) | `undefined` |
| `doUnionOfAccountInfo` | `boolean` | `false` |
| `userContext?` | `Record`\<`string`, `any`\> | `undefined` |

###### Returns

`Promise`\<[`User`](types#user)[]\>

##### updateOrDeleteUserIdMappingInfo()

```ts check=false reason="Generated API signature"
static updateOrDeleteUserIdMappingInfo(input): Promise<{
  status: "OK" | "UNKNOWN_MAPPING_ERROR";
}>;
```

Defined in: [index.ts:124](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L124)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `externalUserIdInfo?`: `string`; `userContext?`: `Record`\<`string`, `any`\>; `userId`: `string`; `userIdType?`: `"SUPERTOKENS"` \| `"EXTERNAL"` \| `"ANY"`; \} |
| `input.externalUserIdInfo?` | `string` |
| `input.userContext?` | `Record`\<`string`, `any`\> |
| `input.userId` | `string` |
| `input.userIdType?` | `"SUPERTOKENS"` \| `"EXTERNAL"` \| `"ANY"` |

###### Returns

`Promise`\<\{
  `status`: `"OK"` \| `"UNKNOWN_MAPPING_ERROR"`;
\}\>

***

### RecipeUserId

Defined in: [recipeUserId.ts:1](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipeUserId.ts#L1)

#### Constructors

##### Constructor

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

Defined in: [recipeUserId.ts:3](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipeUserId.ts#L3)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `recipeUserId` | `string` |

###### Returns

[`RecipeUserId`](#recipeuserid)

#### Methods

##### getAsString()

```ts check=false reason="Generated API signature"
getAsString(): string;
```

Defined in: [recipeUserId.ts:10](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipeUserId.ts#L10)

###### Returns

`string`

***

### User

Defined in: [user.ts:91](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/user.ts#L91)

#### Implements

- [`User`](types#user)

#### Constructors

##### Constructor

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

Defined in: [user.ts:109](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/user.ts#L109)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `user` | `UserWithoutHelperFunctions` |

###### Returns

[`User`](#user)

#### Properties

| Property | Modifier | Type | Defined in |
| ------ | ------ | ------ | ------ |
| <a id="emails"></a> `emails` | `readonly` | `string`[] | [user.ts:96](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/user.ts#L96) |
| <a id="id"></a> `id` | `readonly` | `string` | [user.ts:92](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/user.ts#L92) |
| <a id="isprimaryuser"></a> `isPrimaryUser` | `readonly` | `boolean` | [user.ts:93](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/user.ts#L93) |
| <a id="loginmethods"></a> `loginMethods` | `readonly` | `LoginMethod`[] | [user.ts:105](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/user.ts#L105) |
| <a id="phonenumbers"></a> `phoneNumbers` | `readonly` | `string`[] | [user.ts:97](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/user.ts#L97) |
| <a id="tenantids"></a> `tenantIds` | `readonly` | `string`[] | [user.ts:94](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/user.ts#L94) |
| <a id="thirdparty"></a> `thirdParty` | `readonly` | `object`[] | [user.ts:98](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/user.ts#L98) |
| <a id="timejoined"></a> `timeJoined` | `readonly` | `number` | [user.ts:107](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/user.ts#L107) |
| <a id="webauthn"></a> `webauthn` | `readonly` | `object` | [user.ts:102](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/user.ts#L102) |
| `webauthn.credentialIds` | `public` | `string`[] | [user.ts:103](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/user.ts#L103) |

#### Methods

##### toJson()

```ts check=false reason="Generated API signature"
toJson(): JSONObject;
```

Defined in: [user.ts:133](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/user.ts#L133)

###### Returns

[`JSONObject`](types#jsonobject)

###### Implementation of

```ts check=false reason="Generated API signature"
UserType.toJson;
```

##### fromApi()

```ts check=false reason="Generated API signature"
static fromApi(apiUser): User;
```

Defined in: [user.ts:129](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/user.ts#L129)

This function is used to create a User object from the API response.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `apiUser` | `Omit`\<`UserWithoutHelperFunctions`, `"id"`\> & `object` | The API response from the user endpoint. |

###### Returns

[`User`](#user)

A User object.

## Variables

### convertToRecipeUserId()

```ts check=false reason="Generated API signature"
convertToRecipeUserId: (recipeUserId) => RecipeUserId = SuperTokensWrapper.convertToRecipeUserId;
```

Defined in: [index.ts:206](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L206)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `recipeUserId` | `string` |

#### Returns

[`RecipeUserId`](#recipeuserid)

***

### createUserIdMapping()

```ts check=false reason="Generated API signature"
createUserIdMapping: (input) => Promise<
  | {
  status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR";
}
  | {
  doesExternalUserIdExist: boolean;
  doesSuperTokensUserIdExist: boolean;
  status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR";
}> = SuperTokensWrapper.createUserIdMapping;
```

Defined in: [index.ts:194](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L194)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `externalUserId`: `string`; `externalUserIdInfo?`: `string`; `force?`: `boolean`; `superTokensUserId`: `string`; `userContext?`: `Record`\<`string`, `any`\>; \} |
| `input.externalUserId` | `string` |
| `input.externalUserIdInfo?` | `string` |
| `input.force?` | `boolean` |
| `input.superTokensUserId` | `string` |
| `input.userContext?` | `Record`\<`string`, `any`\> |

#### Returns

`Promise`\<
  \| \{
  `status`: `"OK"` \| `"UNKNOWN_SUPERTOKENS_USER_ID_ERROR"`;
\}
  \| \{
  `doesExternalUserIdExist`: `boolean`;
  `doesSuperTokensUserIdExist`: `boolean`;
  `status`: `"USER_ID_MAPPING_ALREADY_EXISTS_ERROR"`;
\}\>

***

### deleteUser()

```ts check=false reason="Generated API signature"
deleteUser: (userId, removeAllLinkedAccounts, userContext?) => Promise<{
  status: "OK";
}> = SuperTokensWrapper.deleteUser;
```

Defined in: [index.ts:192](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L192)

#### Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `userId` | `string` | `undefined` |
| `removeAllLinkedAccounts` | `boolean` | `true` |
| `userContext?` | `Record`\<`string`, `any`\> | `undefined` |

#### Returns

`Promise`\<\{
  `status`: `"OK"`;
\}\>

***

### deleteUserIdMapping()

```ts check=false reason="Generated API signature"
deleteUserIdMapping: (input) => Promise<{
  didMappingExist: boolean;
  status: "OK";
}> = SuperTokensWrapper.deleteUserIdMapping;
```

Defined in: [index.ts:198](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L198)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `force?`: `boolean`; `userContext?`: `Record`\<`string`, `any`\>; `userId`: `string`; `userIdType?`: `"SUPERTOKENS"` \| `"EXTERNAL"` \| `"ANY"`; \} |
| `input.force?` | `boolean` |
| `input.userContext?` | `Record`\<`string`, `any`\> |
| `input.userId` | `string` |
| `input.userIdType?` | `"SUPERTOKENS"` \| `"EXTERNAL"` \| `"ANY"` |

#### Returns

`Promise`\<\{
  `didMappingExist`: `boolean`;
  `status`: `"OK"`;
\}\>

***

### Error

```ts check=false reason="Generated API signature"
Error: typeof default = SuperTokensWrapper.Error;
```

Defined in: [index.ts:212](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L212)

***

### getAllCORSHeaders()

```ts check=false reason="Generated API signature"
getAllCORSHeaders: () => string[] = SuperTokensWrapper.getAllCORSHeaders;
```

Defined in: [index.ts:184](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L184)

#### Returns

`string`[]

***

### getRequestFromUserContext()

```ts check=false reason="Generated API signature"
getRequestFromUserContext: (userContext) => BaseRequest = SuperTokensWrapper.getRequestFromUserContext;
```

Defined in: [index.ts:208](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L208)

#### Parameters

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

#### Returns

`BaseRequest`

***

### getUser()

```ts check=false reason="Generated API signature"
getUser: (userId, userContext?) => Promise<User> = SuperTokensWrapper.getUser;
```

Defined in: [index.ts:202](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L202)

#### Parameters

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

#### Returns

`Promise`\<[`User`](types#user)\>

***

### getUserCount()

```ts check=false reason="Generated API signature"
getUserCount: (includeRecipeIds?, tenantId?, userContext?) => Promise<number> = SuperTokensWrapper.getUserCount;
```

Defined in: [index.ts:186](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L186)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `includeRecipeIds?` | `string`[] |
| `tenantId?` | `string` |
| `userContext?` | `Record`\<`string`, `any`\> |

#### Returns

`Promise`\<`number`\>

***

### getUserIdMapping()

```ts check=false reason="Generated API signature"
getUserIdMapping: (input) => Promise<
  | {
  externalUserId: string;
  externalUserIdInfo: string;
  status: "OK";
  superTokensUserId: string;
}
  | {
  status: "UNKNOWN_MAPPING_ERROR";
}> = SuperTokensWrapper.getUserIdMapping;
```

Defined in: [index.ts:196](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L196)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `userContext?`: `Record`\<`string`, `any`\>; `userId`: `string`; `userIdType?`: `"SUPERTOKENS"` \| `"EXTERNAL"` \| `"ANY"`; \} |
| `input.userContext?` | `Record`\<`string`, `any`\> |
| `input.userId` | `string` |
| `input.userIdType?` | `"SUPERTOKENS"` \| `"EXTERNAL"` \| `"ANY"` |

#### Returns

`Promise`\<
  \| \{
  `externalUserId`: `string`;
  `externalUserIdInfo`: `string`;
  `status`: `"OK"`;
  `superTokensUserId`: `string`;
\}
  \| \{
  `status`: `"UNKNOWN_MAPPING_ERROR"`;
\}\>

***

### getUsersNewestFirst()

```ts check=false reason="Generated API signature"
getUsersNewestFirst: (input) => Promise<{
  nextPaginationToken?: string;
  users: User[];
}> = SuperTokensWrapper.getUsersNewestFirst;
```

Defined in: [index.ts:190](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L190)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `includeRecipeIds?`: `string`[]; `limit?`: `number`; `paginationToken?`: `string`; `query?`: \{ \[`key`: `string`\]: `string`; \}; `tenantId`: `string`; `userContext?`: `Record`\<`string`, `any`\>; \} |
| `input.includeRecipeIds?` | `string`[] |
| `input.limit?` | `number` |
| `input.paginationToken?` | `string` |
| `input.query?` | \{ \[`key`: `string`\]: `string`; \} |
| `input.tenantId` | `string` |
| `input.userContext?` | `Record`\<`string`, `any`\> |

#### Returns

`Promise`\<\{
  `nextPaginationToken?`: `string`;
  `users`: [`User`](types#user)[];
\}\>

***

### getUsersOldestFirst()

```ts check=false reason="Generated API signature"
getUsersOldestFirst: (input) => Promise<{
  nextPaginationToken?: string;
  users: User[];
}> = SuperTokensWrapper.getUsersOldestFirst;
```

Defined in: [index.ts:188](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L188)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `includeRecipeIds?`: `string`[]; `limit?`: `number`; `paginationToken?`: `string`; `query?`: \{ \[`key`: `string`\]: `string`; \}; `tenantId`: `string`; `userContext?`: `Record`\<`string`, `any`\>; \} |
| `input.includeRecipeIds?` | `string`[] |
| `input.limit?` | `number` |
| `input.paginationToken?` | `string` |
| `input.query?` | \{ \[`key`: `string`\]: `string`; \} |
| `input.tenantId` | `string` |
| `input.userContext?` | `Record`\<`string`, `any`\> |

#### Returns

`Promise`\<\{
  `nextPaginationToken?`: `string`;
  `users`: [`User`](types#user)[];
\}\>

***

### init()

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

Defined in: [index.ts:182](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L182)

#### Parameters

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

#### Returns

`void`

***

### isRecipeInitialized()

```ts check=false reason="Generated API signature"
isRecipeInitialized: (recipeId) => boolean = SuperTokensWrapper.isRecipeInitialized;
```

Defined in: [index.ts:210](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L210)

#### Parameters

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

#### Returns

`boolean`

***

### listUsersByAccountInfo()

```ts check=false reason="Generated API signature"
listUsersByAccountInfo: (tenantId, accountInfo, doUnionOfAccountInfo, userContext?) => Promise<User[]> = SuperTokensWrapper.listUsersByAccountInfo;
```

Defined in: [index.ts:204](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L204)

#### Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `tenantId` | `string` | `undefined` |
| `accountInfo` | [`AccountInfoInput`](recipe-accountlinking-types#accountinfoinput) | `undefined` |
| `doUnionOfAccountInfo` | `boolean` | `false` |
| `userContext?` | `Record`\<`string`, `any`\> | `undefined` |

#### Returns

`Promise`\<[`User`](types#user)[]\>

***

### updateOrDeleteUserIdMappingInfo()

```ts check=false reason="Generated API signature"
updateOrDeleteUserIdMappingInfo: (input) => Promise<{
  status: "OK" | "UNKNOWN_MAPPING_ERROR";
}> = SuperTokensWrapper.updateOrDeleteUserIdMappingInfo;
```

Defined in: [index.ts:200](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/index.ts#L200)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `externalUserIdInfo?`: `string`; `userContext?`: `Record`\<`string`, `any`\>; `userId`: `string`; `userIdType?`: `"SUPERTOKENS"` \| `"EXTERNAL"` \| `"ANY"`; \} |
| `input.externalUserIdInfo?` | `string` |
| `input.userContext?` | `Record`\<`string`, `any`\> |
| `input.userId` | `string` |
| `input.userIdType?` | `"SUPERTOKENS"` \| `"EXTERNAL"` \| `"ANY"` |

#### Returns

`Promise`\<\{
  `status`: `"OK"` \| `"UNKNOWN_MAPPING_ERROR"`;
\}\>

## References

### SuperTokensConfig

Renames and re-exports [TypeInput](types#typeinput)

***

### SuperTokensPlugin

Re-exports [SuperTokensPlugin](types#supertokensplugin)

***

### SuperTokensPublicConfig

Re-exports [SuperTokensPublicConfig](types#supertokenspublicconfig)

***

### SuperTokensPublicPlugin

Re-exports [SuperTokensPublicPlugin](types#supertokenspublicplugin)
