@talkjs/core 0.0.3 → 0.0.5
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 +3 -3
- package/package.json +5 -2
- package/dist/talkSession.d.ts +0 -2231
- package/dist/talkSession.js +0 -3200
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ session.currentUser.createIfNotExists({ name: "Alice" });
|
|
|
39
39
|
const conversation = session.conversation("my_conversation");
|
|
40
40
|
conversation.createIfNotExists();
|
|
41
41
|
|
|
42
|
-
conversation.subscribeMessages(messages => {
|
|
42
|
+
conversation.subscribeMessages((messages) => {
|
|
43
43
|
console.log(messages);
|
|
44
44
|
});
|
|
45
45
|
```
|
|
@@ -55,12 +55,12 @@ The `@talkjs/core` package uses `WebSocket`s to create a connection to the TalkJ
|
|
|
55
55
|
If you are using an older version of Node.js without built-in support for `WebSocket`s, you will need to add support with a library. We recommend installing the [ws](https://www.npmjs.com/package/ws) package. Then tell `@talkjs/core` to use `WebSocket` from the library:
|
|
56
56
|
|
|
57
57
|
```js
|
|
58
|
-
import {
|
|
58
|
+
import { getTalkSession, registerPolyfills } from "@talkjs/core";
|
|
59
59
|
import { WebSocket } from "ws";
|
|
60
60
|
|
|
61
61
|
registerPolyfills({ WebSocket: WebSocket });
|
|
62
62
|
|
|
63
|
-
const session =
|
|
63
|
+
const session = getTalkSession(...);
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
## Support
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@talkjs/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Lets you connect to your TalkJS chat as a user and read, subscribe to, and update your chat data.",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://talkjs.com/?chat"
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"files": [
|
|
12
12
|
"dist/talkSession.js",
|
|
13
|
+
"dist/talkSession.cjs",
|
|
13
14
|
"dist/talkSession.d.ts",
|
|
14
15
|
"LICENSE.md"
|
|
15
16
|
],
|
|
@@ -38,9 +39,11 @@
|
|
|
38
39
|
"@types/ws": "^8.18.0",
|
|
39
40
|
"eslint": "^9.21.0",
|
|
40
41
|
"globals": "^16.0.0",
|
|
42
|
+
"jssha": "^2.2.0",
|
|
41
43
|
"terser": "^5.39.0",
|
|
42
44
|
"typescript": "^5.8.2",
|
|
43
45
|
"typescript-eslint": "^8.26.0",
|
|
46
|
+
"uuid": "^11.1.0",
|
|
44
47
|
"vite": "^6.2.0",
|
|
45
48
|
"vite-plugin-dts": "^3.7.3",
|
|
46
49
|
"vite-plugin-externalize-deps": "^0.9.0",
|
|
@@ -66,4 +69,4 @@
|
|
|
66
69
|
"notification",
|
|
67
70
|
"notifications"
|
|
68
71
|
]
|
|
69
|
-
}
|
|
72
|
+
}
|