---
name: "openPanel"
mode: "kit"
versionRequirements:
  - { name: "BizKit", version: "3.0.0" }
  - { name: "@ray-js/ray", version: "0.3.23" }
platform:
  - "iOS"
  - "Android"
async: true
---

## openPanel

> [VERSION] BizKit >= 3.0.0 | @ray-js/ray >= 0.3.23

> [PLATFORM] iOS, Android

> ⚡ **Supports Promise** — Returns a Promise when success / fail / complete callbacks are omitted.

### Description

Open a panel, regardless of whether it’s an RN panel or a panel miniapp

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `deviceId` | `string` | Yes | - | `3.0.0` | Device info ID |
| `extraInfo` | `PanelExtraParams` | No | - | `3.0.0` | Additional panel info When navigating to a secondary panel, the extra information that must be provided |
| `initialProps` | `Record<string, Record<string, any>>` | No | - | `3.0.0` | Panel launch parameters carrying business data |
| `complete` | `() => void` | No | - | - | Completion callback (executed on both success and failure) |
| `success` | `() => void` | No | - | - | Callback on successful API call |
| `fail` | `(params: Object) => void` ↓see below | No | - | - | Failure callback |

#### fail callback parameters

| Property | Type | Description |
| --- | --- | --- |
| `errorMsg` | `string` | Error message |
| `errorCode` | `string \| number` | Error code |
| `innerError` | `Object` | Error extension |

##### fail(params).innerError properties

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `string \| number` | Error extension code |
| `errorMsg` | `string` | Error extension message |


### Referenced Types

##### `interface` PanelExtraParams

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `productId` | `string` | `3.0.0` | Product ID |
| `productVersion` | `string` | `3.0.0` | Product version |
| `i18nTime` | `string` | `3.0.0` | Panel i18n timestamp |
| `bizClientId` | `string` | `3.0.0` | Container ID May be the value of uiid or miniAppId |
| `uiType` | `string` | `3.0.0` | Package type RN RN type SMART_MINIPG Mini App type |
| `uiPhase` | `string` | `3.0.0` | Package release status |


### Examples

#### Demo

```tsx
import { openPanel } from '@ray-js/ray'

openPanel({
  deviceId: "xx",
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});
```
