@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.
Files changed (2) hide show
  1. package/README.md +49 -13
  2. 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
- <!DOCTYPE html>
27
- <html lang="en">
28
- <head>
29
- <meta charset="UTF-8" />
30
- <title>Chatbot Test</title>
31
- </head>
32
- <body>
33
- Hello world
34
-
35
- <!-- Chatbot Widget -->
36
- <script src="https://cdn.jsdelivr.net/npm/@kvsnguyen/chatbot-widget/dist/widget.global.js"></script>
37
- </body>
38
- </html>
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
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvsnguyen/chatbot-widget",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "main": "dist/widget.global.js",
6
6
  "files": [