- Robot JavaScript SDK
- Sobre o SDK de JavaScript do Robô
- Etapas de configuração
Prerequisites and configuration for the Robot JavaScript SDK, including installing the UiPath JavaScript Add-On and granting origin access.
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.
Pré-requisitos
The following prerequisites must be met for automation projects to use the Robot JavaScript SDK:
- Studio e Robot versão 2021.10 ou posterior instalada
- O Add-on UiPath JavaScript instalado na máquina do Robô
Permitindo o acesso
When the UiPath Robot JavaScript Add-On is run, access must be granted for 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 in the following sections.
Caixa de diálogo Acesso do navegador
Essa etapa se refere ao navegador que solicita permissões para abrir o UiPath Assistant.
Caixa de diálogo aceitando automaticamente o acesso do navegador
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.
Com base no navegador usado, é preciso definir diferentes configurações. Por exemplo, se você estiver usando o Google Chrome, siga as etapas descritas na documentação URLAllowList do Google Chrome.
Caixa de diálogo Consentimento do robô
A caixa de diálogo Consentimento do Robot é usada para permitir a conexão entre o Robot JavaScript SDK e o Executor do Robô.
Caixa de diálogo Aceitando automaticamente o consentimento do Robot
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).
O SDK de JavaScript do Robô
Esse SDK fornece todos os métodos e propriedades necessários, que você poderá incluir em seu aplicativo personalizado ou página da web. Faça o download da seguinte maneira:
NPM
The npm package is available with TypeScript bindings. To include it in your project:
-
Run the following command at the root of your project directory:
npm install --save @uipath/robotnpm install --save @uipath/robot
CDN
For CDN:
-
Add the following script tag 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
Download the Robot JavaScript SDK via direct download.
Configurações de Add-on
To configure add-on settings:
- Open the
uipath.configfile in the installation folder. - Add the
ListenerPortandTokenExpiryInDaysparameters to the<robotJsSettings>section. By default, the section does not contain any keys:
<robotJsSettings>
<add key="ListenerPort" value="2323" />
<add key="TokenExpiryInDays" value="30" />
</robotJsSettings>
<robotJsSettings>
<add key="ListenerPort" value="2323" />
<add key="TokenExpiryInDays" value="30" />
</robotJsSettings>
| Atributo | 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. The port value must match the one configured in the SDK Settings. |
TokenExpiryInDays | Qualquer solicitação proveniente de um novo domínio precisa ter consentimento do usuário para permitir o acesso do UiPath Robots a partir de um aplicativo web. Esses consentimentos são válidos para o referido número de dias mencionados nesta configuração. |
- Pré-requisitos
- Permitindo o acesso
- Caixa de diálogo Acesso do navegador
- Caixa de diálogo aceitando automaticamente o acesso do navegador
- Caixa de diálogo Consentimento do robô
- Caixa de diálogo Aceitando automaticamente o consentimento do Robot
- O SDK de JavaScript do Robô
- NPM
- CDN
- Download Direto
- Configurações de Add-on