@waysdrop/chat 1.0.0 → 1.0.1
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 +7 -16
- package/package.json +5 -8
package/README.md
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @waysdrop/chat
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A floating support chat widget for React apps, backed by Socket.IO.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
|
-
This is a private GitHub package. Your machine needs access to the `WaysdropHQ` GitHub org.
|
|
10
|
-
|
|
11
9
|
```bash
|
|
12
|
-
npm install
|
|
10
|
+
npm install @waysdrop/chat
|
|
13
11
|
```
|
|
14
12
|
|
|
15
|
-
Pin to a specific tag always. Avoid `#main` in production.
|
|
16
|
-
|
|
17
13
|
**Peer dependencies** — install these if not already in your project:
|
|
18
14
|
|
|
19
15
|
```bash
|
|
@@ -25,7 +21,7 @@ npm install react react-dom
|
|
|
25
21
|
## Usage
|
|
26
22
|
|
|
27
23
|
```tsx
|
|
28
|
-
import { ChatWidget } from '
|
|
24
|
+
import { ChatWidget } from '@waysdrop/chat'
|
|
29
25
|
|
|
30
26
|
export default function App() {
|
|
31
27
|
return (
|
|
@@ -57,7 +53,7 @@ type ChatConfig = {
|
|
|
57
53
|
**Visitor flow** — when `token` is omitted, the widget assigns the user a `visitorId` on first connect and persists it to `localStorage` automatically. On subsequent loads, it reads it back. You can also manage this yourself:
|
|
58
54
|
|
|
59
55
|
```ts
|
|
60
|
-
import { loadVisitorId, saveVisitorId, clearVisitorId } from '
|
|
56
|
+
import { loadVisitorId, saveVisitorId, clearVisitorId } from '@waysdrop/chat'
|
|
61
57
|
|
|
62
58
|
loadVisitorId() // reads from localStorage
|
|
63
59
|
saveVisitorId(id) // writes to localStorage
|
|
@@ -123,22 +119,17 @@ type SocketError = {
|
|
|
123
119
|
|
|
124
120
|
## Versioning
|
|
125
121
|
|
|
126
|
-
After changes, bump the version and
|
|
122
|
+
After changes, bump the version and publish:
|
|
127
123
|
|
|
128
124
|
```bash
|
|
129
125
|
npm version patch # bug fix
|
|
130
126
|
npm version minor # new feature
|
|
131
127
|
npm version major # breaking change
|
|
132
128
|
|
|
129
|
+
npm publish --access public
|
|
133
130
|
git push origin main --tags
|
|
134
131
|
```
|
|
135
132
|
|
|
136
|
-
Consuming projects update their reference:
|
|
137
|
-
|
|
138
|
-
```json
|
|
139
|
-
"ways-chat": "github:WaysdropHQ/ways-chat#v1.0.1"
|
|
140
|
-
```
|
|
141
|
-
|
|
142
133
|
---
|
|
143
134
|
|
|
144
135
|
## Socket Events
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@waysdrop/chat",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Floating support chat widget for React apps",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"homepage": "https://waysdrop.com",
|
|
4
7
|
"type": "module",
|
|
5
8
|
"main": "./dist/index.cjs",
|
|
6
9
|
"module": "./dist/index.js",
|
|
@@ -12,13 +15,7 @@
|
|
|
12
15
|
"require": "./dist/index.cjs"
|
|
13
16
|
}
|
|
14
17
|
},
|
|
15
|
-
"files": [
|
|
16
|
-
"dist"
|
|
17
|
-
],
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/WaysdropHQ/ways-chat.git"
|
|
21
|
-
},
|
|
18
|
+
"files": ["dist"],
|
|
22
19
|
"scripts": {
|
|
23
20
|
"build": "tsup",
|
|
24
21
|
"dev": "tsup --watch",
|