# Open a gadget 
Supported by Feishu 3.8.0 and later versions.
## Scenario
Open a gadget or a gadget page

## Protocol
`https://applink.feishu.cn/client/mini_program/open`

## Parameter 
Every parameter should be encoded.
| Field         | Required           | Description        | 
| --------- | --------------- | -------   | 
|**appId** |    Yes      | appId of the gadget (which can be accessed in Developer Console > Credentials & Basic Info) | 
|**mode** | PC recommended to fill in | Gadget startup mode on PC. The enum values are:<br>`sidebar-semi`: Open in the sidebar of the chat<br>`appCenter`: Open in Workplace; starting from Feishu 7.0, it will be opened in the tab of the navigation bar.<br>`window`: Open in a separate large window<br>`window-semi`: Open in a separate small window, supported by Feishu 3.33 and later versions <br>  <br> If it is not filled in, it will be opened with `sidebar-semi` first by default. If the `sidebar-semi` mode is not supported, the `window-semi` mode will be opened| 
|**height** | No | Customize window height(only for `window` mode on PC)，supported by Feishu 5.12 and later versions<br>**Minpoint**：480<br>**Maxpoint**：screen height<br>**Default**：height of current Feishu window | 
|**width** | No | Customize window width(only for `window` mode on PC)，supported by Feishu 5.12 and later versions<br>**Minpoint**：640<br>**Maxpoint**：screen width<br>**Default**：width of current Feishu window | 
|**relaunch** | No | Whether to reload the specified page. This parameter takes effect only when the path parameter is passed in applink. The enum values are: <br>`false`: Consistent with [Start scene classification](https://open.feishu.cn/document/uYjL24iN/uMjNzUjLzYzM14yM2MTN#c2bcfa33). If the user has opened the page and parameters with the same path, the original state of the page will be maintained and will not be reloaded; otherwise, the original page stack will be cleared and the specified page will be opened <br>`true`: no matter whether the user opens the page with the same path or not With the parameter, the original page stack will be cleared and the specified page will be opened (same logic as [relaunch](https://open.feishu.cn/document/uYjL24iN/uEDM04SMwQjLxADN)) <BR>**Feishu 5.9 version supports this parameter, the default value is `false `**|
|**path** | No | Page path to be redirected to, which can have parameters appended. You can also use parameters path_android, path_ios, and path_pc to specify a path for different client-sides | 
|**path_android** | No | It is the same as the path parameter and is preferred for Android. If this parameter is not specified, path will be used | 
|**path_ios** | No | It is the same as the path parameter and is preferred for iOS. If this parameter is not specified, path will be used | 
|**path_pc** | No | It is the same as the path parameter and is preferred for PC. If this parameter is not specified, path will be used |  | 
|**min_lk_ver** | No         | Specifies the minimum Feishu version compatible with the AppLink protocol, in the format of x.y.z. If the current Feishu version number is lower than min_lk_ver, a compatibility page will be displayed when the AppLink is opened |  
You can also use parameters min_lk_ver_android, min_lk_ver_ios, and min_lk_ver_pc to specify a Feishu version for different platforms. 

The `path` parameter value can carry the query parameter. For example:
```js
path=pages%2Findex%3Ffoo%3Dbar
// The above value is pages/index?foo=bar after decoded
```
It can be obtained by using [App.onLaunch](https://open.feishu.cn/document/uYjL24iN/uMDNuMDNuMDN) or [tt.getLaunchOptionsSync](https://open.feishu.cn/document/uYjL24iN/uAzM1YjLwMTN24CMzUjN):
```json
{
	"path": "pages/index",
    "query": {
    	"foo": "bar" // The query parameter carried in the path parameter value input when the gadget is started
    },
    "scene": "1000", // Scene value
    "subScene": "",
    "group_id": ""
}
```

## Examples
#### 1. Open a gadget                                            
`https://applink.feishu.cn/client/mini_program/open?appId=1234567890&mode=window`
#### 2. Open a page of the gadget (pages/home)                                     
`https://applink.feishu.cn/client/mini_program/open?appId=1234567890&mode=window&path=pages%2fhome`

#### 3. Open a page of the gadget with a parameter (pages/home?xid=123)
`https://applink.feishu.cn/client/mini_program/open?appId=1234567890&mode=window&path=pages%2fhome%3fxid%3d123`

#### 4. Open a gadget page on PC (pages/pc_home?pid=123), and open a gadget page on other platforms (pages/home?xid=123)
`https://applink.feishu.cn/client/mini_program/open?appId=1234567890&mode=window&path=pages%2fhome%3fxid%3d123&path_pc=pages%2fpc_home%3fpid%3d123`

#### 5. Gadgets can be opened on PC 4.2.0 and above, and a prompt indicating "not supported" is displayed on versions lower than PC 4.2.0
`https://applink.feishu.cn/client/mini_program/open?appId=1234567890&mode=window&min_lk_ver_pc=4.2.0`

