@askly/widget 2.3.0 → 2.3.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 +24 -35
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,51 +15,38 @@ Askly is an **embeddable AI support chat widget** for React and plain HTML. Drop
|
|
|
15
15
|
- 📚 **RAG (docs-grounded)** — replies grounded in your own documentation, not hallucinated.
|
|
16
16
|
- 🎙️ **Voice chat** — customers can talk to the assistant, not just type.
|
|
17
17
|
- 🙋 **Human handoff** — one-click escalation to a live agent when needed.
|
|
18
|
-
- ⚛️ **React + CDN** — use as an npm module or a single `<script>` tag.
|
|
18
|
+
- ⚛️ **React + CDN** — use as an npm module, or a single `<script>` tag on any site (no React required).
|
|
19
19
|
- 🎨 **Fully themeable** — colors, logo, position, and copy configured in the portal.
|
|
20
20
|
|
|
21
21
|
## Installation
|
|
22
22
|
|
|
23
|
-
###
|
|
24
|
-
```bash
|
|
25
|
-
npm install @askly/widget
|
|
26
|
-
```
|
|
23
|
+
### Script tag (any website)
|
|
27
24
|
|
|
28
|
-
|
|
29
|
-
Include the UMD build directly in your HTML:
|
|
30
|
-
```html
|
|
31
|
-
<!-- React Dependencies -->
|
|
32
|
-
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
|
|
33
|
-
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
|
|
25
|
+
One line, before `</body>`. The bundle is self-contained — no React or other dependencies on your page:
|
|
34
26
|
|
|
35
|
-
|
|
36
|
-
<script src="https://unpkg.com/@askly/widget@latest/dist/
|
|
27
|
+
```html
|
|
28
|
+
<script src="https://unpkg.com/@askly/widget@latest/dist/widget.js" data-app-id="YOUR_APP_ID" async></script>
|
|
37
29
|
```
|
|
38
30
|
|
|
39
|
-
|
|
31
|
+
That's the whole install. Your branding — name, logo, theme, welcome message — loads automatically from your Askly portal settings.
|
|
40
32
|
|
|
41
|
-
|
|
33
|
+
### NPM (React / bundlers)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install @askly/widget
|
|
37
|
+
```
|
|
42
38
|
|
|
43
39
|
```javascript
|
|
44
40
|
import Askly from '@askly/widget';
|
|
45
41
|
|
|
46
|
-
Askly.init({
|
|
42
|
+
Askly.init({ appId: "YOUR_APP_ID" });
|
|
47
43
|
```
|
|
48
44
|
|
|
49
|
-
|
|
50
|
-
```html
|
|
51
|
-
<script>
|
|
52
|
-
Askly.init({ widgetId: "your-widget-id" });
|
|
53
|
-
</script>
|
|
54
|
-
```
|
|
45
|
+
The npm builds (`index.esm.js` / `index.umd.js`) treat React as a peer dependency, so your bundle isn't double-shipping it.
|
|
55
46
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
src="https://unpkg.com/@askly/widget@latest/dist/index.umd.js"
|
|
60
|
-
data-widget-id="your-widget-id"
|
|
61
|
-
></script>
|
|
62
|
-
```
|
|
47
|
+
## Quick Start
|
|
48
|
+
|
|
49
|
+
All you need is your `appId` — copy it from **Widget → Install Code** in your Askly tenant portal. Everything else (name, theme, logo, welcome message, voice, etc.) is configured there and loaded automatically; the init props below are optional overrides.
|
|
63
50
|
|
|
64
51
|
> The widget talks to Askly's hosted backend automatically — there is nothing else to configure.
|
|
65
52
|
|
|
@@ -69,11 +56,13 @@ The `Askly.init()` method accepts an object with the following configuration opt
|
|
|
69
56
|
|
|
70
57
|
| Option | Type | Required | Default | Description |
|
|
71
58
|
| :--- | :--- | :--- | :--- | :--- |
|
|
72
|
-
| `
|
|
59
|
+
| `appId` | `string` | **Yes** | - | Your app ID, from the tenant portal's **Widget → Install Code** screen. Script tag: `data-app-id`. |
|
|
60
|
+
|
|
61
|
+
> `widgetId` and `orgId` are still accepted as deprecated aliases for `appId`, so existing embeds keep working.
|
|
73
62
|
|
|
74
63
|
### Configured in the portal
|
|
75
64
|
|
|
76
|
-
The widget's appearance and behaviour — display name, logo, theme color, welcome message, position, voice, sounds, timestamps, "powered by" text, and so on — are set on the **Widget
|
|
65
|
+
The widget's appearance and behaviour — display name, logo, theme color, welcome message, position, voice, sounds, timestamps, "powered by" text, and so on — are set on the **Widget** screen in your Askly portal and loaded automatically by `appId`. Logos are uploaded right there and apply instantly. **You do not pass these in code.** (They remain accepted as optional `init()` overrides for advanced cases, but the portal is the source of truth.)
|
|
77
66
|
|
|
78
67
|
### Identifying an authenticated user
|
|
79
68
|
|
|
@@ -151,10 +140,10 @@ Control where the widget appears using URL **path prefixes** (matched against `w
|
|
|
151
140
|
|
|
152
141
|
```javascript
|
|
153
142
|
// Show ONLY on support & docs pages
|
|
154
|
-
Askly.init({
|
|
143
|
+
Askly.init({ appId: "YOUR_APP_ID", includePaths: ["/support", "/docs"] });
|
|
155
144
|
|
|
156
145
|
// Show everywhere EXCEPT admin & checkout
|
|
157
|
-
Askly.init({
|
|
146
|
+
Askly.init({ appId: "YOUR_APP_ID", excludePaths: ["/admin", "/checkout"] });
|
|
158
147
|
```
|
|
159
148
|
|
|
160
149
|
Via script tag, use comma-separated values: `data-include-paths="/support,/docs"` or `data-exclude-paths="/admin,/checkout"`.
|
|
@@ -172,7 +161,7 @@ Callbacks are functions, so they can only be attached in code (not from the port
|
|
|
172
161
|
|
|
173
162
|
```javascript
|
|
174
163
|
Askly.init({
|
|
175
|
-
|
|
164
|
+
appId: "YOUR_APP_ID",
|
|
176
165
|
onMessageSent: (message) => console.log("Sent:", message),
|
|
177
166
|
onMessageReceived: (reply) => console.log("Received:", reply),
|
|
178
167
|
onChatOpened: () => console.log("Opened"),
|
|
@@ -183,7 +172,7 @@ Askly.init({
|
|
|
183
172
|
|
|
184
173
|
## Backend Integration
|
|
185
174
|
|
|
186
|
-
None required. The widget talks to Askly's hosted backend automatically — you only provide
|
|
175
|
+
None required. The widget talks to Askly's hosted backend automatically — you only provide an `appId`.
|
|
187
176
|
|
|
188
177
|
## Development
|
|
189
178
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askly/widget",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Embeddable AI support chat widget for React — drop-in customer support chatbot with voice, RAG (docs-grounded) answers, and human handoff. One line to install.",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|