File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,22 @@ export interface AdditionalTiptapCollabProviderWebsocketConfiguration {
17
17
* If you are using the on-premise version of TiptapCollab, put your baseUrl here (e.g. https://collab.yourdomain.com)
18
18
*/
19
19
baseUrl ?: string
20
+
21
+ /**
22
+ * Only fill this if you are using Tiptap Collab HA.
23
+ */
24
+ shardKey ?: string
20
25
}
21
26
22
27
export class TiptapCollabProviderWebsocket extends HocuspocusProviderWebsocket {
23
28
constructor ( configuration : TiptapCollabProviderWebsocketConfiguration ) {
24
- super ( { ...configuration as HocuspocusProviderWebsocketConfiguration , url : configuration . baseUrl ?? `wss://${ configuration . appId } .collab.tiptap.cloud` } )
29
+ let url = configuration . baseUrl ?? `wss://${ configuration . appId } .collab.tiptap.cloud`
30
+
31
+ if ( configuration . shardKey ) {
32
+ url += url . includes ( '?' ) ? '&' : '?'
33
+ url += `shard=${ configuration . shardKey } `
34
+ }
35
+
36
+ super ( { ...configuration as HocuspocusProviderWebsocketConfiguration , url } )
25
37
}
26
38
}
You can’t perform that action at this time.
0 commit comments