react-peer-chat 0.6.0 → 0.6.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 +28 -0
- package/dist/index.js +5 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -110,6 +110,34 @@ export default function App() {
|
|
|
110
110
|
</Chat>
|
|
111
111
|
}
|
|
112
112
|
```
|
|
113
|
+
#### Custom ICE Servers
|
|
114
|
+
You can also use custom ICE servers to avoid any connectivity issues in case free TURN server limit provided by `react-peer-chat` expires.
|
|
115
|
+
```jsx
|
|
116
|
+
import React from 'react';
|
|
117
|
+
import Chat from 'react-peer-chat';
|
|
118
|
+
import 'react-peer-chat/dist/styles.css';
|
|
119
|
+
|
|
120
|
+
export default function App() {
|
|
121
|
+
return <Chat
|
|
122
|
+
name='John Doe'
|
|
123
|
+
peerId='my-unique-id'
|
|
124
|
+
remotePeerId='remote-unique-id'
|
|
125
|
+
peerOptions={{
|
|
126
|
+
config: {
|
|
127
|
+
iceServers: [
|
|
128
|
+
{ urls: "stun:stun-server.example.com:19302" },
|
|
129
|
+
{
|
|
130
|
+
urls: 'turn:turn-server.example.com:19403',
|
|
131
|
+
username: 'optional-username',
|
|
132
|
+
credential: 'auth-token'
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
// other peerjs options (optional)
|
|
137
|
+
}}
|
|
138
|
+
/>
|
|
139
|
+
}
|
|
140
|
+
```
|
|
113
141
|
## Chat Component API Reference
|
|
114
142
|
Here is the full API for the `<Chat>` component, these properties can be set on an instance of Chat:
|
|
115
143
|
| Parameter | Type | Required | Default | Description |
|
package/dist/index.js
CHANGED
|
@@ -2,11 +2,11 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
|
2
2
|
import useStorage, { removeStorage } from './storage.js';
|
|
3
3
|
import { BiSolidMessageDetail, BiSolidMessageX, BsFillMicFill, BsFillMicMuteFill, GrSend } from './icons.js';
|
|
4
4
|
const turnAccounts = [
|
|
5
|
-
{ username: "
|
|
6
|
-
{ username: "
|
|
7
|
-
{ username: "
|
|
8
|
-
{ username: "
|
|
9
|
-
{ username: "
|
|
5
|
+
{ username: "70061a377b51f3a3d01c11e3", credential: "lHV4NYJ5Rfl5JNa9" },
|
|
6
|
+
{ username: "13b19eb65bbf6e9f96d64b72", credential: "7R9P/+7y7Q516Etv" },
|
|
7
|
+
{ username: "3469603f5cdc7ca4a1e891ae", credential: "/jMyLSDbbcgqpVQv" },
|
|
8
|
+
{ username: "a7926f4dcc4a688d41f89752", credential: "ZYM8jFYeb8bQkL+N" },
|
|
9
|
+
{ username: "0be25ab7f61d9d733ba94809", credential: "hiiSwWVch+ftt3SX" },
|
|
10
10
|
{ username: "3c25ba948daeab04f9b66187", credential: "FQB3GQwd27Y0dPeK" }
|
|
11
11
|
];
|
|
12
12
|
const defaultConfig = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-peer-chat",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "An easy to use react component for impleting peer-to-peer chatting.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"react-dom": ">=16.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@types/react": "^18.2.
|
|
39
|
+
"@types/react": "^18.2.48"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"peerjs": "^1.5.2"
|