---
name: "SmartDevicesManager.getDevices"
mode: "api"
versionRequirements:
  - { name: "@ray-js/panel-sdk", version: "1.16.0" }
title: "getDevices"
---

## SmartDevicesManager.getDevices

> [VERSION] @ray-js/panel-sdk >= 1.16.0

### Description

Get a shallow copy of all registered device instances, indexed by key. Commonly used when you need to operate on instances directly instead of via Hooks, e.g., iterating all devices inside an event callback.

### Parameters

None


### Return Value

Type: `Record<string, SmartDeviceModel>`

Record object of all device instances

### Examples

#### Get the device instance collection

```ts
const instances = manager.getDevices();
Object.values(instances).forEach(device => {
  device.publishDps({ switch_led: true });
});
```
