robot
2024.10
true
  • Robot JavaScript SDK
    • About the Robot JavaScript SDK
    • Configuration Steps
UiPath logo, featuring letters U and I in white

Robot developer guide

Last updated Dec 18, 2024

Configuration Steps

Prerequisites

In order for your automation projects to benefit from the Robot JavaScript SDK, the following prerequisites need to be met:

  • 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 have to be confirmed in order to run RobotJS. They can be automated 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

It can be automated by adding the uipath-web://* value as a trusted (allowed) URL in the browser's settings. 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 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, you need to execute the following command at the root of your project directory:

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

CDN

For CDN, you need to include the SDK before closing the </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

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

The configuration file needs to 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>

Attribute

Description

ListenerPort

The 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. Please note that the port value here needs to match the one configured in the SDK Settings.

TokenExpiryInDays

Any 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?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.