# Building and deploying coded apps

> Build and deploy a coded app in UiPath: what you need before you start, how the app is built in an IDE, and how to publish and deploy it to an Orchestrator folder.

A coded app starts as a web application that a developer writes in their own IDE, and ends as an app your users open from a UiPath URL. This page describes that journey and the deployment steps that take place in UiPath.

The process includes four stages:

1. Defining the app logic in an IDE.
2. Establishing a secure connection to UiPath.
3. Deploying the app to Orchestrator.
4. Accessing the app within the UiPath ecosystem.

![Flow diagram showing the four steps to create, deploy, and access a coded app in UiPath](https://dev-assets.cms.uipath.com/assets/images/apps/CodedAppFlow-04473434.png)

## Before you begin

Make sure the following are in place:

- A local development environment with Node.js 20.x or newer, and npm, used to build the app and install the UiPath tooling. Download the installer from [nodejs.org](https://nodejs.org/en/download), which includes npm. To check what is already installed, run `node -v` and `npm -v`.
- The UiPath CLI, with the `codedapp` tool installed. For installation instructions, see the [UiPath CLI](https://docs.uipath.com/uipath-cli/standalone/latest/user-guide/uip-codedapp) guide.
- An External App ID from an external application registered in your organization. The app uses it to sign users in and to call UiPath services on their behalf. A coded app runs in the browser and cannot store an app secret, so register it as a **Non-confidential application** with user scopes. To register one, see [Adding an external application](https://docs.uipath.com/automation-suite/automation-suite/2.2610/admin-guide/managing-external-applications#adding-an-external-application) in the Automation Suite admin guide.
- Permission to publish packages and deploy apps in the Orchestrator folder you are targeting.

## Build the app

The developer builds the app the same way they would build any web application, in the framework of their choice, such as React, Vue, or Angular. UiPath adds two things to that workflow:

- **A connection to your organization.** A config file at the root of the project identifies your organization, tenant, and External App ID. The base URL (`baseUrl`) in the SDK configuration is the address of your Automation Suite, `https://<FQDN>`, for example `https://automationsuite.mycompany.com`. The UiPath TypeScript SDK reads this configuration, so the app can call UiPath services such as Orchestrator, assets, storage buckets, and processes.
- **A local development setup.** A UiPath plugin for the project's build tool supplies that same configuration while the app runs on the developer's machine, so the app can be tested against a real tenant before it is deployed.

Both are a one-time setup per project. For the full developer setup, including the configuration file, the build tool plugin, and the adjustments the app needs before it is packaged, see [Getting started with Coded Apps](https://uipath.github.io/uipath-typescript/coded-apps/getting-started/) in the SDK documentation.

## Deploy the app

Deployment happens in two parts: the developer packages and publishes the app, then you deploy that package to an Orchestrator folder.

### Package and publish the app

A coded app is published to Orchestrator as a `.nupkg` package, the same package format used for automations.

1. Build the app:

   ```bash
   npm run build
   ```

2. Package the build output:

   ```bash
   uip codedapp pack dist -n <appName> --version 1.0.0
   ```

3. Sign in to your Automation Suite organization, where `<FQDN>` is the address of your Automation Suite, for example `automationsuite.mycompany.com`:

   ```bash
   uip login --authority <FQDN>
   ```

4. Publish the package to a tenant feed, a personal workspace feed, or a folder feed. To choose the feed, see [Package feeds](#package-feeds):

   ```bash
   uip codedapp publish
   ```

5. Deploy the app:

   ```bash
   uip codedapp deploy
   ```

For the full argument list of each command, see [`uip codedapp`](https://docs.uipath.com/uipath-cli/standalone/latest/user-guide/uip-codedapp) in the UiPath CLI guide.

### Publish and deploy the app from Orchestrator

You can publish and deploy the app's NuGet package (.nupkg file) directly from Orchestrator. The NuGet package still needs to be created with the UiPath CLI using the `uip codedapp pack` command.

1. In Orchestrator, open the package feed where you want to publish the app:
   - **Tenant feed**: Go to **Tenant** > **Packages**.
   - **Personal workspace feed**: Select your personal workspace, then go to **Automations** > **My packages**.
   - **Folder feed**: Select a folder that has its own package feed, then go to **Automations** > **Folder packages**.
2. Select **Upload** and upload the `.nupkg` file. This publishes the app in the selected feed. For the detailed procedure, see [Managing packages](https://docs.uipath.com/orchestrator/automation-suite/2.2610/user-guide/managing-packages).
3. Go to the folder where you want to deploy the app, and then go to **Automations** > **Apps**. The feed you published to determines where you can deploy the app:
   - **Tenant feed**: Any folder, except your personal workspace and folders that have their own package feed.
   - **Personal workspace feed**: Your personal workspace only.
   - **Folder feed**: Only the folder that the feed belongs to.
4. Select **Deploy app**, then select your app and its version. For the detailed procedure, see [Managing apps](https://docs.uipath.com/orchestrator/automation-suite/2.2610/user-guide/managing-apps).

After the app is deployed, a popup displays the app URL.

### Deploy the app from Studio Web

If the app is built as a coded app project inside a Studio Web solution, it is packaged and deployed together with that solution rather than on its own. The version of the coded app stays in lockstep with the workflows, agents, and resources it depends on.

1. Build the app locally:

   ```bash
   npm run build
   ```

2. Push the app into the Studio Web project:

   ```bash
   uip codedapp push --project-id <project-id>
   ```

3. In Studio Web, open the solution and select **Deploy**.
4. Set the package version.
5. Choose whether to pack to your personal workspace or to a shared one.
6. Name the deployment.
7. Select the folder.
8. Select **Deploy**.

For the full set of options in the deployment panel, see [Publishing and deploying solutions](https://docs.uipath.com/studio-web/automation-suite/2.2610/user-guide/publishing-and-deploying-solutions) in the Studio Web user guide.

Your app is now available under the `apps.<FQDN>` address of your Automation Suite.

## Package feeds

A published coded app is stored in an Orchestrator package feed, and it can be deployed only into a folder that reads packages from that feed.

- The tenant feed is the default. `uip codedapp publish` uses it unless you choose another feed.
- A folder created with its own package feed reads only from that feed. To deploy an app into such a folder, publish it into the folder's feed with `uip codedapp publish --folder-key <folder-key>` or `--folder-path <folder-path>`.
- A personal workspace has its own feed. Publish with `--personal-workspace` to deploy the app there.

`--folder-key` and `--folder-path` are available in UiPath CLI 1.205.0 and later.

Apps installed as part of a solution need no separate publish. Installing the solution uploads the package into the feed of the folder it installs into.

### Deploying into a folder that has its own feed

In a folder that has its own package feed, the **Deploy app** list shows only the coded apps published into that feed. A coded app published into the tenant feed is not listed there.

A deploy into a folder that reads from a different feed than the one the app was published into is refused. `uip codedapp deploy` reports:

```text
Folder <folder-key> has its own package feed (<feed-id>), but this app was published into the tenant feed. The app would deploy but could not be added to a solution. Re-publish with --folder-key <folder-key> so the package lands in this folder's feed, or deploy into a folder that reads from the tenant feed.
```

UiPath CLI versions earlier than 1.205.0, and direct calls to the Apps API, get the same refusal as error code `1018`, starting with `Package '<name>:<version>' was published into feed <feed-id>, but folder '<folder-name>' reads packages from feed <folder-feed-id>.`

Both commands below take the folder key, which [`uip or folders list --output json`](https://docs.uipath.com/uipath-cli/standalone/latest/user-guide/uip-or-folders) shows. `uip codedapp publish` also accepts `--folder-path <folder-path>` instead.

To deploy the app into the folder:

1. Publish the package into the folder's feed:

   ```bash
   uip codedapp publish --folder-key <folder-key>
   ```

2. Deploy it into the folder:

   ```bash
   uip codedapp deploy --folder-key <folder-key>
   ```

:::note
The package published into the folder's feed is registered as a separate app, with the same name as the app in the tenant feed. An existing deployment stays linked to the app it was deployed from and does not move to the new app.
:::

### External tenant feed

Coded apps work with a tenant feed that an Orchestrator administrator points at an external NuGet server, such as Artifactory, Nexus, or Azure Artifacts. The feed is set up in Orchestrator, as described in [Configuring tenant settings](https://docs.uipath.com/orchestrator/automation-suite/2.2610/user-guide/configuring-tenant-settings-tenant-level).

With **API Key** authentication, Orchestrator sends the key only when it uploads or deletes a package, so the server must allow anonymous reads. If the server requires a sign-in to read packages, set its user name and password under **Authentication** instead. Otherwise publish and deploy fail with `Cannot connect to packages feed, the Deployment Settings may be invalid.`

#### Versions published before the switch to an external feed

Deploying or upgrading to a version published before the switch fails with `Package not found`. Switching the tenant feed from internal to external does not copy packages to the server, so these versions stay listed in Orchestrator but can no longer be downloaded. Publish the versions you need again after the switch.

#### Versions pushed directly to the server

Publishing a version that was pushed directly to the server, for example by a `nuget push` step in a continuous integration (CI) pipeline, fails with `no matching package found in the Orchestrator feed`. Orchestrator does not know the version until it is imported, and uploading the package again from the **Packages** page fails because it already exists.

To use the version:

1. In Orchestrator, go to **Tenant** > **Feeds** > **Feed**.
2. Open the package's menu and import the version:
   - To import the latest version, select **Import latest version**.
   - To import an earlier version, select **View versions**, and then import the version you need.
3. Publish the version. Importing alone does not register the app, so it cannot be deployed until you publish it:

   ```bash
   uip codedapp publish --name <appName> --version <version>
   ```

To avoid the import, publish with `uip codedapp publish` instead of pushing the package to the server.
