startAddUnlockMethod(params: StartAddUnlockMethodParams)

Requires:
@ray-js/lock-sdk≥1.0.0

Description

Start adding an unlock method

Parameters

ParameterTypeRequiredDescription
YesEnrollment parameters (userId: user ID, timeout: timeout (ms))

Return Value

Type: Promise<StartAddUnlockMethodResult>
None (resolves after the process ends)
StartAddUnlockMethodResult
PropertyTypeDescription
totalnumberTotal number of steps

Error Code

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

Valid Values

StartAddUnlockMethodParams.type
ValueDescriptionSince
finger--
face--
password--
card--
fingerVein--
hand--
eye--

Examples

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