bstp-agent-widget 0.2.5 → 0.2.6
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 +13 -7
- package/dist/agent-widget.js +1440 -1437
- package/dist/agent-widget.js.map +1 -1
- package/package.json +7 -5
- package/src/lib/index.d.ts +42 -19
package/README.md
CHANGED
|
@@ -60,21 +60,27 @@ export function Page() {
|
|
|
60
60
|
- `react` and `react-dom` are defined as `peerDependencies`.
|
|
61
61
|
- Library outputs are generated under `dist/`.
|
|
62
62
|
|
|
63
|
-
## Angular Integration
|
|
63
|
+
## Angular Integration (Step by Step)
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
1. Build the npm package in this repository:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
npm
|
|
68
|
+
bun run build:lib && npm pack
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
2. Install the generated tarball in your Angular app:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm i /path/to/bstp-agent-widget-0.2.5.tgz
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
3. Add widget stylesheet once in Angular global styles (`src/styles.scss`):
|
|
72
78
|
|
|
73
79
|
```scss
|
|
74
80
|
@import 'bstp-agent-widget/style.css';
|
|
75
81
|
```
|
|
76
82
|
|
|
77
|
-
|
|
83
|
+
4. Mount the widget from an Angular component:
|
|
78
84
|
|
|
79
85
|
```ts
|
|
80
86
|
import { AfterViewInit, Component, ElementRef, OnDestroy, ViewChild } from '@angular/core';
|
|
@@ -95,7 +101,7 @@ export class AgentChatWidgetComponent implements AfterViewInit, OnDestroy {
|
|
|
95
101
|
customerToken: 'jwt-token',
|
|
96
102
|
language: 'en-US',
|
|
97
103
|
},
|
|
98
|
-
// Optional:
|
|
104
|
+
// Optional. Default: /environment.json
|
|
99
105
|
// environmentUrl: '/environment.json',
|
|
100
106
|
});
|
|
101
107
|
}
|
|
@@ -106,7 +112,7 @@ export class AgentChatWidgetComponent implements AfterViewInit, OnDestroy {
|
|
|
106
112
|
}
|
|
107
113
|
```
|
|
108
114
|
|
|
109
|
-
|
|
115
|
+
5. Provide `genai.config` in Angular app `public/environment.json`:
|
|
110
116
|
|
|
111
117
|
```json
|
|
112
118
|
{
|