@helpai/elements 1.8.0 → 1.10.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/llms.txt ADDED
@@ -0,0 +1,37 @@
1
+ # Help AI Elements
2
+
3
+ > Help AI's AI chat widget for any website: an AI agent that answers visitors from the customer's own help content, can hand the chat to a person, and shows Help articles and News. Install it with one script tag, the `<web-ai-chat>` element, the npm API or the React kit. These docs match @helpai/elements@1.10.0.
4
+
5
+ What a coding agent needs to install it right the first time:
6
+
7
+ - Two values come from the deployment's Install page in the Help AI dashboard: the public key (`agent_pk_…`) and the AI agent deployment id (a UUID). Both belong in browser code. The deployment's secret key never does.
8
+ - Plain HTML, WordPress or any CMS: `<script src="https://cdn.help.ai/sdk/js/elements/1.10.0/elements.js" data-public-key="agent_pk_…" data-ai-agent-deployment-id="…" defer></script>`.
9
+ - React, Next.js, Remix: install `@helpai/elements` and render `<HelpAI publicKey="…" aiAgentDeploymentId="…" />` from `@helpai/elements/react` once, in the root layout. `useHelpAI()` in any component returns `{ state, ask, open, close, reset }`. It is server-render safe; import everything from `@helpai/elements/react`.
10
+ - Vue, Svelte, Angular and other bundlers: `import '@helpai/elements/web-component'`, then `<web-ai-chat public-key="…" ai-agent-deployment-id="…"></web-ai-chat>`. JSX typings: `@helpai/elements/jsx/react`, `/jsx/vue`, `/jsx/svelte`.
11
+ - Site buttons need no JavaScript: `data-helpai-ask="Which plan fits a team of 10?"` puts the question in the chat, `data-helpai-open="help"` opens a tab (`home`, `chats`, `help`, `news`). In code, `ask(text)` fills the composer and sends only with `{ send: true }`.
12
+ - Logged-in users: your server signs a JWT with the deployment's secret key (HS256; `sub` = your user id, `exp`; optional `name`, `email`), and the widget gets a function that fetches it: `userToken` at init, `login(fn)` after sign-in, `reset()` at sign-out. Their chats then follow them to any device. Never sign tokens in the browser.
13
+ - `theme: 'host'` (`theme="host"`) follows the site's own light/dark switch.
14
+ - Pin the exact version in production, as above; `latest` changes under you.
15
+ - It works when the launcher shows in the bottom corner and `HelpAI.ready()` (or `chat.ready`) resolves.
16
+
17
+ ## Docs
18
+
19
+ - [Quickstart](https://cdn.help.ai/sdk/js/elements/1.10.0/docs/quickstart.md): credentials, the install paths and a first check, in five minutes
20
+ - [Installation](https://cdn.help.ai/sdk/js/elements/1.10.0/docs/installation.md): every install path in depth: script tag, async loader, npm, web component, CDN URLs and version pinning
21
+ - [Frameworks](https://cdn.help.ai/sdk/js/elements/1.10.0/docs/frameworks.md): the React kit (`<HelpAI />`, `useHelpAI()`), Next.js, Remix, Vue, Nuxt, Svelte, Astro, Angular, WordPress, Shopify, Webflow
22
+ - [Configuration](https://cdn.help.ai/sdk/js/elements/1.10.0/docs/configuration.md): every option by group, with examples
23
+ - [Option reference](https://cdn.help.ai/sdk/js/elements/1.10.0/docs/options.md): the table of every option, generated from the schemas; authoritative
24
+ - [API reference](https://cdn.help.ai/sdk/js/elements/1.10.0/docs/api-reference.md): exports, instance methods (`ask`, `open`, `state`, `ready`, `reset`, …), the global API, no-script triggers, deep links, JSX typings
25
+ - [Events and hooks](https://cdn.help.ai/sdk/js/elements/1.10.0/docs/events-and-hooks.md): every event and its payload, `on()` and `hook()`
26
+ - [Theming](https://cdn.help.ai/sdk/js/elements/1.10.0/docs/theming.md): colors, shapes, fonts, launcher styles, `theme: "host"` and `::part()` styling
27
+ - [Recipes](https://cdn.help.ai/sdk/js/elements/1.10.0/docs/recipes.md): copy-paste solutions for common integrations
28
+ - [Analytics](https://cdn.help.ai/sdk/js/elements/1.10.0/docs/analytics.md): sending widget activity to Google Analytics, Segment, PostHog and other trackers
29
+ - [Security and privacy](https://cdn.help.ai/sdk/js/elements/1.10.0/docs/security-privacy.md): isolation, CSP, what the widget stores and sends
30
+ - [Browser support](https://cdn.help.ai/sdk/js/elements/1.10.0/docs/browser-support.md): supported browsers and fallbacks
31
+ - [Troubleshooting](https://cdn.help.ai/sdk/js/elements/1.10.0/docs/troubleshooting.md): an install that does not show, connect or answer
32
+ - [FAQ](https://cdn.help.ai/sdk/js/elements/1.10.0/docs/faq.md): short answers to common questions
33
+ - [Overview](https://cdn.help.ai/sdk/js/elements/1.10.0/docs/README.md): the whole SDK on one page
34
+
35
+ ## Optional
36
+
37
+ - [Every doc in one file](https://cdn.help.ai/sdk/js/elements/1.10.0/llms-full.txt): the docs above, concatenated
package/loader.js CHANGED
@@ -1,10 +1,10 @@
1
- // GA-style async loader stub. Template: HelpAI and https://cdn.help.ai/elements/latest/elements.js are
1
+ // GA-style async loader stub. Template: HelpAI and https://cdn.help.ai/sdk/js/elements/latest/elements.js are
2
2
  // Substituted at build time (see scripts/build-brand.mjs).
3
3
  //
4
4
  // Usage:
5
5
  //
6
6
  // <script>
7
- // !function(w,d){w.HelpAI=w.HelpAI||function(){(w.HelpAI.q=w.HelpAI.q||[]).push(arguments)};var s=d.createElement("script");s.async=1;s.src="https://cdn.help.ai/elements/latest/elements.js";d.head.appendChild(s)}(window,document);
7
+ // !function(w,d){w.HelpAI=w.HelpAI||function(){(w.HelpAI.q=w.HelpAI.q||[]).push(arguments)};var s=d.createElement("script");s.async=1;s.src="https://cdn.help.ai/sdk/js/elements/latest/elements.js";d.head.appendChild(s)}(window,document);
8
8
  // HelpAI('init', { publicKey: 'agent_pk_xxxx', aiAgentDeploymentId: '01900000-0000-7000-8000-000000000000' });
9
9
  // </script>
10
10
 
@@ -16,6 +16,6 @@
16
16
  };
17
17
  var s = d.createElement('script');
18
18
  s.async = 1;
19
- s.src = 'https://cdn.help.ai/elements/latest/elements.js';
19
+ s.src = 'https://cdn.help.ai/sdk/js/elements/latest/elements.js';
20
20
  d.head.appendChild(s);
21
21
  })(window, document);
package/loader.min.js CHANGED
@@ -1 +1 @@
1
- (function(e,t){e.HelpAI=e.HelpAI||function(){(e.HelpAI.q=e.HelpAI.q||[]).push(arguments)};var n=t.createElement("script");n.async=1,n.src="https://cdn.help.ai/elements/latest/elements.js",t.head.appendChild(n)})(window,document);
1
+ (function(e,s){e.HelpAI=e.HelpAI||function(){(e.HelpAI.q=e.HelpAI.q||[]).push(arguments)};var n=s.createElement("script");n.async=1,n.src="https://cdn.help.ai/sdk/js/elements/latest/elements.js",s.head.appendChild(n)})(window,document);
package/package.json CHANGED
@@ -25,6 +25,19 @@
25
25
  "browser": "./elements-web-component.esm.js",
26
26
  "import": "./web-component.mjs",
27
27
  "types": "./web-component.d.ts"
28
+ },
29
+ "./react": {
30
+ "import": "./react.mjs",
31
+ "types": "./react.d.ts"
32
+ },
33
+ "./jsx/react": {
34
+ "types": "./jsx-react.d.ts"
35
+ },
36
+ "./jsx/vue": {
37
+ "types": "./jsx-vue.d.ts"
38
+ },
39
+ "./jsx/svelte": {
40
+ "types": "./jsx-svelte.d.ts"
28
41
  }
29
42
  },
30
43
  "files": [
@@ -38,6 +51,11 @@
38
51
  "configurator.css",
39
52
  "web-component.mjs",
40
53
  "web-component.d.ts",
54
+ "react.mjs",
55
+ "react.d.ts",
56
+ "jsx-react.d.ts",
57
+ "jsx-vue.d.ts",
58
+ "jsx-svelte.d.ts",
41
59
  "elements.js",
42
60
  "elements.js.map",
43
61
  "elements.esm.js",
@@ -50,6 +68,9 @@
50
68
  "loader.min.js",
51
69
  "style.css",
52
70
  "README.md",
71
+ "llms.txt",
72
+ "llms-full.txt",
73
+ "docs",
53
74
  "LICENSE",
54
75
  "LICENSE-OPENUI",
55
76
  "NOTICE"
@@ -73,6 +94,20 @@
73
94
  "main": "./elements.cjs.js",
74
95
  "module": "./index.mjs",
75
96
  "name": "@helpai/elements",
97
+ "dependencies": {
98
+ "@preact/signals": "^2.11.3",
99
+ "preact": "^11.0.2",
100
+ "streaming-markdown": "^0.2.15",
101
+ "zod": "^4.6.7"
102
+ },
103
+ "peerDependencies": {
104
+ "react": ">=18"
105
+ },
106
+ "peerDependenciesMeta": {
107
+ "react": {
108
+ "optional": true
109
+ }
110
+ },
76
111
  "publishConfig": {
77
112
  "access": "public"
78
113
  },
@@ -82,5 +117,5 @@
82
117
  ],
83
118
  "type": "module",
84
119
  "types": "./index.d.ts",
85
- "version": "1.8.0"
120
+ "version": "1.10.0"
86
121
  }