---
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

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `GetUsersParams` | No | Query parameters (page: page number, pageSize: items per page, keyword: 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` GetUsersParams

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

##### `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` | `"UserType.ADMIN" \\| "UserType.MEMBER" \\| "UserType.UNKNOW" \\| "UserType.SHARE" \\| "UserType.OWNER"` | User type |
| `isFamilyUser` | `boolean` | Whether the user is a household member |

##### `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,
];
```

##### `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) |

##### `enum` UserType

| Enum Value | Actual Value | Description |
| --- | --- | --- |
| `UserType.ADMIN` | `10` | Administrator |
| `UserType.MEMBER` | `20` | Member |
| `UserType.UNKNOW` | `30` | Anonymous |
| `UserType.SHARE` | `40` | Shared member |
| `UserType.OWNER` | `50` | Home owner |

##### `type` UserInfo.timeScheduleInfo

| Property | Type | Description |
| --- | --- | --- |
| `userTimeSet` | `string` | User time configuration |
| `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` | `Week` | 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

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