## ty.panel.initPanelKit

Initialize basic panel capabilities

1. Initializes the basic capabilities of device panels. For example, register listeners of [device](/en/miniapp/develop/ray/api/device-info/info/registerDeviceListListener) or [device group](/en/miniapp/develop/ray/api/group/common/control/registerGroupChange) events. Without special requirements, you do not need to call the methods `ty.device.registerDeviceListListener` or `ty.device.registerGroupChange` in the business logic. For example, these methods are not needed if you do not require listeners for changes in data point (DP) status and details of other devices.
2. Creates listeners for devices of going online or offline. If a device goes offline, a dialog box appears to show this event. Without special business requirements, you do not need to additionally develop the respective dialog box and business logic.

**Type**

<Alert type="info">
  Either `deviceId or `groupId` must be provided.
</Alert>

```typescript
type PanelKitInitConfig = {
  /**
   * @description The device ID.
   */
  deviceId?: string;
  /**
   * @description The device group ID.
   */
  groupId?: string;

  /**
   * @description Whether to use the default offline popup
   * @default true
   */
  useDefaultOffline: boolean;
  /**
   * Whether Bluetooth toast needs to cover the interface
   * @default false
   * @version 2.10.4
   */
  bleCover?: boolean;

  /**
   * @description After customizing the navigation bar, you need to configure the height
   * @default 0
   * @version 2.10.4
   */
  customTop?: string;

  /**
   * @description Whether to display a Bluetooth connection status prompt
   *
   * @default true
   * @version 2.10.4
   */
  showBLEToast?: boolean;

  /**
   * @description Bluetooth connection type. 0: Both the gateway and the app are required. The default value is that both the local and gateway channels are valid. 1: Only the app determines whether the local is online and whether the local connection is successful. 2: only the gateway is connected, and whether the gateway connection is successful
   * @default 0
   */
  bleConnectType?: number;
};
```

**Request parameters**

| Parameter | Data type            | Description                                                 | Required |
| :-------- | :------------------- | :---------------------------------------------------------- | :------- |
| config    | `PanelKitInitConfig` | Initializes the configurations of basic panel capabilities. | Yes      |

**Return parameters**

None.

**Sample request**

```typescript
ty.panel.initPanelKit({ deviceId: 'vdev1234567' });
```

**Sample response**

None.

**Things to note**

If you do not require custom multilingual settings for devices of getting offline, the following JSON settings are recommended. Specifically, you can go to [Tuya Developer Platform > App > Multi-language](https://iot.tuya.com/exp/i18n/multilingual) or [App Language](https://iot.tuya.com/exp/i18n/appLangs), and configure desired multilingual settings.

```json
{
  "en": {
    "openBle": "Enable System Bluetooth",
    "openBleShare": "Enable Bluetooth Sharing",
    "openBleShareStep": "Settings > Find Your App > Enable Bluetooth Sharing",
    "deviceOfflineHelpNew": "① Make sure that the device is powered on or that the battery capacity is sufficient.\n② Place the mobile phone as close as possible to the device.\n③ If the device has been connected to another mobile phone, close the connection and try to ",
    "offline_link": "reconnect the router.",
    "backToHome": "Homepage",
    "checkHelp": "View Help",
    "offline_alreadyOffline": "Offline Device",
    "offline_pleaseCheck": "Check the following items:",
    "offline_linkFront": "3. Whether the name or password of the router is modified. You can try to ",
    "offline_moreHelp": "More Help",
    "offline_textLinkMore": "",
    "bluetoothShareTip": "Limited functionality, please turn on \"Bluetooth Sharing\"",
    "bluetoothOfflineTip": "Enable Bluetooth on your mobile phone.",
    "deviceOffline": "Device Connection Failure"
  }
}
```
