@kvsnguyen/chatbot-widget 0.1.0 → 0.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.
- package/README.md +49 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,17 +23,53 @@ This version **auto-mounts** on page load — no need to call `init()`. It comes
|
|
|
23
23
|
Copy-paste **1 script tag** into your HTML:
|
|
24
24
|
|
|
25
25
|
```html
|
|
26
|
-
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
<!-- Chatbot Widget -->
|
|
27
|
+
<script src="https://cdn.jsdelivr.net/npm/@kvsnguyen/chatbot-widget/dist/widget.global.js"></script>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 2️⃣ Use via npm package
|
|
31
|
+
|
|
32
|
+
Install the package:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install @kvsnguyen/chatbot-widget
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Import in your React / Next.js project:
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import "@kvsnguyen/chatbot-widget/dist/widget.global.js"; // auto-mounts
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 3️⃣ Development
|
|
45
|
+
|
|
46
|
+
Clone the repo:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
git clone <repo-url>
|
|
50
|
+
cd chatbot-widget
|
|
51
|
+
npm install
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Build the widget:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm run build
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Output bundle: **dist/widget.global.js**
|
|
61
|
+
|
|
62
|
+
## 4️⃣ Publish to npm
|
|
63
|
+
|
|
64
|
+
**1.** Ensure "private": false in package.json.
|
|
65
|
+
**2.** Build:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm run build
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**3.** Publish:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm publish --access public
|
|
39
75
|
```
|