This repository can be used as a starting point for developing custom widgets for UiPath Assistant. The project is a Web Component library that contains the implementation of a sample widget.
- Run
npm i
. For npm 7 or higher, use the--legacy-peer-deps
flag. npm run watch
. This will rebuild the widget every time a project file is saved.- Find the
UiPathAssistant
folder in your UiPathStudio
/Robot
install location. - Close the Assistant if it is opened.
- Provide the path to your widget
.js
output to Assistant by runningUiPath.Assistant.exe
with the--dbg
and--dev-widget
flags (e.g.UiPath.Assistant.exe --dbg --dev-widget=C:\Users\...\Desktop\assistant-plugin-creator\dist\sample-widget\bundles\sample-widget.umd.js
; The path may not contain spaces). - You should see a new Assistant red tab that hosts your main widget component. The tab is always visible in dev mode, even if enabling
isTabHidden
. - You may open dev tools via
Ctrl+Shift+I
. - By default, the Assistant will read the sibling
sample-widget.umd.js.map
source map file and allow typescript debugging.
@uipath/widget.sdk
exports reusable APIs (via the WidgetApi
object) for interacting with Assistant.
When creating widgets at runtime, UiPath Assistant, is looking for a MainComponent
(for each widget). Make sure you add them to projects\sample-widget\src\public-api.ts
.
To force a package into the final bundle, add it to the bundledDependencies
array in projects/sample-widget/package.json
. You should do this for any runtime dependency.
Starting with Assistant 21.4.x, i18n is supported via ngx-translate. WidgetApi.translate
can be used to translate the keys found in projects/sample-widge/src/lib/i18n
.
- Run
ng build --prod
- The output is
dist\sample-widget\bundles\sample-widget.umd.js
(or the minified version) - Rename the output file. Each unpacked widget is uniquely identified by the file name.
Assistant widgets can be bundled into nuget packges that can be published to nuget feeds and then installed into Assistant. To bundle a widget, simply build the widget, write the appropriate metadata to the widget.nuspec
file and run npm run pack
. If not running on Windows, you need a .NET compiler (such as Mono) to run nuget.exe.
Please check out the official docs for Assistant Widgets.
The changelog for @uipath/widget.sdk
can be found here.
You can use the contents of this repository/package subject to your license agreement with UiPath for the UiPath Platform.