---
name: "connectDevice"
mode: "api"
versionRequirements:
  - { name: "@ray-js/lock-sdk", version: "1.0.0" }
title: "connectDevice - Connect to the device proactively."
summary: "Wakes the device when supported, then connects via Bluetooth when applicable; resolves to whether connection succeeded."
---

## connectDevice

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

### Description

Initiate the near-field/LAN device connection flow.

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `options` | `ConnectDeviceOptions` | No | Connection options (timeout: connection timeout in milliseconds, default 15000) |

### Return Value

Type: `Promise<true>`

Connection result (implementation-defined)

### Referenced Types

##### `interface` ConnectDeviceOptions

| Property | Type | Description |
| --- | --- | --- |
| `timeout` | `number` | Connection timeout (ms), default 15000; typically 10000 in accessory scenarios |


### Examples

```ts
import { connectDevice } from '@ray-js/lock-sdk';
await connectDevice();
// Custom timeout
await connectDevice({ timeout: 10000 });
```
