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: articles/api-management/api-management-howto-developer-portal.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ Your API Management service includes a built-in, always up-to-date, **managed**
47
47
In some cases you might need functionality beyond the customization and styling options provided in the managed developer portal. If you need to implement custom logic, which isn't supported out-of-the-box, you have [several options](developer-portal-extend-custom-functionality.md):
48
48
*[Add custom HTML](developer-portal-extend-custom-functionality.md#use-custom-html-code-widget) directly through a developer portal widget designed for small customizations - for example, add HTML for a form or to embed a video player. The custom code is rendered in an inline frame (iframe).
49
49
*[Create and upload a custom widget](developer-portal-extend-custom-functionality.md#create-and-upload-custom-widget) to develop and add more complex custom portal features.
50
-
*[Self-host the portal](developer-portal-self-host.md) by cloning and modifying the portal's codebase, available on [GitHub](https://github.com/Azure/api-management-developer-portal). When you self-host the portal, you have complete flexibility but become its maintainer and you're responsible for its upgrades. Azure Support's assistance is limited only to the basic setup of self-hosted portals.
50
+
*[Self-host the portal](developer-portal-self-host.md), only if you need to make modifications to the core of the developer portal [codebase](https://github.com/Azure/api-management-developer-portal). This option requires advanced configuration. Azure Support's assistance is limited only to the basic setup of self-hosted portals.
51
51
52
52
> [!NOTE]
53
53
> Because the API Management developer portal codebase is maintained on [GitHub](https://github.com/Azure/api-management-developer-portal), you can open issues and make pull requests for the API Management team to merge new functionality at any time.
Copy file name to clipboardExpand all lines: articles/api-management/developer-portal-extend-custom-functionality.md
+32-22Lines changed: 32 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,16 +11,16 @@ ms.topic: how-to
11
11
12
12
# Extend the developer portal with custom features
13
13
14
-
The API Management [developer portal](api-management-howto-developer-portal.md) features a visual editor and built-in widgets so that you can customize and style the portal's appearance. However, you may need to customize the developer portal further with custom functionality. For example, you might want to integrate your developer portal with a support system that involves adding a custom control. This article explains ways to add custom functionality such as custom widgets to your API Management developer portal.
14
+
The API Management [developer portal](api-management-howto-developer-portal.md) features a visual editor and built-in widgets so that you can customize and style the portal's appearance. However, you may need to customize the developer portal further with custom functionality. For example, you might want to integrate your developer portal with a support system that involves adding a custom interface. This article explains ways to add custom functionality such as custom widgets to your API Management developer portal.
15
15
16
16
The following table summarizes three options, with links to more detail.
17
17
18
18
19
19
|Method |Description |
20
20
|---------|---------|
21
-
|[Custom HTML code widget](#use-custom-html-code-widget)| - Lightweight solution for API publishers to add custom logic for basic use cases<br/><br/>- Copy and paste custom HTML code into a form, and developer portal renders in an iframe |
22
-
|[Create and upload custom widget](#create-and-upload-custom-widget)| - Developer solution for more advanced widget use cases<br/><br/>- Requires local implementation in React, Vue, or plain TypeScript<br/><br/>- Widget scaffold provided to help developers create widget and upload to developer portal<br/><br/>- Supports workflows for source control, versioning, and code reuse<br/><br/> |
23
-
|[Self-host developer portal](developer-portal-self-host.md)| - Legacy extensibility option to customize source code of the entire portal core<br/><br/> - Gives complete flexibility for customizing portal experience<br/><br/>- Customer responsible for managing complete code lifecycle: fork code base, develop, deploy, host, patch, and upgrade |
21
+
|[Custom HTML code widget](#use-custom-html-code-widget)| - Lightweight solution for API publishers to add custom logic for basic use cases<br/><br/>- Copy and paste custom HTML code into a form, and developer portal renders it in an iframe |
22
+
|[Create and upload custom widget](#create-and-upload-custom-widget)| - Developer solution for more advanced widget use cases<br/><br/>- Requires local implementation in React, Vue, or plain TypeScript<br/><br/>- Widget scaffold and tools provided to help developers create widget and upload to developer portal<br/><br/>- Supports workflows for source control, versioning, and code reuse<br/><br/> |
23
+
|[Self-host developer portal](developer-portal-self-host.md)| - Legacy extensibility option for customers who need to customize source code of the entire portal core<br/><br/> - Gives complete flexibility for customizing portal experience<br/><br/>- Requires advanced configuration<br/><br/>- Customer responsible for managing complete code lifecycle: fork code base, develop, deploy, host, patch, and upgrade |
24
24
25
25
26
26
## Use Custom HTML code widget
@@ -50,7 +50,6 @@ The managed developer portal includes a **Custom HTML code** widget where you ca
50
50
51
51
### Prerequisites
52
52
53
-
* Active [developer portal](api-management-howto-developer-portal.md)
* Basic knowledge of programming and web development
56
55
@@ -117,7 +116,7 @@ The managed developer portal includes a **Custom HTML code** widget where you ca
117
116
If prompted, sign in to your Azure account.
118
117
119
118
120
-
The custom widget is now deployed to your developer portal. Using the portal's administrative interface, you can add it on pages in the developer portal and set any custom properties configured in the widget.
119
+
The custom widget is now deployed to your developer portal. Using the portal's administrative interface, you can add it on pages in the developer portal and set values for any custom properties configured in the widget.
121
120
122
121
### Publish the developer portal
123
122
@@ -139,20 +138,20 @@ All templates are based on the TypeScript programming language.
139
138
140
139
The React template contains prepared custom hooks in the `hooks.ts` file and established providers for sharing context through the component tree with dedicated `useSecrets`, `useValues`, and `useEditorValues` hooks.
141
140
142
-
### Using another framework
143
-
144
-
To implement your widget using another JavaScript UI framework and libraries, you need to set up the project yourself with the following guidelines:
145
-
146
-
* In most cases, we recommend that you start from the TypeScript template.
147
-
* Install dependencies as in any other npm project.
148
-
* If your framework of choice isn't compatible with [Vite build tool](https://vitejs.dev/), configure it so that it outputs compiled files to the `./dist` folder. Optionally, redefine where the compiled files are located by providing a relative path as the fourth argument for the [`deployNodeJs`](#azureapi-management-custom-widgets-toolsdeploynodejs) function.
149
-
* For local development, the `config.msapim.json` file must be accessible at the URL `localhost:<port>/config.msapim.json` when the server is running.
141
+
### Use the `@azure/api-management-custom-widgets-tools` package
150
142
143
+
This [npm package](https://www.npmjs.com/package/@azure/api-management-custom-widgets-tools) contains the following functions to help you develop your custom widget and provides features including communication between the developer portal and your widget:
151
144
152
145
153
-
### Use the `@azure/api-management-custom-widgets-tools` package
146
+
|Function |Description |
147
+
|---------|---------|
148
+
|[getValues](#azureapi-management-custom-widgets-toolsgetvalues) | Returns a JSON object containing values set in the widget editor combined with default values |
149
+
|[getEditorValues](#azureapi-management-custom-widgets-toolsgeteditorvalues) | Returns a JSON object containing only values set in the widget editor |
150
+
|[buildOnChange](#azureapi-management-custom-widgets-toolsbuildonchange) | Takes one parameter: a JSON object with updated values; returns a function to update the widget values |
151
+
|[askForSecrets](#azureapi-management-custom-widgets-toolsaskforsecrets) | Returns a JavaScript promise, which after resolution returns a JSON object of data needed to communicate with backend |
152
+
|[deployNodeJs](#azureapi-management-custom-widgets-toolsdeploynodejs) | Deploys widget to blob storage |
153
+
|[getWidgetData](#azureapi-management-custom-widgets-toolsgetwidgetdata) | Returns all data passed to your custom widget from the developer portal<br/><br/>Used internally in templates |
154
154
155
-
This package contains a set of tools to help you develop your custom widget and provides features including communication between the developer portal and your widget.
@@ -219,22 +218,33 @@ This function returns all data passed to your custom widget from the developer p
219
218
220
219
*`instanceId` - ID of this instance of the widget
221
220
222
-
### Add or remove input fields
221
+
### Add or remove custom properties
223
222
224
-
You can further customize every instance of your custom widget through the developer portal editor. By default, four input fields are defined. You can add or remove other input fields as needed.
223
+
Custom properties let you adjust values in the custom widget's code from the administrative user interface of the developer portal, without changing the code or redeploying the custom widget. By default, input fields for four custom properties are defined. You can add or remove other custom properties as needed.
225
224
226
-
To add an input field:
225
+
To add a custom property:
227
226
228
-
1. In the file `src/values.ts`, add to the `Values` type the name of the field and type of the data it will save.
227
+
1. In the file `src/values.ts`, add to the `Values` type the name of the property and type of the data it will save.
229
228
1. In the same file, add a default value for it.
230
229
1. Navigate to the `editor.html` or `editor/index` file (exact location depends on the framework you've chosen) and duplicate an existing input or add one yourself.
231
230
1. Make sure the input field reports the changed value to the `onChange` function, which you can get from `[buildOnChange`](#azureapi-management-custom-widgets-toolsbuildonchange).
232
231
232
+
### (Optional) Use another framework
233
+
234
+
To implement your widget using another JavaScript UI framework and libraries, you need to set up the project yourself with the following guidelines:
235
+
236
+
* In most cases, we recommend that you start from the TypeScript template.
237
+
* Install dependencies as in any other npm project.
238
+
* If your framework of choice isn't compatible with [Vite build tool](https://vitejs.dev/), configure it so that it outputs compiled files to the `./dist` folder. Optionally, redefine where the compiled files are located by providing a relative path as the fourth argument for the [`deployNodeJs`](#azureapi-management-custom-widgets-toolsdeploynodejs) function.
239
+
* For local development, the `config.msapim.json` file must be accessible at the URL `localhost:<port>/config.msapim.json` when the server is running.
240
+
241
+
242
+
233
243
## Next steps
234
244
235
245
Learn more about the developer portal:
236
246
237
247
-[Azure API Management developer portal overview](api-management-howto-developer-portal.md)
-[Scaffolder of a custom widget for developer portal of Azure API Management service](https://www.npmjs.com/package/@azure/api-management-custom-widgets-scaffolder)
250
+
-[Tools for working with custom widgets of developer portal of Azure API Management service](https://www.npmjs.com/package/@azure/api-management-custom-widgets-tools)
Copy file name to clipboardExpand all lines: articles/api-management/developer-portal-faq.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ You have the following options:
23
23
24
24
* For larger customizations, [create and upload](developer-portal-extend-custom-functionality.md#create-and-upload-custom-widget) a custom widget to the managed developer portal.
25
25
26
-
*[Self-host the developer portal](developer-portal-self-host.md)to update and manage the portal codebase yourself.
26
+
*[Self-host the developer portal](developer-portal-self-host.md), only if you need to make modifications to the core of the developer portal codebase.
27
27
28
28
* Open a feature request in the [GitHub repository](https://github.com/Azure/api-management-developer-portal).
0 commit comments