@telnyx/ai-chat-widget 4.2.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,34 +1,18 @@
1
1
  # AI Widget Setup (local)
2
2
 
3
- This is a simple guide to setup the AI Widget in your project.
3
+ This is a simple guide to run the AI Widget's demo app locally.
4
4
 
5
5
  ## Prerequisites
6
6
 
7
- 1. Node.js
8
- 2. pnpm
7
+ 1. Node.js (see `.nvmrc` at the repo root)
8
+ 2. npm
9
9
 
10
- ### Step 1: Create a new flow at flow.telnyx.com
10
+ ## Setup
11
11
 
12
- 1. Go to [flow.telnyx.com](https://flow.telnyx.com)
13
- 2. Create a new flow
12
+ 1. From the repo root, install dependencies: `npm install`
13
+ 2. Set the widget's `chatAPIUrl` prop to your AIDA support-agent endpoint —
14
+ see the root `README.md` for the full prop reference.
15
+ 3. Build the widget so the demo can resolve it: `npm run build -w packages/ai-chat-widget`
16
+ 4. Run the demo: `npm run dev --workspace=demo`
14
17
 
15
- #### Step 1.1: Setup the flow trigger and response
16
-
17
- 1. Make the request trigger a `GET` request
18
- 2. Make the arguments `question`, `sessionId`, and `userId` as query parameters
19
- 3. Make the response a `stream` response.
20
-
21
- ### Step 2: Setup the flow URL in local ai-widget's code
22
-
23
- 1. Search for `flowBaseUrl` in the code
24
- 2. Replace the value with the flow URL
25
- 3. Replace the URL `api.telnyx.com/v2` with `localhost:5173` or the URL where the ai-widget is hosted
26
-
27
- ### Step 3: Setup the vite proxy with Bearer token
28
-
29
- 1. Replace the Bearer token with the token from the Telnyx portal in the `vite.config.js` file.
30
-
31
- ### Step 4: Run the project
32
-
33
- 1. Install the dependencies using `pnpm install`
34
- 2. Run the project using `pnpm run dev`
18
+ See `apps/demo/.env.example` for the environment variables the demo app reads.