You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/runtime-configuration-api.md
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,11 +17,10 @@ Before starting this how-to, make sure you have completed the following prerequi
17
17
18
18
## Set Up the Extension Structure
19
19
20
-
Create a menu that will display the runtime constants in the `loaded` method in the main entry point (`src/main/index.ts`). This can be done by following the steps in [Create a Menu Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu-api/).
20
+
Set up the extension structure by following the steps below:
21
21
22
-
In the example below, you create one menu item that will show a message box with the runtime constants from the active configuration.
23
-
24
-
Replace your `src/main/index.ts` file with the following:
22
+
1. Create a menu that will display the runtime constants in the `loaded` method in the main entry point (`src/main/index.ts`). This can be done by following the steps in [Create a Menu Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu-api/).
23
+
2. Replace your `src/main/index.ts` file with the following:
In this example, you create one menu item that will show a message box with the runtime constants from the active configuration.
72
+
72
73
The code uses the:
73
74
74
75
*`menuApi` from `studioPro.ui.extensionsMenu` to allow you to use the menu API
@@ -79,15 +80,15 @@ The code uses the:
79
80
{{% /alert %}}
80
81
81
82
The `getConstants()` function returns an array of constant objects, each with the following properties:
82
-
* isPrivate — a boolean indicating whether the constant value is hidden (true) or accessible (false)
83
-
* constantName — the fully qualified name of the constant (e.g., `MyModule.MyConstant`)
84
-
* value — the constant value as a string (only present when isPrivate is false)
83
+
*`isPrivate` – a boolean indicating whether the constant value is hidden (true) or accessible (false)
84
+
*`constantName` – the fully qualified name of the constant (for example, `MyModule.MyConstant`)
85
+
*`value` – the constant value as a string (only present when `isPrivate` is false)
85
86
86
87
## Accessing Private Constants
87
88
88
-
By default, private constants are not accessible and will have isPrivate set to true with no value. To access private constant values, your extension must request the runtime-configuration-private permission.
89
+
By default, private constants are not accessible and will have `isPrivate` set to true with no value. To access private constant values, your extension must request the `runtime-configuration-private` permission.
89
90
90
-
Add the permission to your extension's package.json after the entrypoints:
91
+
Add the permission to your extension's `package.json` after the entry points:
91
92
92
93
```json
93
94
{
@@ -106,11 +107,11 @@ Add the permission to your extension's package.json after the entrypoints:
106
107
107
108
```
108
109
109
-
You have to set the permission to true if you want the permission to appear in the Overview Pane.
110
+
You have to set the permission to true if you want the permission to appear in the Extensions Overview pane.
110
111
111
-
When a user installs your extension, they can grant this permission through the Extensions Overview pane(View->Extensions) in Studio Pro. Once granted, private constants will be returned with isPrivate set to false and their value included.
112
+
When a user installs your extension, they can grant this permission through the Extensions Overview pane (**View** > **Extensions**) in Studio Pro. Once granted, private constants will be returned with `isPrivate` set to false and their value included.
112
113
113
-
You can read more about permissions in the [Permission Guide](/apidocs-mxsdk/apidocs/web-extensibility-api-11/extension-permissions/).
114
+
You can read more about permissions in [Extension Permission](/apidocs-mxsdk/apidocs/web-extensibility-api-11/extension-permissions/).
0 commit comments