UiPath Documentation
robot
2024.10
false
Robot developer guide
  • Robot JavaScript SDK
    • About the Robot JavaScript SDK
    • Configuration Steps

Configuration Steps

Prerequisites and configuration for using the Robot JavaScript SDK, including the UiPath JavaScript Add-On installation and browser access settings.

This page covers the prerequisites and configuration for using the Robot JavaScript SDK in custom web applications, including setting up browser and Robot consent access, installing the SDK, and configuring the JavaScript Add-On.

Prerequisites

The following prerequisites must be met for automation projects to use the Robot JavaScript SDK:

  • Studio and Robot version 2021.10 or greater installed
  • The UiPath JavaScript Add-On installed on the Robot machine

Allowing access

When the UiPath Robot JavaScript Add-On is run, you need to provide access to your custom application or web page to connect to the Robot.

The access is handled by a two-step dialog. Both steps must be confirmed to run RobotJS. Both dialogs support automation as described below.

Browser access dialog

This step refers to the browser requesting permissions to open the UiPath Assistant.

Automatically accepting the browser access dialog

The uipath-web://* value, added as a trusted URL in the browser's settings, automates this dialog. The uipath-web://* refers to the UiPath Robot web protocol handler.

Note:

Based on the browser used, different settings need to be configured. For example, if you are using Google Chrome, follow the steps described in the Google Chrome URLAllowlist documentation.

The robot consent dialog is used to allow the connection between the Robot JavaScript SDK and the Robot Executor.

The UIPATH_ROBOTJS_ALLOWLIST System Environment Variable automatically accepts the robot consent dialog.

The variable value must contain the URLs of your custom application or web page, separated by semicolons. The URL should contain the port number only if a standard port is not used (80 or 443).

The Robot JavaScript SDK

This SDK provides all the necessary methods and properties you can include in your custom application or web page. You can download it as follows:

NPM

The npm package is available with TypeScript bindings. To include it in your project, execute the following command at the root of your project directory:

npm install --save @uipath/robot
npm install --save @uipath/robot

CDN

For CDN, include the SDK before the closing </body> tag:

<body>
...
...
<script href="//download.uipath.com/js/1.3.2/UiPathRobot.js"></script>
</body>
<body>
...
...
<script href="//download.uipath.com/js/1.3.2/UiPathRobot.js"></script>
</body>

Direct download

You can also grab the Robot JavaScript SDK via direct download.

Add-on settings

To change add-on settings, add the ListenerPort and TokenExpiryInDays parameters to the uipath.config file in the installation folder. By default, the section does not contain any keys.

The configuration file must contain the following:

<robotJsSettings>
    <add key="ListenerPort" value="2323" />
    <add key="TokenExpiryInDays" value="30" />
</robotJsSettings>
<robotJsSettings>
    <add key="ListenerPort" value="2323" />
    <add key="TokenExpiryInDays" value="30" />
</robotJsSettings>
AttributeDescription
ListenerPortThe UiPath.RobotJS.ServiceHost.exe starts a HttpListener on the configured port and contains the information about other local listeners from the active user session on that system. The port value must match the one configured in the SDK Settings.
TokenExpiryInDaysAny request coming from a new domain needs to have consent from the user to allow access of UiPath Robots from a web application. These consents are valid for the said number of days mentioned in this setting.

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated