Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions samples/asset-by-name-app/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
VITE_UIPATH_BASE_URL=https://cloud.uipath.com
VITE_UIPATH_ORG_NAME=your-organization
VITE_UIPATH_TENANT_NAME=your-tenant
VITE_UIPATH_CLIENT_ID=your-oauth-client-id
VITE_UIPATH_REDIRECT_URI=http://localhost:5173
VITE_UIPATH_SCOPE=offline_access OR.Assets OR.Folders OR.Execution OR.Jobs
5 changes: 5 additions & 0 deletions samples/asset-by-name-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
.env
.env.local
.env.*.local
33 changes: 33 additions & 0 deletions samples/asset-by-name-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Asset getByName Demo

Minimal React + Vite app that demonstrates `assets.getByName()` from the UiPath TypeScript SDK.

After OAuth login, the app:

1. Lists all assets visible to the user across folders (via `assets.getAll()`).
2. Lets the user click a row to prefill the form below.
3. Resolves a single asset by **name + folderPath** via `assets.getByName()` and renders the raw JSON response.

## Setup

1. Register a **Non-Confidential External Application** in UiPath Admin with scopes `OR.Assets OR.Folders offline_access` and redirect URI `http://localhost:5173`.
2. Copy `.env.example` to `.env.local` and fill in your Client ID / org / tenant.
3. Install and run:

```bash
npm install
npm run dev
```

Open http://localhost:5173.

## What this demonstrates

```typescript
import { Assets } from '@uipath/uipath-typescript/assets';

const assets = new Assets(sdk);

// Folder path is sent as X-UIPATH-FolderPath header; server resolves the folder.
const asset = await assets.getByName('ApiKey', { folderPath: 'Shared/Finance' });
```
15 changes: 15 additions & 0 deletions samples/asset-by-name-app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Demo: simulates jamjam's injection. SDK picks this up as the default
folderKey when callers don't pass folderPath/folderKey at call site. -->
<meta name="uipath:folder-key" content="5de8ef41-6ea5-4620-a47f-f66f0119398f" />
<title>Asset getByName Demo</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading