@askly/widget 2.0.0 → 2.0.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 CHANGED
@@ -1,6 +1,22 @@
1
- # Askly Widget SDK
1
+ # Askly — Embeddable AI Support Chat Widget for React
2
2
 
3
- Embeddable AI support chat widget with voice capabilities, RAG integration, and customizable themes.
3
+ [![npm version](https://img.shields.io/npm/v/@askly/widget.svg)](https://www.npmjs.com/package/@askly/widget)
4
+ [![downloads](https://img.shields.io/npm/dm/@askly/widget.svg)](https://www.npmjs.com/package/@askly/widget)
5
+ [![types](https://img.shields.io/npm/types/@askly/widget.svg)](https://www.npmjs.com/package/@askly/widget)
6
+ [![license](https://img.shields.io/npm/l/@askly/widget.svg)](./LICENSE)
7
+
8
+ Askly is an **embeddable AI support chat widget** for React and plain HTML. Drop it into any site to give customers an **AI-powered support chatbot** with voice conversations, RAG answers grounded in your own docs, and one-click handoff to a human agent — installed with a single line.
9
+
10
+ **[🌐 Website & live demo → askly.co.in](https://askly.co.in)**
11
+
12
+ ## Features
13
+
14
+ - 🤖 **AI-powered answers** — resolves customer questions automatically from your knowledge base.
15
+ - 📚 **RAG (docs-grounded)** — replies grounded in your own documentation, not hallucinated.
16
+ - 🎙️ **Voice chat** — customers can talk to the assistant, not just type.
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.
19
+ - 🎨 **Fully themeable** — colors, logo, position, and copy configured in the portal.
4
20
 
5
21
  ## Installation
6
22
 
@@ -68,7 +84,32 @@ Pass these only when you want to tie a conversation to a logged-in user on your
68
84
  | `userId` | `string` | Authenticated user ID. |
69
85
  | `timestamp` | `number` | Signature timestamp. |
70
86
  | `signature` | `string` | HMAC request signature. |
71
- | `excludePaths` | `string[]` | URL path prefixes where the widget should not render. |
87
+
88
+ ### Restricting the widget to certain pages
89
+
90
+ Control where the widget appears using URL **path prefixes** (matched against `window.location.pathname`).
91
+
92
+ | Option | Type | Description |
93
+ | :--- | :--- | :--- |
94
+ | `includePaths` | `string[]` | Allowlist — the widget renders **only** on paths matching one of these prefixes. |
95
+ | `excludePaths` | `string[]` | Blocklist — the widget renders everywhere **except** paths matching one of these prefixes. |
96
+
97
+ ```javascript
98
+ // Show ONLY on support & docs pages
99
+ Askly.init({ widgetId: "your-widget-id", includePaths: ["/support", "/docs"] });
100
+
101
+ // Show everywhere EXCEPT admin & checkout
102
+ Askly.init({ widgetId: "your-widget-id", excludePaths: ["/admin", "/checkout"] });
103
+ ```
104
+
105
+ Via script tag, use comma-separated values: `data-include-paths="/support,/docs"` or `data-exclude-paths="/admin,/checkout"`.
106
+
107
+ Notes:
108
+
109
+ - **`includePaths` wins:** if it's set, `excludePaths` is ignored.
110
+ - **Prefix match**, not exact — `"/docs"` also matches `/docs/getting-started`. No glob/regex.
111
+ - **Optimized:** on non-matching pages the path check runs *before* anything mounts, so there's no DOM node, no React root, and no config network request — the SDK does essentially nothing.
112
+ - The decision is evaluated once at init; it's a UX targeting tool, not a security boundary (the script can still be loaded on any page).
72
113
 
73
114
  ## Lifecycle Callbacks
74
115
 
@@ -99,6 +140,20 @@ npm install
99
140
  npm run build
100
141
  ```
101
142
 
143
+ ## Why Askly?
144
+
145
+ **Is this an AI customer support widget I can embed in React?**
146
+ Yes — Askly is an embeddable AI support chat widget that installs into any React
147
+ app or plain HTML page with a single line, no backend to build.
148
+
149
+ **How does the AI answer questions accurately?**
150
+ Askly uses RAG (retrieval-augmented generation) to ground every reply in your own
151
+ documentation, so answers stay accurate and on-brand instead of hallucinated.
152
+
153
+ **Can customers reach a human?**
154
+ Yes — the widget supports one-click escalation to a live agent via the
155
+ `onEscalation` callback and built-in human handoff.
156
+
102
157
  ## License
103
158
 
104
159
  MIT
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ export interface IconProps extends Omit<React.SVGProps<SVGSVGElement>, "color"> {
3
+ size?: number | string;
4
+ color?: string;
5
+ strokeWidth?: number | string;
6
+ }
7
+ export declare const X: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
8
+ export declare const Minus: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
9
+ export declare const ArrowUp: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
10
+ export declare const Mic: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
11
+ export declare const MicOff: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
12
+ export declare const Home: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
13
+ export declare const MessageSquare: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
14
+ export declare const MessageSquareIcon: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
15
+ export declare const HelpCircle: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
16
+ export declare const Maximize2: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
17
+ export declare const Minimize2: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
18
+ export declare const Paperclip: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
19
+ export declare const Smile: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
20
+ export declare const Search: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
21
+ export declare const ChevronRight: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
22
+ export declare const ChevronLeft: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
23
+ export declare const BookOpen: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
24
+ export declare const AlertCircle: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
25
+ export declare const ChevronDown: ({ size, color, strokeWidth, ...rest }: IconProps) => React.ReactSVGElement;
package/dist/index.d.ts CHANGED
@@ -21,6 +21,7 @@ export interface AsklyConfig {
21
21
  signature?: string;
22
22
  turnstileSiteKey?: string;
23
23
  excludePaths?: string[];
24
+ includePaths?: string[];
24
25
  onMessageSent?: (message: string) => void;
25
26
  onMessageReceived?: (reply: string) => void;
26
27
  onChatOpened?: () => void;