@pindai-ai/chat-widget 2.0.0 → 2.0.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.
- package/README.md +74 -37
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,10 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
> Modern, accessible chat widget for Pindai.ai - AI-powered document extraction for Indonesian enterprises
|
|
4
4
|
|
|
5
|
-

|
|
6
|
-
|
|
7
5
|
[](https://www.npmjs.com/package/@pindai-ai/chat-widget)
|
|
6
|
+
[](https://www.npmjs.com/package/@pindai-ai/chat-widget)
|
|
8
7
|
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
[](https://www.jsdelivr.com/package/npm/@pindai-ai/chat-widget)
|
|
9
|
+
|
|
10
|
+
## 🚀 Quick Start
|
|
11
|
+
|
|
12
|
+
```html
|
|
13
|
+
<!-- Add this to your HTML -->
|
|
14
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@pindai-ai/chat-widget@2/dist/pindai-chat-widget.css">
|
|
15
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@pindai-ai/chat-widget@2/dist/pindai-chat-widget.js"></script>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
19
|
+
window.PindaiChatWidget.init({
|
|
20
|
+
webhookUrl: 'https://your-backend.com/webhook/chat'
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
```
|
|
9
25
|
|
|
10
26
|
## ✨ Features
|
|
11
27
|
|
|
@@ -35,6 +51,7 @@ npm install @pindai-ai/chat-widget
|
|
|
35
51
|
|
|
36
52
|
### Via CDN (jsDelivr)
|
|
37
53
|
|
|
54
|
+
**Latest 2.x version (recommended):**
|
|
38
55
|
```html
|
|
39
56
|
<link rel="stylesheet"
|
|
40
57
|
href="https://cdn.jsdelivr.net/npm/@pindai-ai/chat-widget@2/dist/pindai-chat-widget.css">
|
|
@@ -42,6 +59,16 @@ npm install @pindai-ai/chat-widget
|
|
|
42
59
|
src="https://cdn.jsdelivr.net/npm/@pindai-ai/chat-widget@2/dist/pindai-chat-widget.js"></script>
|
|
43
60
|
```
|
|
44
61
|
|
|
62
|
+
**Specific version (2.0.1):**
|
|
63
|
+
```html
|
|
64
|
+
<link rel="stylesheet"
|
|
65
|
+
href="https://cdn.jsdelivr.net/npm/@pindai-ai/chat-widget@2.0.1/dist/pindai-chat-widget.css">
|
|
66
|
+
<script type="module"
|
|
67
|
+
src="https://cdn.jsdelivr.net/npm/@pindai-ai/chat-widget@2.0.1/dist/pindai-chat-widget.js"></script>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
> Using `@2` automatically gives you the latest 2.x.x version with bug fixes and improvements. Use `@2.0.1` if you need a specific version.
|
|
71
|
+
|
|
45
72
|
### Local Development
|
|
46
73
|
|
|
47
74
|
```bash
|
|
@@ -61,29 +88,9 @@ npm run build
|
|
|
61
88
|
|
|
62
89
|
---
|
|
63
90
|
|
|
64
|
-
##
|
|
65
|
-
|
|
66
|
-
### Simplest Way to Embed
|
|
67
|
-
|
|
68
|
-
Add this to your website before the closing `</body>` tag:
|
|
69
|
-
|
|
70
|
-
```html
|
|
71
|
-
<!-- Add near the end of your body tag -->
|
|
72
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@pindai-ai/chat-widget@2/dist/pindai-chat-widget.css">
|
|
73
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@pindai-ai/chat-widget@2/dist/pindai-chat-widget.js"></script>
|
|
74
|
-
|
|
75
|
-
<script>
|
|
76
|
-
document.addEventListener('DOMContentLoaded', function () {
|
|
77
|
-
window.PindaiChatWidget.init({
|
|
78
|
-
webhookUrl: 'https://your-backend.com/webhook/chat' // Change this to your backend URL
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
</script>
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
That's it! Replace `your-backend.com/webhook/chat` with your actual endpoint URL.
|
|
91
|
+
## 📖 Usage Examples
|
|
85
92
|
|
|
86
|
-
### Complete Example
|
|
93
|
+
### Complete HTML Example
|
|
87
94
|
|
|
88
95
|
```html
|
|
89
96
|
<!DOCTYPE html>
|
|
@@ -206,17 +213,28 @@ Your backend should respond with JSON:
|
|
|
206
213
|
### Example Backend Implementations
|
|
207
214
|
|
|
208
215
|
<details>
|
|
209
|
-
<summary><strong>n8n Workflow</strong></summary>
|
|
216
|
+
<summary><strong>n8n Workflow (Recommended)</strong></summary>
|
|
210
217
|
|
|
211
|
-
|
|
212
|
-
2. Add "Chat Trigger" or custom AI logic
|
|
213
|
-
3. Return JSON with `response` field
|
|
218
|
+
We provide a ready-to-use n8n workflow with AI chat memory!
|
|
214
219
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
+
**Quick Setup:**
|
|
221
|
+
|
|
222
|
+
1. Import the workflow from [`pindai-chat-workflow.json`](./pindai-chat-workflow.json)
|
|
223
|
+
2. Add your OpenAI API key to the "OpenAI Chat Model" node
|
|
224
|
+
3. Activate the workflow
|
|
225
|
+
4. Copy the webhook URL and use it in your widget
|
|
226
|
+
|
|
227
|
+
**What's included:**
|
|
228
|
+
- AI Agent with Indonesian system prompt
|
|
229
|
+
- Chat memory (remembers last 10 messages per session)
|
|
230
|
+
- Automatic response formatting
|
|
231
|
+
- Ready for production use
|
|
232
|
+
|
|
233
|
+
For detailed setup instructions, see [N8N_WORKFLOW_GUIDE.md](./N8N_WORKFLOW_GUIDE.md)
|
|
234
|
+
|
|
235
|
+
**Simple Test Workflow:**
|
|
236
|
+
|
|
237
|
+
If you want to test without AI first, use [`pindai-chat-workflow-simple.json`](./pindai-chat-workflow-simple.json) - no API keys needed!
|
|
220
238
|
|
|
221
239
|
</details>
|
|
222
240
|
|
|
@@ -409,6 +427,15 @@ npm run preview
|
|
|
409
427
|
|
|
410
428
|
## 📝 Changelog
|
|
411
429
|
|
|
430
|
+
### Version 2.0.1 (2026-02-06)
|
|
431
|
+
|
|
432
|
+
**Updates:**
|
|
433
|
+
- Vendor-agnostic API: Changed `n8nUrl` to `webhookUrl` parameter
|
|
434
|
+
- Added backward compatibility for `n8nUrl`
|
|
435
|
+
- Added "Powered by Pindai.ai" watermark in widget footer
|
|
436
|
+
- Updated documentation with n8n workflow examples
|
|
437
|
+
- Included ready-to-use n8n workflow JSON files
|
|
438
|
+
|
|
412
439
|
### Version 2.0.0 (2026-02-05)
|
|
413
440
|
|
|
414
441
|
**Major Changes:**
|
|
@@ -464,19 +491,29 @@ MIT © [Pindai.ai](https://pindai.ai)
|
|
|
464
491
|
|
|
465
492
|
---
|
|
466
493
|
|
|
494
|
+
## 🔗 Links
|
|
495
|
+
|
|
496
|
+
- **npm Package:** [npmjs.com/package/@pindai-ai/chat-widget](https://www.npmjs.com/package/@pindai-ai/chat-widget)
|
|
497
|
+
- **jsDelivr CDN:** [jsdelivr.com/package/npm/@pindai-ai/chat-widget](https://www.jsdelivr.com/package/npm/@pindai-ai/chat-widget)
|
|
498
|
+
- **GitHub Repository:** [github.com/pindai-ai/pindai-chat-widget](https://github.com/pindai-ai/pindai-chat-widget)
|
|
499
|
+
- **Issues & Bugs:** [github.com/pindai-ai/pindai-chat-widget/issues](https://github.com/pindai-ai/pindai-chat-widget/issues)
|
|
500
|
+
- **Pindai.ai Website:** [pindai.ai](https://pindai.ai)
|
|
501
|
+
|
|
502
|
+
---
|
|
503
|
+
|
|
467
504
|
## 🆘 Support
|
|
468
505
|
|
|
469
|
-
- **Documentation:** [
|
|
470
|
-
- **Issues:** [
|
|
506
|
+
- **Documentation:** [N8N_WORKFLOW_GUIDE.md](./N8N_WORKFLOW_GUIDE.md)
|
|
507
|
+
- **Issues:** [GitHub Issues](https://github.com/pindai-ai/pindai-chat-widget/issues)
|
|
471
508
|
- **Email:** support@pindai.ai
|
|
472
|
-
- **Website:** [
|
|
509
|
+
- **Website:** [pindai.ai](https://pindai.ai)
|
|
473
510
|
|
|
474
511
|
---
|
|
475
512
|
|
|
476
513
|
## 🙏 Acknowledgments
|
|
477
514
|
|
|
478
515
|
- Inspired by HubSpot chat widget design patterns
|
|
479
|
-
- Built with modern web standards
|
|
516
|
+
- Built with modern web standards and accessibility best practices
|
|
480
517
|
- Designed for Indonesian enterprises
|
|
481
518
|
- Powered by Pindai.ai's AI document extraction technology
|
|
482
519
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pindai-ai/chat-widget",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Modern, accessible chat widget for Pindai.ai",
|
|
5
5
|
"main": "dist/pindai-chat-widget.js",
|
|
6
6
|
"style": "dist/pindai-chat-widget.css",
|
|
@@ -58,4 +58,4 @@
|
|
|
58
58
|
"node": ">=16.0.0",
|
|
59
59
|
"npm": ">=8.0.0"
|
|
60
60
|
}
|
|
61
|
-
}
|
|
61
|
+
}
|