@askly/widget 1.1.0 → 1.1.2

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.
Files changed (2) hide show
  1. package/README.md +20 -39
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -45,7 +45,7 @@ Alternatively, initialize automatically via a single script tag:
45
45
  ></script>
46
46
  ```
47
47
 
48
- > The widget talks to Askly's hosted backend (`https://api.askly.co.in`) automatically. You only need to set `orgServerRoute` if you self-host the backend or are developing locally.
48
+ > The widget talks to Askly's hosted backend automatically — there is nothing else to configure.
49
49
 
50
50
  ## Configuration
51
51
 
@@ -53,34 +53,30 @@ 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
- | `organizationName` | `string` | No | `"Askly"` | Name displayed in the header. |
59
- | `themeColor` | `string` | No | `"#0f172a"` | Theme color (Slate 900). |
60
- | `organizationLogo` | `string` | No | - | URL of the logo image. |
61
- | `position` | `"left" \| "right"` | No | `"right"` | Screen placement. |
62
- | `welcomeMessage` | `string` | No | `"Hi! How can I help you today?"` | Initial greeting message. |
63
- | `placeholderText` | `string` | No | `"Type your message..."` | Input placeholder. |
64
- | `enableVoiceChat` | `boolean` | No | `false` | Enable Web Speech input/output. |
65
- | `showTimestamp` | `boolean` | No | `false` | Display timestamps in chat. |
66
- | `soundEnabled` | `boolean` | No | `false` | Play synthesized audio alerts. |
67
- | `soundVolume` | `number` | No | `0.4` | Sound volume (0.0 to 1.0). |
68
- | `autoOpen` | `boolean` | No | `false` | Open chat on page load. |
69
- | `poweredBy` | `string` | No | `"Team Askly"` | Branding attribution. |
70
- | `userId` | `string` | No | - | Authenticated user ID. |
71
- | `timestamp` | `number` | No | - | Request signature timestamp. |
72
- | `signature` | `string` | No | - | HMAC request signature. |
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
+
58
+ ### Configured in the portal
59
+
60
+ 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.)
61
+
62
+ ### Identifying an authenticated user
63
+
64
+ 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.
65
+
66
+ | Option | Type | Description |
67
+ | :--- | :--- | :--- |
68
+ | `userId` | `string` | Authenticated user ID. |
69
+ | `timestamp` | `number` | Signature timestamp. |
70
+ | `signature` | `string` | HMAC request signature. |
71
+ | `excludePaths` | `string[]` | URL path prefixes where the widget should not render. |
75
72
 
76
73
  ## Lifecycle Callbacks
77
74
 
78
- Attach listeners to widget events:
75
+ Callbacks are functions, so they can only be attached in code (not from the portal):
79
76
 
80
77
  ```javascript
81
78
  Askly.init({
82
- orgId: "your-org-id",
83
- orgServerRoute: "https://your-backend.com/api/chat",
79
+ widgetId: "your-widget-id",
84
80
  onMessageSent: (message) => console.log("Sent:", message),
85
81
  onMessageReceived: (reply) => console.log("Received:", reply),
86
82
  onChatOpened: () => console.log("Opened"),
@@ -91,22 +87,7 @@ Askly.init({
91
87
 
92
88
  ## Backend Integration
93
89
 
94
- Your `orgServerRoute` endpoint must accept a `POST` request with the following JSON body:
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
- ```
90
+ None required. The widget talks to Askly's hosted backend automatically — you only provide a `widgetId`.
110
91
 
111
92
  ## Development
112
93
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askly/widget",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
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",