@helpai/elements 1.11.0 → 1.12.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/docs/analytics.md +6 -1
- package/docs/api-reference.md +2 -2
- package/docs/events-and-hooks.md +1 -1
- package/docs/installation.md +4 -4
- package/docs/security-privacy.md +7 -4
- package/elements-web-component.esm.js +39 -35
- package/elements-web-component.esm.js.map +4 -4
- package/elements.cjs.js +39 -35
- package/elements.cjs.js.map +4 -4
- package/elements.esm.js +40 -36
- package/elements.esm.js.map +4 -4
- package/elements.js +38 -34
- package/elements.js.map +4 -4
- package/index.mjs +4 -3
- package/llms-full.txt +161 -153
- package/llms.txt +19 -19
- package/package.json +3 -3
- package/react.mjs +31 -30
- package/web-component.mjs +4 -3
package/docs/analytics.md
CHANGED
|
@@ -28,8 +28,13 @@ internal event bus, and you subscribe as many listeners as you want.
|
|
|
28
28
|
<!-- 2. Load the widget -->
|
|
29
29
|
<script src="https://cdn.help.ai/sdk/js/elements/latest/elements.js" data-public-key="agent_pk_..." data-ai-agent-deployment-id="01900000-0000-7000-8000-000000000000" defer></script>
|
|
30
30
|
|
|
31
|
-
<!-- 3. Subscribe to every widget event with one wildcard hook -->
|
|
31
|
+
<!-- 3. Subscribe to every widget event with one wildcard hook. The stub queues the call until the deferred script runs. -->
|
|
32
32
|
<script>
|
|
33
|
+
window.HelpAI =
|
|
34
|
+
window.HelpAI ||
|
|
35
|
+
function () {
|
|
36
|
+
(HelpAI.q = HelpAI.q || []).push(arguments);
|
|
37
|
+
};
|
|
33
38
|
HelpAI('hook', 'default', '*', (chat, event, payload) => {
|
|
34
39
|
gtag('event', `chat_${event}`, flatten(payload));
|
|
35
40
|
});
|
package/docs/api-reference.md
CHANGED
|
@@ -478,8 +478,8 @@ The auto-boot parser exposes the documented flat `data-*` subset.
|
|
|
478
478
|
|
|
479
479
|
Full attribute list: [Installation § script data attributes](./installation.md#attributes).
|
|
480
480
|
|
|
481
|
-
`data-
|
|
482
|
-
|
|
481
|
+
Leave out `data-ai-agent-deployment-id` to load the bundle without mounting, then call
|
|
482
|
+
`HelpAI.init({ … })` from JavaScript ([Installation § Load without mounting](./installation.md#load-without-mounting)).
|
|
483
483
|
|
|
484
484
|
---
|
|
485
485
|
|
package/docs/events-and-hooks.md
CHANGED
|
@@ -22,7 +22,7 @@ Both deliver the same event stream. Both are safe to mix.
|
|
|
22
22
|
| ----------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
23
23
|
| `open` | Panel opens (floating mode) | `void` |
|
|
24
24
|
| `close` | Panel closes | `void` |
|
|
25
|
-
| `message` | User sends a message
|
|
25
|
+
| `message` | User sends a message, or a reply from the AI agent or a team member finishes | `{ role: "user" \| "assistant" \| "operator"; text: string }` |
|
|
26
26
|
| `error` | Transport error or mid-stream error | `unknown` (error object or message) |
|
|
27
27
|
| `expand` | Expanded tier toggled (⤢) | `boolean` (new state) |
|
|
28
28
|
| `fullscreen` | Fullscreen tier toggled (⛶) | `boolean` (new state) |
|
package/docs/installation.md
CHANGED
|
@@ -100,13 +100,13 @@ Unknown attributes are ignored. Full option semantics:
|
|
|
100
100
|
> one re-handshakes with the same anonymous visitor/conversation. This
|
|
101
101
|
> context is informational for the AI, never an auth credential.
|
|
102
102
|
|
|
103
|
-
###
|
|
103
|
+
### Load without mounting
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
The script tag mounts the widget only when it carries `data-ai-agent-deployment-id`. Leave that attribute out to
|
|
106
|
+
load the bundle **without** mounting, then call `init()` from JavaScript when you're ready:
|
|
107
107
|
|
|
108
108
|
```html
|
|
109
|
-
<script src="https://cdn.help.ai/sdk/js/elements/latest/elements.js"
|
|
109
|
+
<script src="https://cdn.help.ai/sdk/js/elements/latest/elements.js"></script>
|
|
110
110
|
<script>
|
|
111
111
|
// Mount later, conditionally
|
|
112
112
|
document.addEventListener('DOMContentLoaded', () => {
|
package/docs/security-privacy.md
CHANGED
|
@@ -487,10 +487,13 @@ and anyone can base64url-decode it. Never put a secret in context.
|
|
|
487
487
|
|
|
488
488
|
### Key rotation
|
|
489
489
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
- **
|
|
493
|
-
|
|
490
|
+
The dashboard has no key rotation today.
|
|
491
|
+
|
|
492
|
+
- **public key** — public by design: it only names the deployment. Limit where it works with the deployment's
|
|
493
|
+
**Allowed websites**.
|
|
494
|
+
- **secret key** — keep it on your server. If it leaks, create a new deployment (it gets new keys), move your embed
|
|
495
|
+
and your token signing to it, and delete the old one. User tokens signed with the old key stop verifying, so every
|
|
496
|
+
verified user is signed out until your server signs new ones.
|
|
494
497
|
|
|
495
498
|
---
|
|
496
499
|
|