@askly/widget 2.6.1 → 2.7.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/README.md +25 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/widget.d.ts +5 -1
- package/dist/widget.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -140,6 +140,31 @@ instead of calling `identify()` separately:
|
|
|
140
140
|
| `timestamp` | `number` | Signature timestamp. |
|
|
141
141
|
| `signature` | `string` | HMAC request signature (same value as `hash` above). |
|
|
142
142
|
|
|
143
|
+
### Greeting bubble
|
|
144
|
+
|
|
145
|
+
A few seconds after the page loads, the widget shows a short hello next to the launcher —
|
|
146
|
+
*"Hi, I'm Maya from Acme. How can I help?"* — with up to three of your FAQs as one-tap questions.
|
|
147
|
+
Clicking it opens the chat with that line as the first message.
|
|
148
|
+
|
|
149
|
+
Turn it on or off, and set the text and delay, on **Widget → Branding** in the portal. In the text,
|
|
150
|
+
`{ai_name}` and `{organizationName}` are filled in for you; if the AI is not answering, the default
|
|
151
|
+
greeting does not name one. A visitor who dismisses it, or opens the chat, does not see it again
|
|
152
|
+
that session. It is not shown with `autoOpen`.
|
|
153
|
+
|
|
154
|
+
To override per embed:
|
|
155
|
+
|
|
156
|
+
```javascript
|
|
157
|
+
Askly.init({ appId: "YOUR_APP_ID", greeting: false }); // off on this site
|
|
158
|
+
Askly.init({ appId: "YOUR_APP_ID", greeting: { message: "Need a hand?", delayMs: 5000 } });
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
```html
|
|
162
|
+
<script src="…/widget.js" data-app-id="YOUR_APP_ID" data-greeting="false" async></script>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The widget dispatches `askly:greeting:shown`, `askly:greeting:clicked` and
|
|
166
|
+
`askly:greeting:dismissed` on `window` for analytics.
|
|
167
|
+
|
|
143
168
|
### Asking visitors for their email
|
|
144
169
|
|
|
145
170
|
Anonymous visitors can't be replied to once they close the tab — the answer just waits in a widget
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,10 @@ export interface AsklyConfig {
|
|
|
16
16
|
buttonIcon?: string;
|
|
17
17
|
buttonShape?: "round" | "square";
|
|
18
18
|
autoOpen?: boolean;
|
|
19
|
+
greeting?: boolean | {
|
|
20
|
+
message?: string;
|
|
21
|
+
delayMs?: number;
|
|
22
|
+
};
|
|
19
23
|
showTimestamp?: boolean;
|
|
20
24
|
soundEnabled?: boolean;
|
|
21
25
|
soundVolume?: number;
|