ordify-chat-widget 1.0.43 → 1.0.45
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/CHANGELOG.md +11 -0
- package/README.md +17 -13
- package/dist/ordify-chat-widget.standalone.js +208 -59
- package/dist/ordify-chat-widget.standalone.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.0.45] - 2026-05-04
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Widget attachments**: Optional `enableAttachments`, `maxAttachmentSizeMB`, `maxAttachments`, and `allowedAttachmentTypes` on `OrdifyConfig`. When enabled with a **publishable key**, users can attach documents and images (paperclip + drag/drop). Files upload to `POST /widget/attachments` and are sent as `attachments` on chat.
|
|
12
|
+
- **`uploadAttachment` on `useOrdifyChat`**: Programmatic upload using the same auth as the widget.
|
|
13
|
+
- **`Message.attachments`**: User bubbles can show attachment chips; history hydration maps server `attachments` when present.
|
|
14
|
+
|
|
15
|
+
### Notes
|
|
16
|
+
- Embeds using **API key only** cannot use widget upload (picker stays off); use a publishable key for browser uploads.
|
|
17
|
+
- Configure a GCS lifecycle rule on the `widget_attachments/` prefix in your bucket for retention (ops).
|
|
18
|
+
|
|
8
19
|
## [1.0.27] - 2024-12-19
|
|
9
20
|
|
|
10
21
|
### Added
|
package/README.md
CHANGED
|
@@ -16,13 +16,15 @@ Before integrating the chat widget, ensure you have:
|
|
|
16
16
|
|
|
17
17
|
- **Node.js**: 18.0.0 or higher
|
|
18
18
|
- **npm**: 9.0.0 or higher
|
|
19
|
-
- **
|
|
19
|
+
- **Publishable Key (`pk_live_...`)**: Create in Ordify dashboard (Settings → Publishable Keys)
|
|
20
20
|
- **Agent ID**: Found in your agent configuration panel within the Ordify application
|
|
21
21
|
- **React Application**: Compatible with React 18+ and modern build tools
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
> **🚀 Try it live!** Visit [app.ordify.ai/widget-demo](https://app.ordify.ai/widget-demo) to see all chat modes in action.
|
|
25
25
|
|
|
26
|
+
> **Production Security:** Use `publishableKey`/`data-ordify-publishable-key` with allowed origins. Keep account `apiKey` for server-side use only.
|
|
27
|
+
|
|
26
28
|
## ✨ Features
|
|
27
29
|
|
|
28
30
|
- 🚀 **Zero Configuration**: No CSS imports or additional setup required
|
|
@@ -65,7 +67,7 @@ function App() {
|
|
|
65
67
|
return (
|
|
66
68
|
<OrdifyChat
|
|
67
69
|
agentId="your-agent-id"
|
|
68
|
-
|
|
70
|
+
publishableKey="pk_live_..."
|
|
69
71
|
apiBaseUrl="https://r.ordify.ai"
|
|
70
72
|
chatName="AI Assistant"
|
|
71
73
|
buttonText="Chat with us"
|
|
@@ -107,7 +109,7 @@ Load the standalone script from a CDN (use a version number to pin; replace `1.0
|
|
|
107
109
|
<script>
|
|
108
110
|
OrdifyChatWidget.mount(null, {
|
|
109
111
|
agentId: "your-agent-id",
|
|
110
|
-
|
|
112
|
+
publishableKey: "pk_live_...",
|
|
111
113
|
apiBaseUrl: "https://r.ordify.ai",
|
|
112
114
|
mode: "floating",
|
|
113
115
|
position: "bottom-right",
|
|
@@ -123,7 +125,7 @@ Load the standalone script from a CDN (use a version number to pin; replace `1.0
|
|
|
123
125
|
<script>
|
|
124
126
|
OrdifyChatWidget.mount(null, {
|
|
125
127
|
agentId: "your-agent-id",
|
|
126
|
-
|
|
128
|
+
publishableKey: "pk_live_...",
|
|
127
129
|
apiBaseUrl: "https://r.ordify.ai",
|
|
128
130
|
buttonText: "Chat with us"
|
|
129
131
|
});
|
|
@@ -142,7 +144,7 @@ Add a single script tag with `data-ordify-widget` and the required/optional data
|
|
|
142
144
|
src="https://unpkg.com/ordify-chat-widget@1.0.38/dist/ordify-chat-widget.standalone.js"
|
|
143
145
|
data-ordify-widget
|
|
144
146
|
data-ordify-agent-id="your-agent-id"
|
|
145
|
-
data-ordify-
|
|
147
|
+
data-ordify-publishable-key="pk_live_..."
|
|
146
148
|
data-ordify-api-base-url="https://r.ordify.ai"
|
|
147
149
|
data-ordify-button-text="Chat with us"
|
|
148
150
|
data-ordify-chat-name="AI Assistant"
|
|
@@ -150,12 +152,13 @@ Add a single script tag with `data-ordify-widget` and the required/optional data
|
|
|
150
152
|
></script>
|
|
151
153
|
```
|
|
152
154
|
|
|
153
|
-
**Supported data attributes (all optional except agent-id and
|
|
155
|
+
**Supported data attributes (all optional except agent-id and one credential):**
|
|
154
156
|
|
|
155
157
|
| Attribute | Description |
|
|
156
158
|
|-----------|-------------|
|
|
157
159
|
| `data-ordify-agent-id` | **Required.** Your Ordify agent ID. |
|
|
158
|
-
| `data-ordify-
|
|
160
|
+
| `data-ordify-publishable-key` | Recommended. Your publishable key (`pk_live_...`) for browser embeds. |
|
|
161
|
+
| `data-ordify-api-key` | Legacy/deprecated for browser embeds. Prefer publishable key. |
|
|
159
162
|
| `data-ordify-api-base-url` | API base URL (default: `https://r.ordify.ai`). |
|
|
160
163
|
| `data-ordify-button-text` | Floating button label. |
|
|
161
164
|
| `data-ordify-chat-name` | Chat header title. |
|
|
@@ -176,10 +179,10 @@ Add a single script tag with `data-ordify-widget` and the required/optional data
|
|
|
176
179
|
|
|
177
180
|
**Where to put your API key and Agent ID**
|
|
178
181
|
|
|
179
|
-
The widget does **not** use a separate config file. You put the Agent ID and
|
|
182
|
+
The widget does **not** use a separate config file. You put the Agent ID and credential in the same place as the script:
|
|
180
183
|
|
|
181
|
-
- **Option 1 (script + mount):** In the inline snippet, replace `"your-agent-id"` and `"
|
|
182
|
-
- **Option 2 (data attributes):** In the script tag, set `data-ordify-agent-id="your-agent-id"` and `data-ordify-
|
|
184
|
+
- **Option 1 (script + mount):** In the inline snippet, replace `"your-agent-id"` and `"pk_live_..."` with your real values.
|
|
185
|
+
- **Option 2 (data attributes):** In the script tag, set `data-ordify-agent-id="your-agent-id"` and `data-ordify-publishable-key="pk_live_..."` (and optionally `data-ordify-api-base-url`).
|
|
183
186
|
|
|
184
187
|
So the “config” is the snippet or script tag you paste; the credentials are inside it.
|
|
185
188
|
|
|
@@ -197,7 +200,7 @@ So the “config” is the snippet or script tag you paste; the credentials are
|
|
|
197
200
|
```tsx
|
|
198
201
|
<OrdifyChat
|
|
199
202
|
agentId="your-agent-id"
|
|
200
|
-
|
|
203
|
+
publishableKey="pk_live_..."
|
|
201
204
|
mode="floating"
|
|
202
205
|
position="bottom-right"
|
|
203
206
|
buttonText="AI Chat"
|
|
@@ -208,7 +211,7 @@ So the “config” is the snippet or script tag you paste; the credentials are
|
|
|
208
211
|
```tsx
|
|
209
212
|
<OrdifyChat
|
|
210
213
|
agentId="your-agent-id"
|
|
211
|
-
|
|
214
|
+
publishableKey="pk_live_..."
|
|
212
215
|
mode="embedded"
|
|
213
216
|
height="500px"
|
|
214
217
|
chatName="Support Assistant"
|
|
@@ -223,7 +226,8 @@ So the “config” is the snippet or script tag you paste; the credentials are
|
|
|
223
226
|
| Option | Type | Default | Description |
|
|
224
227
|
|--------|------|---------|-------------|
|
|
225
228
|
| `agentId` | string | - | **Required** - Your Ordify agent ID |
|
|
226
|
-
| `
|
|
229
|
+
| `publishableKey` | string | - | Recommended for browser embeds (`pk_live_...`) |
|
|
230
|
+
| `apiKey` | string | - | Legacy browser credential (supported for migration) |
|
|
227
231
|
| `apiBaseUrl` | string | - | **Required** - API endpoint URL |
|
|
228
232
|
| `chatName` | string | "Chat Assistant" | Title text in chat header |
|
|
229
233
|
| `buttonText` | string | "AI Chat" | Text on floating button |
|