---
name: "startAddUnlockMethod"
mode: "api"
versionRequirements:
  - { name: "@ray-js/lock-sdk", version: "1.0.0" }
title: "startAddUnlockMethod - Start adding unlock method."
summary: "Start adding unlock method. This method is used to start adding unlock methods that require input, such as fingerprint, face, card, etc."
---

## startAddUnlockMethod

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

### Description

Start adding an unlock method

### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | `"finger" \| "face" \| "password" \| "card" \| "fingerVein" \| "hand" \| "eye"` | Yes | Unlock method type |
| `userId` | `string` | Yes | User ID |
| `timeout` | `number` | No | Timeout (ms) |

### Return Value

Type: `Promise<StartAddUnlockMethodResult>`

None (resolves after the process ends)

##### StartAddUnlockMethodResult

| Property | Type | Description |
| --- | --- | --- |
| `total` | `number` | Total number of steps |

### Error Codes

| Error Code | Error Message |
| --- | --- |
| `1014` | This unlock method type is not supported |
| `1001` | Device is offline |
| `1002` | Operation timed out |
| `1015` | ~1025 Device-reported add failure (status 0~10) |
| `1026` | Device-reported add failure (status 0xfe) |
| `1027` | Device reported an unknown stage |

### Examples

#### Example

```ts
import { startAddUnlockMethod } from '@ray-js/lock-sdk';
await startAddUnlockMethod({ type: 'fingerprint', userId: 'user_001' });
```
