Skip to content

Commit 4e998c2

Browse files
authored
feat(docs): update docs with coded app deployment (#291)
1 parent 64634fa commit 4e998c2

7 files changed

Lines changed: 553 additions & 41 deletions

File tree

docs/FAQ.md

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,16 @@
22

33
## CORS Issues
44

5-
**Problem**: When developing locally and making requests to UiPath APIs, you may encounter CORS (Cross-Origin Resource Sharing) errors. This happens because browsers block requests from your local development server (e.g., `http://localhost:3000`) to external APIs due to same-origin policy restrictions.
5+
**Problem**: Requests to UiPath APIs may be blocked by CORS — both during local development and from deployed app domains.
66

7-
**Solution**: Configure a proxy in your development server to forward API requests and avoid CORS issues.
7+
**Solution**: Use `https://api.uipath.com` as the `baseUrl` in your `uipath.json`.
88

9-
For example, if you are using Vite, you could add the following proxy configuration to your `vite.config.ts`:
10-
11-
```typescript
12-
import { defineConfig } from 'vite'
13-
import react from '@vitejs/plugin-react'
14-
15-
export default defineConfig({
16-
plugins: [react()],
17-
server: {
18-
proxy: {
19-
// Replace '/your-org' with your actual organization/tenant path
20-
'/your-org': {
21-
target: 'https://cloud.uipath.com',
22-
changeOrigin: true,
23-
secure: true,
24-
},
25-
},
26-
},
27-
})
9+
```json
10+
{
11+
"baseUrl": "https://api.uipath.com"
12+
}
2813
```
2914

30-
**Usage**:
31-
- Use `window.location.origin` as your base URL in your application
32-
- Replace `/your-org` with your actual UiPath organization/tenant path
33-
3415
---
3516

3617
## Authentication Errors

docs/authentication.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
# Authentication
22

3-
The SDK supports two authentication methods:
3+
The SDK supports multiple authentication methods depending on your use case.
4+
5+
## Coded Apps
6+
7+
Once your app is deployed as a [Coded App](coded-apps/getting-started.md), the platform injects all configuration automatically at deploy time. You can construct `UiPath` with no arguments — the SDK reads from the injected meta tags:
8+
9+
```typescript
10+
import { UiPath } from '@uipath/uipath-typescript/core';
11+
12+
const sdk = new UiPath();
13+
await sdk.initialize();
14+
```
15+
16+
See [Coded Apps — Getting Started](coded-apps/getting-started.md) for the full setup guide.
17+
18+
---
419

520
## OAuth Authentication (Recommended)
621

@@ -14,20 +29,14 @@ For OAuth, first create a non confidential [External App](https://docs.uipath.co
1429
- **Scopes**: Select permissions you need ([see scopes guide](/uipath-typescript/oauth-scopes))
1530
4. Save and copy the **Client ID**
1631

32+
Add the Client ID and other config to your `uipath.json`. The `@uipath/coded-apps-dev` bundler plugin injects these as meta tags during local development; at deploy time the platform injects them automatically.
33+
34+
With config in place, initialize the SDK with no arguments — it reads everything from the injected meta tags:
1735

1836
```typescript
1937
import { UiPath } from '@uipath/uipath-typescript/core';
2038

21-
const sdk = new UiPath({
22-
baseUrl: 'https://cloud.uipath.com',
23-
orgName: 'your-organization',
24-
tenantName: 'your-tenant',
25-
clientId: 'your-client-id',
26-
redirectUri: 'your-redirect-uri',
27-
scope: 'your-scopes'
28-
});
29-
30-
// IMPORTANT: OAuth requires calling initialize()
39+
const sdk = new UiPath();
3140
await sdk.initialize();
3241
```
3342

@@ -36,7 +45,7 @@ await sdk.initialize();
3645
import { UiPath } from '@uipath/uipath-typescript/core';
3746

3847
const sdk = new UiPath({
39-
baseUrl: 'https://cloud.uipath.com',
48+
baseUrl: 'https://api.uipath.com',
4049
orgName: 'your-organization',
4150
tenantName: 'your-tenant',
4251
secret: 'your-secret' //PAT Token or Bearer Token
@@ -70,7 +79,7 @@ import { UiPath } from '@uipath/uipath-typescript/core';
7079
import { Tasks } from '@uipath/uipath-typescript/tasks';
7180

7281
const sdk = new UiPath({
73-
baseUrl: 'https://cloud.uipath.com',
82+
baseUrl: 'https://api.uipath.com',
7483
orgName: 'your-organization',
7584
tenantName: 'your-tenant',
7685
secret: 'your-secret' //PAT Token or Bearer Token
@@ -87,7 +96,7 @@ import { UiPath } from '@uipath/uipath-typescript/core';
8796
import { Tasks } from '@uipath/uipath-typescript/tasks';
8897

8998
const sdk = new UiPath({
90-
baseUrl: 'https://cloud.uipath.com',
99+
baseUrl: 'https://api.uipath.com',
91100
orgName: 'your-organization',
92101
tenantName: 'your-tenant',
93102
clientId: 'your-client-id',
@@ -161,7 +170,7 @@ useEffect(() => {
161170
Create `.env` file:
162171
```bash
163172
# .env
164-
UIPATH_BASE_URL=https://cloud.uipath.com
173+
UIPATH_BASE_URL=https://api.uipath.com
165174
UIPATH_ORG_NAME=your-organization-name
166175
UIPATH_TENANT_NAME=your-tenant-name
167176
UIPATH_SECRET=your-pat-token

docs/coded-apps/cli-reference.md

Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
# CLI Reference
2+
3+
The `uip` CLI manages the full deployment lifecycle of a coded app.
4+
5+
## Installation
6+
7+
<!-- termynal -->
8+
```bash
9+
npm install -g @uipath/cli
10+
11+
uip tools install codedapp
12+
```
13+
14+
!!! info "Minimum versions"
15+
Coded Apps requires **CLI version >= 0.1.21** and **codedapp tool version >= 0.1.14**.
16+
17+
Check your installed CLI version:
18+
19+
```bash
20+
uip --version
21+
```
22+
23+
Check your installed codedapp tool version:
24+
25+
```bash
26+
uip tools list
27+
```
28+
29+
To update the codedapp tool to the latest version:
30+
31+
```bash
32+
uip tools update
33+
```
34+
35+
---
36+
37+
## login
38+
39+
Authenticate with the UiPath platform.
40+
41+
```
42+
$ uip login [options]
43+
```
44+
45+
| Name | Type | Description | Default |
46+
|------|------|-------------|---------|
47+
| `-f, --file` | string | Path to credentials folder ||
48+
| `--authority` | string | Custom authority URL ||
49+
| `--client-id` | string | Client ID or Application ID ||
50+
| `--client-secret` | string | Client secret or Application secret ||
51+
| `-s, --scope` | string | Custom scopes (space-separated) ||
52+
| `-t, --tenant` | string | Tenant name (non-interactive mode) ||
53+
| `--it, --interactive` | boolean | Interactively select tenant from list ||
54+
55+
**Examples**
56+
57+
<!-- termynal -->
58+
59+
```bash
60+
# Interactive login
61+
$ uip login -it
62+
63+
# Specific tenant
64+
$ uip login --tenant MyTenant
65+
66+
# Check login status
67+
$ uip login status
68+
```
69+
70+
---
71+
72+
## Build app
73+
74+
Before proceeding, make sure you build your coded app using your framework's build command from the root of the project:
75+
76+
```
77+
$ npm run build
78+
```
79+
This will create the `dist` (or build) folder.
80+
81+
## pack
82+
83+
Package a built app into a `.nupkg`.
84+
85+
```
86+
$ uip codedapp pack <dist> [options]
87+
```
88+
89+
| Name | Type | Description | Default |
90+
|------|------|-------------|---------|
91+
| `-n, --name` | string | Package name ||
92+
| `--version` | string | Package version | `1.0.0` |
93+
| `-o, --output` | string | Output directory | `./.uipath` |
94+
| `--author` | string | Package author | `UiPath Developer` |
95+
| `--description` | string | Package description ||
96+
| `--main-file` | string | Main entry file | `index.html` |
97+
| `--content-type` | string | Content type: `webapp`, `library`, or `process` | `webapp` |
98+
| `--dry-run` | boolean | Show what would be packaged without creating it ||
99+
| `--reuse-client` | boolean | Reuse existing clientId from uipath.json ||
100+
| `--base-url` | string | UiPath base URL ||
101+
| `--org-id` | string | Organization ID ||
102+
| `--tenant-id` | string | Tenant ID ||
103+
| `--access-token` | string | Access token ||
104+
105+
!!! info "Angular dist path"
106+
Angular 17+ outputs to `dist/<project-name>/browser/`. Angular 16 and earlier outputs to `dist/<project-name>/`.
107+
108+
**Output**: `.uipath/<name>.<version>.nupkg`
109+
110+
**Examples**
111+
112+
<!-- termynal -->
113+
114+
```bash
115+
$ uip codedapp pack ./dist
116+
117+
$ uip codedapp pack ./dist --name MyApp
118+
119+
$ uip codedapp pack ./dist --name MyApp --version 1.0.0
120+
121+
```
122+
123+
---
124+
125+
## publish
126+
127+
Upload the `.nupkg` to Orchestrator and register it as a coded app version.
128+
129+
```
130+
$ uip codedapp publish [options]
131+
```
132+
133+
| Name | Type | Description | Default |
134+
|------|------|-------------|---------|
135+
| `-n, --name` | string | Package name (non-interactive) ||
136+
| `--version` | string | Package version (requires `--name`) ||
137+
| `-t, --type` | string | App type: `Web` or `Action` | `Web` |
138+
| `--uipath-dir` | string | UiPath directory containing packages | `./.uipath` |
139+
| `--base-url` | string | UiPath base URL ||
140+
| `--org-id` | string | Organization ID ||
141+
| `--tenant-id` | string | Tenant ID ||
142+
| `--tenant-name` | string | Tenant name ||
143+
| `--access-token` | string | Access token ||
144+
145+
**Examples**
146+
147+
<!-- termynal -->
148+
149+
```bash
150+
$ uip codedapp publish
151+
152+
$ uip codedapp publish --name MyApp
153+
154+
$ uip codedapp publish --name MyApp --version 2.0.0
155+
```
156+
157+
---
158+
159+
## deploy
160+
161+
Deploy a published app version to a folder.
162+
163+
```
164+
$ uip codedapp deploy [options]
165+
```
166+
167+
| Name | Type | Description | Default |
168+
|------|------|-------------|---------|
169+
| `-n, --name` | string | App name ||
170+
| `--version` | string | Target a specific published version ||
171+
| `--base-url` | string | UiPath base URL ||
172+
| `--org-id` | string | Organization ID ||
173+
| `--org-name` | string | Organization name ||
174+
| `--tenant-id` | string | Tenant ID ||
175+
| `--folder-key` | string | Folder key ||
176+
| `--access-token` | string | Access token ||
177+
178+
**Examples**
179+
180+
<!-- termynal -->
181+
182+
```bash
183+
$ uip codedapp deploy
184+
185+
$ uip codedapp deploy --name MyApp
186+
```
187+
188+
---
189+
190+
191+
## Upgrading / Deploying new version of a coded app
192+
193+
When updating a deployed app, just repeat the build-pack-publish-deploy cycle with a bumped version:
194+
<!-- termynal -->
195+
```bash
196+
# 1. Rebuild
197+
npm run build
198+
# 2. Pack with new version
199+
uip codedapp pack dist -n my-webapp --version 2.0.0
200+
# 3. Publish
201+
uip codedapp publish
202+
# 4. Deploy (auto-detects upgrade)
203+
uip codedapp deploy
204+
```
205+
206+
## Environment Variables
207+
208+
All flags can be supplied as environment variables (set by `uip login` or manually for CI/CD):
209+
210+
| Variable | Description |
211+
|----------|-------------|
212+
| `UIPATH_URL` | Platform base URL |
213+
| `UIPATH_ORGANIZATION_NAME` | Organization name |
214+
| `UIPATH_ORGANIZATION_ID` | Organization ID |
215+
| `UIPATH_TENANT_NAME` | Tenant name |
216+
| `UIPATH_TENANT_ID` | Tenant ID |
217+
| `UIPATH_ACCESS_TOKEN` | Bearer token (skips interactive login) |
218+
| `UIPATH_REFRESH_TOKEN` | Refresh token |
219+
| `UIPATH_PROJECT_ID` | Studio Web project ID (for push/pull) |
220+
221+
---
222+
223+
## Config Files
224+
225+
| File | Written by | Purpose |
226+
|------|-----------|---------|
227+
| `.uipath/.auth` | `uip login` | Access tokens and org/tenant selection. |
228+
| `.uipath/app.config.json` | `uip codedapp publish` / `uip codedapp deploy` | App `systemName`, `deployVersion`, `deploymentId` for subsequent runs |
229+
| `uipath.json` | developer / `uip codedapp pack` | SDK config — read by `pack` and the `@uipath/coded-apps-dev` dev plugin |

0 commit comments

Comments
 (0)