# Public coded apps

> Deploy a coded app that people outside your organization can use without signing in, through a solution. Public coded apps are in preview.

:::important
Public coded apps are in preview and are available only for coded apps that are deployed through [Solutions](https://docs.uipath.com/studio-web/automation-cloud/latest/user-guide/creating-solutions).
:::

## Overview

A public coded app is a coded app that anyone with its link can use without signing in to UiPath Automation Cloud.
A public coded app calls UiPath services as a [confidential external application](https://docs.uipath.com/automation-cloud/automation-cloud/latest/admin-guide/authorizing-external-applications#app-types) of your organization, and only for the [resources it declares](#supported-resources).

:::warning
* Anyone with the link can use the app. Never collect or show sensitive data, such as Social Security numbers or billing information.
* Visitor identity is not available to the app, so it cannot use features that depend on the current user.
:::

## Prerequisites

* An Organization Administrator has created a confidential external application with application scopes for everything the app calls, for example `DataFabric.Data.Read` and `DataFabric.Data.Write` for an app that adds Data Fabric records, and has shared its client secret with you. For the steps, refer to [Adding an external application](https://docs.uipath.com/automation-cloud/automation-cloud/latest/admin-guide/managing-external-applications#adding-an-external-application).
* Permission to deploy solutions in the target folder.

## Supported resources

| Resource | What a visitor can do |
| --- | --- |
| [Processes](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/about-processes) | Start a job and read its output. |
| [Data Fabric entities](https://docs.uipath.com/data-service/automation-cloud/latest/user-guide/introduction) | Add records and read records. |
| [Storage buckets](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/about-storage-buckets) | Upload files. |

A public coded app supports only these operations. If your app needs an operation that is not listed, such as updating entity records or reading files from a storage bucket, create a process that performs it and start that process from the app. The process can be of any type, for example an RPA workflow, an API workflow, or a function.

### Access modes

The app developer decides how visitors can read each resource the app uses, and sets one of two access modes:

* **Session**: a visitor can read only the data they added in their own session.
* **All**: the data in the declared resource is shared with every visitor. This is the default.

:::note
A visitor is identified by their browser session. Opening the app in another browser or a private window, or clearing cookies, starts a new session, and a new session cannot read what an earlier session added.
:::

To set the modes, refer to the [SDK documentation](https://uipath.github.io/uipath-typescript/coded-apps/getting-started/#who-can-read-what).

## Steps

### Developing the app

1. Build the app with the UiPath TypeScript SDK (`@uipath/uipath-typescript` 1.8.5 or later), and declare the resources it uses. For details, refer to [Public coded apps](https://uipath.github.io/uipath-typescript/coded-apps/getting-started/#public-coded-apps-preview) in the SDK documentation.
2. Add the confidential external application to the project's `.env.local` file.
3. Start the dev server with the [`@uipath/coded-apps-dev`](https://uipath.github.io/uipath-typescript/coded-apps/getting-started/#running-it-locally) plugin (1.0.0 or later) to run the app locally as a public app.

The app opens without a sign-in and follows the same access rules as after you deploy, while the client secret stays on your machine.

:::tip
If you use an AI coding agent, install the UiPath Coded Apps skill for it: `npx skills add UiPath/skills --skill uipath-coded-apps`. Public coded apps need the UiPath skills (`@uipath/skills`) 1.207.0 or later. Until 1.207.0 is released, use the preview: `npm install @uipath/skills@preview`.
:::

### Publishing the solution

Add the app to a solution, and publish the solution from Studio Web, or with the UiPath CLI 1.206.0 or later (`npm install -g @uipath/cli`). For the CLI steps, refer to [`uip solution pack`](https://docs.uipath.com/uipath-cli/standalone/latest/user-guide/uip-solution-pack) and [`uip solution publish`](https://docs.uipath.com/uipath-cli/standalone/latest/user-guide/uip-solution-publish).

### Deploying the app from Studio Web

1. In Studio Web, open the solution, and then select **Deploy**.
2. Fill in the **Version**, **Deployment name**, **Location**, and **Solution folder name**.
3. Select the dropdown arrow on the **Deploy** button, and then select **Customize**.
4. In the coded app's settings, set:
   * **Routing name**: the last part of the app's URL. For example, `feedback` opens the app at `https://<orgName>.uipath.host/feedback`.
   * **Authentication**: select **Public**. The default, **User sign-in**, deploys the app as a regular coded app that visitors must sign in to.
   * **External application**: select the confidential external application from the [Prerequisites](#prerequisites). The list shows confidential external applications only after you set **Authentication** to **Public**.
   * **Client secret**: the external application's client secret, from the Organization Administrator who created it.
5. Select **Validate**.
6. Select **Continue**.

For the full deployment flow, refer to [Publishing and deploying solutions](https://docs.uipath.com/studio-web/automation-cloud/latest/user-guide/publishing-and-deploying-solutions) in the Studio Web guide.

### Deploying the app from the UiPath CLI

Set the following values in the solution's deployment configuration, and then deploy the solution:

* `routingName`: the same value as **Routing name** in Studio Web.
* `runtimeAuthMode`: `application`, the CLI name for **Public** authentication.
* `externalClientId`: the confidential external application, the same as **External application** in Studio Web.
* `clientSecret`: the external application's client secret.

For the commands, refer to [Deploy with a solution](https://uipath.github.io/uipath-typescript/coded-apps/cli-reference/#deploy-with-a-solution) in the SDK documentation.

### Giving the external application access

The deployment does not give the external application a role. After the first deployment, an administrator assigns one in the folder the deployment created:

1. In Orchestrator, go to **Tenant** > **Folders** and select the deployment folder.
2. Select **Assign accounts/group/external app**, and search for the external application.
3. Select a role that covers the resources the app uses, for example **Automation User**. For Data Fabric entities, the role needs **View** and **Create** on entity records.
4. Select **Assign**.

For details, refer to [Assigning external apps to a folder](https://docs.uipath.com/automation-cloud/automation-cloud/latest/admin-guide/configuring-access-for-external-apps#assigning-external-apps-to-a-folder).

### Verifying the app

Open `https://<orgName>.uipath.host/<routingName>` in a private browser window. The app and its operations work without requiring a user sign-in.

## Maintaining the app

* **Upgrade**: publish a new solution version and upgrade the deployment. The client secret and the scope bound to it are kept. To apply a changed `scope` from the app's `uipath.json`, enter the client secret again when you upgrade: in Studio Web, in the coded app's **Client secret** setting under **Customize**; with the UiPath CLI, by setting `clientSecret` again.
* **Rotate the client secret**:
  1. In the deployment folder, go to **Automations** > **Apps**.
  2. Open the app's menu, and select **Edit app details**.
  3. In **External App Secret**, enter the new secret.
  4. Select **Edit**.

  The secret is checked against the external application before it is saved.

## Best practices

### Dos

* Give the external application only the scopes and folder roles the app needs.
* Deploy each public app in its own folder, so its role covers only that app's resources.
* Set **Session** on every resource that holds personal data.
* Treat anything a visitor sends as untrusted, and check it in the process the app starts.
* Use field-level access in Data Fabric to hide the fields the app must not read.

### Don'ts

* Don't return secrets in a job's output. The visitor's browser receives the output, so keep secrets inside the process the app starts, such as a function or an API workflow, and return only what the visitor may see.
* Don't put keys or credentials in the app. Everything in the app's build output is public.
* Don't rely on the app's screens to hide data. What a visitor can read is decided by the resource's **Session** or **All** setting, not by what the app shows.

## Limitations

* Public coded apps are available only in Automation Cloud. They are not available in Automation Cloud Dedicated, Automation Cloud Public Sector, or Automation Suite.
* Public coded apps are available only through Solutions. A public coded app can access only the resources bound to it in its solution, so a coded app deployed on its own, outside a solution, cannot be public.
* Data Fabric entities must be folder-scoped. Tenant-level entities are not supported.
* Coded action apps cannot be public.
* The [Trusted public apps](https://docs.uipath.com/automation-cloud/automation-cloud/latest/admin-guide/trusted-public-apps) list does not apply to public coded apps. If your organization restricts access by IP address, visitors outside the allowed ranges cannot use the app.
