@askly/widget 1.1.0 → 1.1.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 +20 -38
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,34 +53,31 @@ The `Askly.init()` method accepts an object with the following configuration opt
|
|
|
53
53
|
|
|
54
54
|
| Option | Type | Required | Default | Description |
|
|
55
55
|
| :--- | :--- | :--- | :--- | :--- |
|
|
56
|
-
| `widgetId` | `string` | Yes | - | Your widget ID, from the tenant portal's Widget setup screen. |
|
|
57
|
-
| `orgServerRoute` | `string` | No | `https://api.askly.co.in/api/messages/widget` | Backend override for self-hosted / local dev. |
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
| `
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
| `turnstileSiteKey` | `string` | No | - | Cloudflare Turnstile key. |
|
|
74
|
-
| `excludePaths` | `string[]` | No | `[]` | URL path prefixes to exclude widget. |
|
|
56
|
+
| `widgetId` | `string` | **Yes** | - | Your widget ID, from the tenant portal's Widget setup screen. |
|
|
57
|
+
| `orgServerRoute` | `string` | No | `https://api.askly.co.in/api/messages/widget` | Backend override — only for self-hosted / local dev. |
|
|
58
|
+
|
|
59
|
+
### Configured in the portal
|
|
60
|
+
|
|
61
|
+
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 setup** screen in your Askly portal and loaded automatically by `widgetId`. **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.)
|
|
62
|
+
|
|
63
|
+
### Identifying an authenticated user
|
|
64
|
+
|
|
65
|
+
Pass these only when you want to tie a conversation to a logged-in user on your site. `timestamp` and `signature` are an HMAC generated **on your backend** using your Widget Secret Key — never in browser JS.
|
|
66
|
+
|
|
67
|
+
| Option | Type | Description |
|
|
68
|
+
| :--- | :--- | :--- |
|
|
69
|
+
| `userId` | `string` | Authenticated user ID. |
|
|
70
|
+
| `timestamp` | `number` | Signature timestamp. |
|
|
71
|
+
| `signature` | `string` | HMAC request signature. |
|
|
72
|
+
| `excludePaths` | `string[]` | URL path prefixes where the widget should not render. |
|
|
75
73
|
|
|
76
74
|
## Lifecycle Callbacks
|
|
77
75
|
|
|
78
|
-
|
|
76
|
+
Callbacks are functions, so they can only be attached in code (not from the portal):
|
|
79
77
|
|
|
80
78
|
```javascript
|
|
81
79
|
Askly.init({
|
|
82
|
-
|
|
83
|
-
orgServerRoute: "https://your-backend.com/api/chat",
|
|
80
|
+
widgetId: "your-widget-id",
|
|
84
81
|
onMessageSent: (message) => console.log("Sent:", message),
|
|
85
82
|
onMessageReceived: (reply) => console.log("Received:", reply),
|
|
86
83
|
onChatOpened: () => console.log("Opened"),
|
|
@@ -91,22 +88,7 @@ Askly.init({
|
|
|
91
88
|
|
|
92
89
|
## Backend Integration
|
|
93
90
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
```json
|
|
97
|
-
{
|
|
98
|
-
"message": "User's message",
|
|
99
|
-
"orgId": "your-org-id"
|
|
100
|
-
}
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
The response must return the reply:
|
|
104
|
-
|
|
105
|
-
```json
|
|
106
|
-
{
|
|
107
|
-
"reply": "Agent response text"
|
|
108
|
-
}
|
|
109
|
-
```
|
|
91
|
+
None required. The widget talks to Askly's hosted backend automatically — you only provide a `widgetId`. Set `orgServerRoute` only if you run your own Askly backend.
|
|
110
92
|
|
|
111
93
|
## Development
|
|
112
94
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askly/widget",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Embeddable AI support chat widget with voice capabilities, RAG integration, and extensive customization options.",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|