@vamlabs/vam-chatbot 0.1.83 → 0.1.84-dev.201.1
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 +18 -2
- package/dist/web-component.js +3336 -2
- package/package.json +3 -3
- package/dist/web-component.js.LICENSE.txt +0 -41
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
## Steps to use the VAM Chatbot
|
|
2
2
|
|
|
3
3
|
1. **Import the Package:**
|
|
4
|
-
|
|
5
4
|
- To import the VAM chatbot package, add the following `<script>` tag to the `<head>` section of your root HTML file. This will load the package from our CDN:
|
|
6
5
|
```html
|
|
7
6
|
<script src="https://cdn.jsdelivr.net/npm/@vamlabs/vam-chatbot/dist/web-component.min.js"></script>
|
|
@@ -23,6 +22,7 @@
|
|
|
23
22
|
></vam-chatbot>
|
|
24
23
|
```
|
|
25
24
|
- Inline layout reserves its page space immediately at `100%` width with a default height of `640px`, then keeps that footprint while loading, ready, or temporarily unavailable. Use CSS variables and exposed shadow parts for customization. Scope inline-only overrides with `[layout="inline"]`:
|
|
25
|
+
|
|
26
26
|
```css
|
|
27
27
|
vam-chatbot[layout="inline"].my-inline-chatbot {
|
|
28
28
|
--chatbot-inline-height: 720px;
|
|
@@ -43,7 +43,10 @@
|
|
|
43
43
|
- For public embeds where your backend allows unauthenticated session minting, this can be omitted.
|
|
44
44
|
- Static token via attribute:
|
|
45
45
|
```html
|
|
46
|
-
<vam-chatbot
|
|
46
|
+
<vam-chatbot
|
|
47
|
+
client-id="<your-client-id>"
|
|
48
|
+
auth-token="<id-token>"
|
|
49
|
+
></vam-chatbot>
|
|
47
50
|
```
|
|
48
51
|
- Recommended (fresh token per request) via JS property:
|
|
49
52
|
```html
|
|
@@ -59,6 +62,19 @@ These steps will help you integrate the VAM chatbot into your webpage seamlessly
|
|
|
59
62
|
|
|
60
63
|
## Notes
|
|
61
64
|
|
|
65
|
+
- Conversation feedback is opened deliberately with **End chat** after a completed answer, when `external_redirect_metadata.internal_feedback` is configured. It no longer opens on an inactivity timer. Minimizing the floating widget preserves the conversation.
|
|
66
|
+
- Source labels use matching promoted-topic titles when available, otherwise readable URL slugs. Tracking parameters are removed from source and promoted links; functional parameters and anchors are preserved. Promoted buttons are shown only when their normalized URL matches a source for that answer.
|
|
67
|
+
- While a request runs, the composer allows an unsent draft and shows a compact Replying chip inside the input row. Sending is blocked until the reply completes or fails; the draft is preserved and is never submitted automatically. Suggested questions collapse on submission and their expanded list scrolls within a bounded height.
|
|
68
|
+
- Before streaming starts, a quiet, unboxed shimmer cycles through waiting phrases every 4.5 seconds. Only the Brentford and Brentford Analytics client IDs use the 16 playful football phrases, covering VAR, formations, warm-ups and matchday moments; all other clients, including unknown IDs, use generic copy. These are metaphors, not live match updates or backend progress reports. Reduced motion keeps the first phrase still; screen readers receive stable request-state announcements instead of repeated rotating copy. Styling hooks include `response-status`, `response-status-text`, and `reply-status`.
|
|
69
|
+
|
|
70
|
+
## Run the React demo locally
|
|
71
|
+
|
|
72
|
+
From the repository root, run `npm run dev`, then open `http://localhost:3000/demo/brentford`. Use `localhost` for backend session routing; `127.0.0.1` is a different origin. To test production, provide `REACT_APP_CHATBOT_MODE=production` and `REACT_APP_CHATBOT_PROD_URL` through your local environment. These settings select the configuration service; its response supplies the chat endpoint.
|
|
73
|
+
|
|
74
|
+
The standalone package and root demo must resolve the same React instance when both have dependencies installed. Otherwise React reports an invalid hook call. Run package tests with the package's locked dependencies (`npm ci --prefix src/packages/chatbot --legacy-peer-deps`, then `npm test --prefix src/packages/chatbot -- --ci`).
|
|
75
|
+
|
|
76
|
+
## Integration notes
|
|
77
|
+
|
|
62
78
|
- The widget uses a 2-step chat flow (`POST /chat/session` then streamed `POST /chat/stream`) and requires your site origin to be allowlisted for your tenant.
|
|
63
79
|
- If configured, `authTokenProvider` is called before each message stream starts so expiring tokens can be refreshed on-demand.
|
|
64
80
|
- Missing or invalid `layout` values default to the existing floating layout.
|