---
name: "offAddUnlockMethod"
mode: "api"
versionRequirements:
  - { name: "@ray-js/lock-sdk", version: "1.0.0" }
title: "offAddUnlockMethod - Unregister unlock method step listener."
summary: "Unregister unlock method step listener."
---

## offAddUnlockMethod

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

### Description

Unregister the step listener for unlocking methods

### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `listener` | `(event: StepEvent \| SuccessEvent \| ErrorEvent) => void` | Yes | Same reference as when subscribing |

### Return Value

None


### Referenced Types

##### `interface` StepEvent

| Property | Type | Description |
| --- | --- | --- |
| `type` | `"finger" \| "face" \| "password" \| "card" \| "fingerVein" \| "hand" \| "eye"` |  |
| `lockUserId` | `number` |  |
| `stage` | `"step"` |  |
| `step` | `number` |  |
| `total` | `number` |  |

##### `interface` SuccessEvent

| Property | Type | Description |
| --- | --- | --- |
| `type` | `"finger" \| "face" \| "password" \| "card" \| "fingerVein" \| "hand" \| "eye"` |  |
| `id` | `number` |  |
| `name` | `string` |  |
| `stage` | `"success"` |  |

##### `interface` ErrorEvent

| Property | Type | Description |
| --- | --- | --- |
| `type` | `"finger" \| "face" \| "password" \| "card" \| "fingerVein" \| "hand" \| "eye"` |  |
| `lockUserId` | `number` |  |
| `stage` | `"fail"` |  |
| `error` | `ErrorData` |  |

##### `type` UnlockMethodType

Unlock method business type literal

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

##### `type` ErrorData

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `number` | Error code |
| `errorMsg` | `string` | Error message (mostly in English) |


### Examples

#### Example

```ts
import { offAddUnlockMethod } from '@ray-js/lock-sdk';
offAddUnlockMethod((event) => {
  console.log(event);
});
```
