Skip to content

Commit ce95ba8

Browse files
committedMay 9, 2024·
add docs for url parameters
1 parent d8f1e6b commit ce95ba8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ import { WebsocketProvider } from 'y-websocket'
8282
wsOpts = {
8383
// Set this to `false` if you want to connect manually using wsProvider.connect()
8484
connect: true,
85-
// Specify a query-string that will be url-encoded and attached to the `serverUrl`
85+
// Specify a query-string / url parameters that will be url-encoded and attached to the `serverUrl`
8686
// I.e. params = { auth: "bearer" } will be transformed to "?auth=bearer"
8787
params: {}, // Object<string,string>
8888
// You may polyill the Websocket object (https://developer.mozilla.org/en-US/docs/Web/API/WebSocket).
@@ -106,6 +106,10 @@ wsOpts = {
106106
<dd>True if this instance is currently communicating to other browser-windows via BroadcastChannel.</dd>
107107
<b><code>wsProvider.synced: boolean</code></b>
108108
<dd>True if this instance is currently connected and synced with the server.</dd>
109+
<b><code>wsProvider.params : boolean</code></b>
110+
<dd>The specified url parameters. This can be safely updated, the new values
111+
will be used when a new connction is established. If this contains an
112+
auth token, it should be updated regularly.</dd>
109113
<b><code>wsProvider.disconnect()</code></b>
110114
<dd>Disconnect from the server and don't try to reconnect.</dd>
111115
<b><code>wsProvider.connect()</code></b>

0 commit comments

Comments
 (0)
Please sign in to comment.