---
name: "getUsers"
mode: "api"
versionRequirements:
  - { name: "@ray-js/lock-sdk", version: "1.0.0" }
title: "getUsers - Get lock member list."
summary: "Get lock member list."
---

## getUsers

> [VERSION] @ray-js/lock-sdk >= 1.0.0

### Description

Query the user list with pagination/keywords.

### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `page` | `number` | No | Page number |
| `pageSize` | `number` | No | Page size |
| `keyword` | `string` | No | Search keyword |

### Return Value

Type: `Promise<getUsersResult>`

User list result

##### getUsersResult

| Property | Type | Description |
| --- | --- | --- |
| `list` | `UserInfo[]` | User list |
| `hasMore` | `boolean` | Whether more data is available |

### Referenced Types

##### `interface` UserInfo

| Property | Type | Description |
| --- | --- | --- |
| `userId` | `string` | Cloud user ID |
| `lockUserId` | `number` | Lock‑side user ID |
| `avatarUrl` | `string` | Avatar URL |
| `backHomeNotifyAttr` | `number` | Home arrival notification attribute flags |
| `effectiveFlag` | `number` | Effective state flag |
| `nickName` | `string` | Nickname |
| `offlineUnlock` | `boolean` | Whether offline unlocking is supported |
| `timeScheduleInfo` | `Object` | Effective time range and repeat rules |
| `unlockDetails` | `Object[]` | Details grouped by unlock method type |
| `userContact` | `string` | User contact (account) |
| `userType` | `10 \| 20 \| 30 \| 40 \| 50` | User type |
| `isFamilyUser` | `boolean` | Whether the user is a household member |

##### `type` BitStatus

Bit switch: 0 off, 1 on / Single-bit flag

```typescript
export type BitStatus = 0 | 1;
```

##### `interface` UnlockMethodBaseInfo

| Property | Type | Description |
| --- | --- | --- |
| `unlockId` | `number` | Unlock method hardware/instance ID |
| `unlockName` | `string` | Unlock method name |
| `isBound` | `boolean` | Whether bound to a cloud user |
| `id` | `number` | Cloud-assigned unlock method record ID |
| `photoUnlock` | `boolean` | Whether an image-based unlock method |
| `isSpecial` | `boolean` | Whether a special unlock method (notifications and other extensions) |

##### `type` Week

Weekly repeat bitmap: indices 0–6 correspond to Sun–Sat; 0 inactive, 1 active

```typescript
export type Week = [
  BitStatus,
  BitStatus,
  BitStatus,
  BitStatus,
  BitStatus,
  BitStatus,
  BitStatus,
];
```

##### `type` UnlockMethodType

Unlock method business type literal

```typescript
export type UnlockMethodType =
  | "finger"
  | "face"
  | "password"
  | "card"
  | "fingerVein"
  | "hand"
  | "eye";
```

##### `type` UserInfo.timeScheduleInfo

| Property | Type | Description |
| --- | --- | --- |
| `effectiveTime` | `number` | Effective time (timestamp in milliseconds) |
| `expiredTime` | `number` | Expiration time (timestamp in milliseconds) |
| `permanent` | `boolean` | Whether it never expires |
| `scheduleDetails` | `Object` | Repeat details for non-permanent schedules |

##### `type` UserInfo.timeScheduleInfo.scheduleDetails

| Property | Type | Description |
| --- | --- | --- |
| `repeat` | `boolean` | Whether repeats weekly |
| `effectiveTime` | `number` | Daily start time (minutes since 00:00) |
| `invalidTime` | `number` | Daily end time (minutes) |
| `timeZoneId` | `string` | Time zone ID |
| `weeks` | `[BitStatus, BitStatus, BitStatus, BitStatus, BitStatus, BitStatus, BitStatus]` | Weekly bitmap |

##### `type` UserInfo.unlockDetails

| Property | Type | Description |
| --- | --- | --- |
| `count` | `number` | Number of entries in the group |
| `dpCode` | `string` | DP code for this group |
| `dpId` | `number` | DP ID for this group |
| `type` | `"finger" \| "face" \| "password" \| "card" \| "fingerVein" \| "hand" \| "eye"` | Unlock method type |
| `unlockList` | `UnlockMethodBaseInfo[]` | Each unlock method in the group |


### Examples

#### Example

```ts
import { getUsers } from '@ray-js/lock-sdk';
const users = await getUsers({ page: 1, pageSize: 10 });
```
