---
name: "cancelAddUnlockMethod"
mode: "api"
versionRequirements:
  - { name: "@ray-js/lock-sdk", version: "1.0.0" }
title: "cancelAddUnlockMethod - Cancel adding unlock method."
summary: "Cancel adding unlock method."
---

## cancelAddUnlockMethod

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

### Description

Cancel the ongoing add unlock method process.

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `CancelAddUnlockMethodParams` | Yes | Cancellation parameters (type: unlock method type, userId: user ID, timeout: timeout (ms)) |

### Return Value

Type: `Promise<void>`

None (resolves after cancellation succeeds)

### Error Codes

| Error Code | Error Message |
| --- | --- |
| `1052` | The previous operation on the same device has not completed |
| `1014` | This unlock method type is not supported |
| `1001` | Device is offline |
| `1002` | Operation timed out |

### Referenced Types

##### `interface` CancelAddUnlockMethodParams

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


### Examples

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