---
name: "init"
mode: "api"
versionRequirements:
  - { name: "@ray-js/lock-sdk", version: "1.0.0" }
title: "init - Initialize the SDK."
summary: "Initialize the SDK."
---

## init

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

### Description

Initialize the lock SDK (single‑device main path).

### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `deviceId` | `string` | No | Device ID (optional with devInfo; either one or both) |
| `devInfo` | `any` | No | Device info (including schema, dps, etc.) |
| `strictMode` | `boolean` | No | Whether strict mode: true enables strict DP validation |
| `passwordDigitalBase` | `number` | No | Radix used to display/edit passwords (≤10) |
| `passwordSupportZero` | `boolean` | No | Whether the password allows the digit 0 |
| `supportMultipleFace` | `boolean` | No | Whether multi‑face capability is supported |
| `supportOfflineDps` | `boolean` | No | Whether to enable offline DP sync and other offline tasks |

### Return Value

Type: `Promise<void>`

None

### Error Codes

| Error Code | Error Message |
| --- | --- |
| `1000` | Neither devInfo nor deviceId in the input, and no deviceId in the launch parameters |

### Examples

#### Example

```typescript
import { init, openDoor } from '@ray-js/lock-sdk';
await init({ devInfo: { devId: 'deviceId', productId: 'productId' } });
await openDoor({ open: true });
```
